This is the mail archive of the binutils@sources.redhat.com 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]

Re: Elf32 using wrong bfd_add_symbols (shows up as SEGV in arm-linux-ld)


Hi Jan,

: 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.

Please could you provide more details about this problem.
Specifically a reproducible testcase would be really helpful.

Modifying elf32-target.h is not really the right way to go.  For one
thing it is an automagically generated file based on elfxx-target.h,
and the next time you do a clean in your bfd build directory, it will
go away.

Cheers
	Nick

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