This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH for i386: --no-copy-relocs
- To: "Jose Luu" <jluu at mainsoft dot com>
- Subject: Re: PATCH for i386: --no-copy-relocs
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 18 Jun 2001 18:14:16 -0700
- Cc: <binutils at sources dot redhat dot com>
- References: <002101c0f82c$935bf2a0$18671ed4@fr.mainsoft.com>
"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