PATCH: Re: Versioned symbol linking bug
H. J. Lu
hjl@lucon.org
Sat Apr 26 07:20:00 GMT 2003
On Fri, Apr 25, 2003 at 11:25:34PM -0700, H. J. Lu wrote:
> On Fri, Apr 25, 2003 at 08:20:33AM -0700, H. J. Lu wrote:
> > On Fri, Apr 25, 2003 at 09:58:17AM -0400, Daniel Jacobowitz wrote:
> > > On Sat, Apr 19, 2003 at 08:50:48AM +0930, Alan Modra wrote:
> > > > On Thu, Apr 17, 2003 at 04:27:43PM -0400, Daniel Jacobowitz wrote:
> > > > > On Tue, Feb 25, 2003 at 01:28:12PM +1030, Alan Modra wrote:
> > > > > > Hi Daniel,
> > > > > > This patch cures your testcase, but I'm not game to install it
> > > > > > without a whole lot of testing, which I don't have time to do at
> > > > > > the moment.
> > > > >
> > > > > The logic seems right to me; what kind of testing can I do to increase
> > > > > your confidence? I'd like to pick this fix up for the next release.
> > > >
> > > > At the minimum, a glibc build and "make check". Preferably, a bunch
> > > > of other packages that build and use shared libs.
> > >
> > > It causes no regressions in the binutils or glibc testsuites on
> > > i686-pc-linux-gnu; Roland reported that it fixed his problem on
> > > powerpc-linux-gnu; and it fixes the vers25b2 testcase that HJ checked
> > > in a few days ago on i686-pc-linux-gnu. That's enough to convince me.
> > >
> >
> > I checked in it. We will fix it if it breaks anything, which I believe
> > is very unlikely.
> >
>
> I was right and also wrong. Alan's patch does fix the testcase. But it
> is incomplete. I have a weird large program. I got
>
> /export/build/gnu/binutils-debug/build-i686-linux/ld/ld-new: BFD 2.13.90
> 20030426 internal error, aborting at
> /export/gnu/src/binutils/binutils/bfd/elf32-i386.c line 2356 in
> elf_i386_relocate_section
>
> with the new linker. The patch enclosed here seems to fix it. I will
> try to come up with a small testcase later. The question is if my
> patch is enough and if I missed something else.
>
>
> H.J.
> 2003-04-25 H.J. Lu <hjl@gnu.org>
>
> * elflink.h (elf_merge_symbol): Also copy got.offset and
> plt.offset when we flip the indirection.
>
It is a nasty bug. Here is a small testcase.
# make
cc -fPIC -c -o ref.o ref.c
cc -fPIC -c -o reg.o reg.c
ld -o reg.so -shared --version-script=reg.v reg.o
ld -shared -o ref.so ref.o
ld -shared ref.o reg.so ref.so reg.o
ld: BFD 2.13.90.0.21 20030423 internal error, aborting at
/export/linux/src/binutils/binutils/bfd/elf32-i386.c line 2362 in
elf_i386_relocate_section
ld: Please report this bug.
make: [ref] Error 1 (ignored)
cc -c -o bad.o bad.c
ld -shared bad.o reg.so ref.so reg.o
make: *** [bad] Segmentation fault
My patch seems to fix the first one, but not the second one.
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 516 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20030426/aec1572e/attachment.bin>
More information about the Binutils
mailing list