arm backend crash when handling incompatible input file

Roland McGrath mcgrathr@google.com
Fri Dec 14 00:06:00 GMT 2012


When the user makes the error of throwing an incompatible object (in my
case, and i386 ELF file) into an ARM ELF link, ld generates the
"architecture of input file is incompatible with arm output" error as it
should.  But then it also crashes.

The call chain is:

	main
	lang_process
	ldemul_after_allocation
	gldarmelf_after_allocation
	elf32_arm_size_stubs
	cortex_a8_erratum_scan

It crashes because it's using elf32_arm_section_data on an input bfd that
is not arm-flavored and so doesn't use that data structure.  Clearly it
should be either bailing out entirely or skipping the nonmatching input bfd
before it gets to this point.  But it's not entirely clear to me where that
check should be made, nor what the proper method is to check for such
mismatch.

Suggestions?


Thanks,
Roland



More information about the Binutils mailing list