This is the mail archive of the binutils@sourceware.org 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: Return false on dynamic symbol error


Hi,

I checked in this patch so that we generate

[hjl@gnu-6 ifunc-textrel]$ make
./ld -m elf_i386 -z nocombreloc -shared -o libfoo.so bar.o foo.o --version-script=libfoo.map
./ld: i386:x86-64 architecture of input file `bar.o' is incompatible with i386 output
./ld: i386:x86-64 architecture of input file `foo.o' is incompatible with i386 output
make: *** [libfoo.so] Error 1

instead of

[hjl@gnu-6 ifunc-textrel]$ ld -m elf_i386 -z nocombreloc -shared -o libfoo.so bar.o foo.o --version-script=libfoo.map
ld: i386:x86-64 architecture of input file `bar.o' is incompatible with i386 output
ld: i386:x86-64 architecture of input file `foo.o' is incompatible with i386 output
ld: BFD (Linux/GNU Binutils) 2.21.51.0.9.20110420 internal error, aborting at /net/gnu-6/export/linux/src/binutils/binutils/bfd/elf32-i386.c line 4214 in elf_i386_finish_dynamic_symbol

ld: Please report this bug.

[hjl@gnu-6 ifunc-textrel]$ 


H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 94f3e22..225a3fb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false
+	on dynamic symbol error.
+	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
+
 2011-04-20  Tristan Gingold  <gingold@adacore.com>
 
 	* config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs.
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 8934d27..1bdc05e 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -4189,7 +4189,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
 	  || plt == NULL
 	  || gotplt == NULL
 	  || relplt == NULL)
-	abort ();
+	return FALSE;
 
       /* Get the index in the procedure linkage table which
 	 corresponds to this symbol.  This is the index of this symbol
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 84ee101..6190a98 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3961,7 +3961,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 	  || plt == NULL
 	  || gotplt == NULL
 	  || relplt == NULL)
-	abort ();
+	return FALSE;
 
       /* Get the index in the procedure linkage table which
 	 corresponds to this symbol.  This is the index of this symbol


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