Cross compiling uclibc 0.9.29 on i686-pc-linux-gnu-gcc for a arm-softfloat-linux-uclibc ran into a segfault on ld. Turns out the problem is the makefile hands the linker /dev/null for a file, which in turn when the bfd library tries to get the symbols there is no check for a null pointer (as there are no symbols). The simple fix is:
--- binutils-2.18.50.0.3/bfd/elf.c.orig 2008-01-29 14:48:45.000000000 -0500 +++ binutils-2.18.50.0.3/bfd/elf.c 2008-01-29 14:52:06.000000000 -0500 @@ -361,6 +361,11 @@ alloc_ext = NULL; alloc_extshndx = NULL; bed = get_elf_backend_data (ibfd); + if (bed == NULL) + { + intsym_buf = NULL; + goto out; + } extsym_size = bed->s->sizeof_sym; amt = symcount * extsym_size; pos = symtab_hdr->sh_offset + symoffset * extsym_size; I expect there probably is a more elegant solution, but this is quick and dirty. Have fun! -- Summary: ld segfault linked to bfd elf error Product: binutils Version: 2.18 Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: pdd at lgsinnovations dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=5692 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils