This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH for i386: --no-copy-relocs
On Thu, Jun 21, 2001 at 04:33:08PM -0700, Ian Lance Taylor wrote:
> >
> > Even if we don't generate R_386_COPY for `i', it still doesn't work
> > since we will put `i' in the .bss section of the main exectuable. Since
> > DSO is built with -Wl,-Bsymbolic, updating `i' in DSO won't change
> > `i' in the main exectuable.
>
> That is how it works now, but it does not have to work that way.
> Because `i' is not a common symbol, we do not have to put it in the
> .bss section. We can just leave it as an external reference with
> dynamic relocations, and let the dynamic linker handle the relocations
> at runtime. That will cause the main executable to use the address of
> `i' in the data segment of the shared library.
I have a few questions:
1. Which dynamic relocations do you suggest we use? They have to deal
with R_386_GOT32 and R_386_32.
2. Should we do it for all DSOs or just DSOs compiled with -Bsymbolic?
3. Since we don't know what runtime DSO will be used, there will be
mismatch between link-time and run-time regarding -Bsymbolic.
I guess #2 and #3 are not that important. We can insist the compatible
DSOs should be compiled with the same -Bsymbolic option.
H.J.