Subject: RE: arm jre ?

From: Jamey Hicks <[email-masked]>
Date: Wed, 2 Feb 2000 08:07:53 -0500

I ran into this yesterday as well, with kaffe-1.0.5.  Where do I find the
patched ld.so?  Is there a way to determine if a .so has been built with
-fpic?  Is it a performance problem to make -fpic the default? 

-Jamey Hicks

-----Original Message-----
From: Philip Blundell [mailto:[email-masked]]
Sent: Wednesday, February 02, 2000 4:42 AM
To: Ralph Siemsen
Cc: [email-masked]
Subject: Re: arm jre ? 

>Presumably the target is a NetWinder - this message is emitted by the
>loader when running code with 24-bit relocs.  Chances are you have not
>built the package using -fpic option, or the cross compiler is not
>configured quite right.

It'll happen on any ARM machine.  Scott has actually patched ld.so now to 
allow non-PIC shared objects, so we should see less of this in future.

p.

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for
++
++                        kernel-related discussions.
++

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Philip Blundell <[email-masked]>
Date: Wed, 02 Feb 2000 13:18:34 +0000

>Is there a way to determine if a .so has been built with

`objdump --dynamic-relocs | grep PC24' will tell you if there are any of the 
offending relocations in a shared object (if yes, chances are it was built 
without -fPIC).  You wouldn't want to make -fpic the default for application 
code but for shared libraries that's the right thing to do.

p.

---

From: Scott Bambrough <[email-masked]>
Date: Wed, 02 Feb 2000 08:35:32 -0500

> code but for shared libraries that's the right thing to do.

There are two ways to get PC24 relocs into a shared library.  One is to not
compile with -fPIC, the other is to  link in object modules from a static
library compiled without -fPIC.  It is quite often the latter which is the
cause.

The fix for ld.so requires upgrading glibc to 2.1.3.  It is not available yet. 
This version is not released yet, but should be in a couple of weeks.  If you
are in a hurry you can build your own from the CVS tree on
sourceware.cygnus.com.  

In the testing we have done here with this, this patch to ld.so is not as
effective as I might have hoped.  The PC24 reloc is for a PC relative branch. 
The offset must fit into 12 bits in the opcode.  If the jump is too far, (ie:
exceeds the distance representable in 12 bits) the dynamic linker cannot fix up
the reloc, and the same error message results.   This seems to be the case in a
large number of instances :{ .

The best way to fix this problem is to identify the offending modules, compile
them with -fPIC and relink.

Scott

-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org