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: Alan Modra <amodra at bigpond dot net dot au>
- Date: Tue, 19 Jun 2001 23:33:58 +0930
- Cc: binutils at sources dot redhat dot com
- References: <002101c0f82c$935bf2a0$18671ed4@fr.mainsoft.com>
On Mon, Jun 18, 2001 at 09:25:46PM +0200, Jose Luu wrote:
> http://sources.redhat.com/ml/binutils/2000-12/msg00183.html
I had a look at your testcase and spent a little time thinking, and
am coming to the conclusion that the root cause of this problem is
that the dynamic linker is not behaving correctly.
Here's what I think the dynamic linker should do with a COPY reloc:
a) copy the initialised value of the associated variable from the
shared library into space allocated in the executable.
b) set the shared lib's .got entry for the variable to point at the
space in the executable.
That way the shared lib, which must access the variable through the
.got, will access the same space as the executable. Point (b) seems
to not be happening with glibc's dynamic loader.
Comments/corrections/discussion welcome.
Alan