PATCH for i386: --no-copy-relocs
Ian Lance Taylor
ian@zembu.com
Mon Jun 18 18:14:00 GMT 2001
"Jose Luu" <jluu@mainsoft.com> writes:
> as outlined in message
> http://sources.redhat.com/ml/binutils/2000-12/msg00183.html and
> references, here is my patch to solve the aforementionned problem.
>
> The patch has been extensively tested with our software (several
> million lines) and has been shipped to customers since march, so I
> am now trusting it. We compile it in such a way that the
> --no-copy-relocs option is always on unless the -shared option is
> active.
>
> Whether we want this mode as default or not is a matter of debate:
> This copying of relocations from shared libs into the main
> executable seems to come from the i386 ABI, no other ABI seems to
> need it, I don't know if it is a requirement that executables use
> it. The problem I am solving is a byproduct of its usage.
If I read your patch correctly, the dynamic linker will be required to
modify the text section, which means that it can not be shared when
multiple processes run the executable. I do not think that should be
default. Also, I think your patch needs to create a DT_TEXTREL if it
does not already do so.
The COPY reloc is there in order to keep the text section read-only.
The i386 is not the only ABI which uses it. Several others do as
well.
Ian
More information about the Binutils
mailing list