Relocations put in read-only segment?
Jeffrey A Law
law@cygnus.com
Fri Apr 24 16:23:00 GMT 1998
In message < 199804240119.VAA15305@lunacity.ne.mediaone.net >you write:
> When I compile the following code with egcs 1.0.2, using `-O -fPIC',
> on either i386-*-netbsd or i586-*-linux-gnulibc1, the relocation for
> `XtStrings+788' is put in a read-only section (the text section under
> NetBSD, rodata under Linux). While it's true that ld.so on both
> platforms is careful to make this work, it's canonically wrong. If
> the relocation is done in a data section at all, it should be in a
> writable section.
This is a pretty common problem; generally it's fixed by having
SELECT_SECTION and related functions put these things into the
data section for PIC code generation. Unfortunately many ports
do not handle this case correctly.
jeff
More information about the Gcc
mailing list