This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: libiberty...
Date: Fri, 19 Nov 1999 15:19:25 -0500
From: Scott Bambrough <scottb@netwinder.org>
> Firstly, that is a bug in the dynamic linker.
No. I'm afraid I disagree. If anything it is a bug in the linker.
No. This is a standard case on all ELF platforms when linking a
non-PIC object into a shared library. On all ELF platforms, the
dynamic linker must support all standard relocations.
You can see this on i386 GNU/Linux by linking a non-PIC object into a
shared library.
The dynamic linker cannot fix this up. To do so it would have to write
to the code segment, which is read only.
Right. The code segment must be made read/write in order to support
this. When this case arises, the program linker is responsible for
putting DT_TEXTREL entry in the dynamic segment. If the binutils
linker is not doing that, then that is a bug in the binutils linker.
This does work correctly for other ELF targets; I see code in
elf32-arm.h to support it, although I don't know if it works.
The next best thing is for the linker to generate an error, for which
Nick has kindly supplied me a patch to try. Thanks Nick. If you have
some other slant on the problem I'd love to hear it.
Nick, please do not check any such patch into the sourceware site.
Ian