Re: Bug in arm dynamic linker?
On Wed, 23 Aug 2000, Chris Gorman wrote:
> When I attempt to start apache, I get the following error with some of
> the DSO modules ..
> Cannot load /usr/lib/apache/1.3/libphp3.so into server:
> /usr/lib/apache/1.3/libphp3.so: R_ARM_PC24 relocation out of range
> I'm wondering if this is the bug Scott Bambrough refers to in his
> netwinder.org FAQ entry? (See References:)
> The bug Scott outlines occurs
> occasionaly when the dynamic liker attempts to fixup PC24 relocs in the .text
> segment of shared libraries which are not compiled -fPIC.
> Is there a way to look at the .text segment of the shared library for PC24
> relocs? (via objdump -?) If so what would one look like? Does anyone have
> other suggestions for determining whether or not this is my bug?
objdump --dynamic-reloc /usr/lib/libimlib-jpeg.so
objdump --reloc /usr/lib/libimlib-jpeg.a
If there is a problem you will see some PC24 relocs in the .text section,
as seen from this static library.
In archive libimlib-jpeg.a:
io-jpeg.o: file format elf32-littlearm
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000020 R_ARM_PC24 jpeg_std_error
If you are using an old binutils, upgrade (220.127.116.11.3x, or 2.10). It makes
it easier to explain.
> Also if this is the bug Scott refers to, can this be rectified by
> adding a -fPIC to the build commands for apache and php3 to build
> position independent code which will bypass the introduction of PC24
> relocs into .text segments of the DSO's? Or is too oversimplified?
Yes, rebuild with -fPIC for php3.
> And finaly, is anyone aware of a newer binutils which resolves the bug
> referenced in Scott's FAQ entry?
It will actually be addressed in glibc. Scott's done a bit of work, but
it only works for small fixup currently.