Elf32 using wrong bfd_add_symbols (shows up as SEGV in arm-linux-ld)
Jan Vroonhof
jan.vroonhof@insignia.com
Thu Aug 24 01:39:00 GMT 2000
[Please CC. I'm not subscribed]
Linenumbers below are from binutils 2.10 (but the crash is also
observed with late 2.9.5 versions).
One of our applications currently doesn't link when crosscompiling for linux-arm.
Both collect2 from gcc-2.95.2 and ld give a segmentation fault in elf_output_bfd
on line 5638 of elflink.h which does
rh = elf_sym_hashes (input_bfd)[indx];
The problem is that the sym_hashes array is NULL. The reason for that is
that the bfd library calls the generic bfd_link_add_symbols instead of the elf32
version.
I can't figure out at the moment how that happens, but hand-editing out the superfluous test
in elf32-target,h make the SEGV go away.
Jan
diff -u /scratch/jvroonhof/binutils-2.10.0.18/builddir-arm/bfd/elf32-target.h~ /scratch/jvroonhof/binutils-2.10.0.18/builddir-arm/bfd/elf32-target.h
--- /scratch/jvroonhof/binutils-2.10.0.18/builddir-arm/bfd/elf32-target.h~ Thu Aug 24 09:27:17 2000
+++ /scratch/jvroonhof/binutils-2.10.0.18/builddir-arm/bfd/elf32-target.h Thu Aug 24 09:27:17 2000
@@ -161,8 +161,9 @@
#define bfd_elf32_bfd_link_hash_table_create \
_bfd_generic_link_hash_table_create
#endif
-#ifndef bfd_elf32_bfd_link_add_symbols
-#define bfd_elf32_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#if 0
+ /* bfd_elf32_bfd_link_add_symbol */
+#define bfd_elf32_bfd_link_add_symbols bfd_elf_link_add_symbols
#endif
#ifndef bfd_elf32_bfd_final_link
#define bfd_elf32_bfd_final_link _bfd_generic_final_link
More information about the Binutils
mailing list