This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] mips/bfd/ld: Fix --as-needed on mips and update related ld tests


Attached are two patches regarding a bug with --as-needed on mips that
causes the following error when using --as-needed (example for a small
test program):

/bin/sh ../libtool --tag=CC --mode=link mipsel-linux-gcc -I../include
-g -O2 -Wl,--as-needed -o test-example test.o ../lib/
libtool: link: mipsel-linux-gcc -I../include -g -O2 -Wl,--as-needed -o
.libs/test-example test.o ../lib/.libs/ -Wl,-rpath
../lib/.libs/ multiple definition of
collect2: ld returned 1 exit status

The first patch fixes the bug by hiding _GLOBAL_OFFSET_TABLE_ in
elfxx-mips.c .  I know there was some concern that
_GLOBAL_OFFSET_TABLE_ possibly needs to be dynamic on some mips setups
(Eric mentioned SGI).  It doesn't seem to be an issue on my setup but
I thought I'd mention it here in case that comes up for someone.

The second patch updates the ld mips elf tests to account for
the change to _GLOBAL_OFFSET_TABLE_.  I ran them using `make
check' from an x86_64-linux host with target mipsel-linux-uclibc.

Follows up on the thread started by Vincent Wen (Re: binutils 2.19.92
linker broke with --as-needed flag).  For reference, see:

original email:

Based off of Hans-Peter Nilsson's Nov 2004 change to hide

This is my first patch submission here, so I'm sure I got a few things
wrong.  Any feedback is greatly appreciated! =)

Best regards,

 Gregory Fong

Attachment: binutils-2.23.2-bfd-elfxx-mips.patch
Description: Binary data

Attachment: binutils-2.23.2-ld-mips-elf_testsuite_updates.patch
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]