Subject: glibc2-Problems

From: Stefan Hanske <[email-masked]>
Date: Thu, 23 Jul 1998 21:17:18 +0200 (METDST)

Hi,

I compiled glibc2 for ELF (static and shared versions) and binaries linked
against the shared version just won't run on my ARM710. I've tried kernel
V2.1.78 (success: tons of memory violation messages and a complete hang)
and v2.0.34 (a single segmentation fault message and a core dump).
The static version worked with a very small program (count up to ten and
print little messages).

Under kernel 2.0.34 there's a segmentation fault at 0x3470 (this time I
remember it correctly), with the link register pointing to 0x4000xxxx
(???). A first look at the binary showed nothing unusual. Could it be that
the code is still called with a 26-bit PC mode from the kernel?

Thanx for any tips & tricks... 

----------------------------------------------------------
|mailto: Stefan Hanske ([email-masked] |
|WWW : http://www.rzuser.uni-heidelberg.de/~shanske      |
|phone: I'm not silly                                    |
|--------------------------------------------------------|
| And don't forget to remember what you remembered not   |
| to forget to remember...				 |
----------------------------------------------------------

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Thu, 23 Jul 1998 22:45:56 +0100

>The static version worked with a very small program (count up to ten and

I have a suspicion that something in the current binutils isn't quite right.  
I'm looking into it now.

p.

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 23 Jul 1998 23:19:33 +0100 (BST)

> the code is still called with a 26-bit PC mode from the kernel?

I wouldn't have thought so - 2.0.34 will always run ELF in 32-bit mode.
Did you tell GCC to compile with -mapcs-32?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.uk.linux.org/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Philip Blundell <[email-masked]>
Date: Fri, 24 Jul 1998 10:06:03 +0100

>Did you tell GCC to compile with -mapcs-32?

I think there is a misfeature in the current gcc that means it defaults to 
26-bit code even for `arm-linux'.  I'll fix this.

p.

---

From: Stefan Hanske <[email-masked]>
Date: Fri, 24 Jul 1998 19:14:57 +0200 (METDST)

> Did you tell GCC to compile with -mapcs-32?

I thought this was the default for ELF in gcc-2.8.1. I'll have a look at 
the specs file. Atm. ELF-gcc only works for 32-bit modes, 26-bit PC 
support was said to be added later.

---

From: Philip Blundell <[email-masked]>
Date: Fri, 24 Jul 1998 19:53:40 +0100

>support was said to be added later.

The problem isn't really in gcc, it's the linker script that needs to change.  
It wouldn't be all that hard to engineer but nobody has shown any real 
interest yet.

The problem does still remain that GCC is a bit too keen to default to 
-mapcs-26.  I put code into the more recent glibcs to catch this and give an 
error, having tripped over it too often.

p.