[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

binutils 2.19.92 linker broke with --as-needed flag

From: Vincent Wen
Subject: binutils 2.19.92 linker broke with --as-needed flag
Date: Mon, 4 Feb 2013 17:58:37 -0800

The linker broke when as-need flag is added.

/bin/sh ../libtool --tag=CC --mode=link mipsel-linux-gcc -I../include -g -O2 -Wl,--as-needed -o test-example test.o ../lib/libTestGcc.la
libtool: link: mipsel-linux-gcc -I../include -g -O2 -Wl,--as-needed -o .libs/test-example test.o ../lib/.libs/libTestGcc.so -Wl,-rpath -Wl,/usr/local/lib
../lib/.libs/libTestGcc.so:(.got+0x0): multiple definition of `_GLOBAL_OFFSET_TABLE_'
collect2: ld returned 1 exit status

The version of ld which comes with this toolchain is:
GNU ld (GNU Binutils)

The following patch is based on Hans-Peter Nilsson's original patch. discussion thread is: http://sourceware.org/ml/binutils/2004-10/msg00457.html

--- a/bfd/elfxx-mips.c    2013-02-01 03:26:00.000000000 -0800
+++ b/bfd/elfxx-mips.c    2013-02-01 03:26:16.000000000 -0800
@@ -4681,6 +4681,7 @@
   h->non_elf = 0;
   h->def_regular = 1;
   h->type = STT_OBJECT;
+  h->other = STV_HIDDEN;
   elf_hash_table (info)->hgot = h;
   if (info->shared

reply via email to

[Prev in Thread] Current Thread [Next in Thread]