arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536
Shaun Jackman
sjackman@gmail.com
Mon Aug 1 20:38:00 GMT 2005
On 7/31/05, Nick Clifton <nickc@redhat.com> wrote:
> > Good news! I found the test case that reproduces my bug. It involves objcopy:
>
> And ignoring a rather important warning message from the linker:
Indeed; my apologies for the extra trouble this caused. I've been
using objcopy to include a binary blob in an executable for some time.
It worked nicely for years, and then about a year ago it started
generating a warning. Since it still worked though, I'd learned to
simply ignore the warning. I didn't attribute this crash to the same
warning I've been ignoring for so long.
$ arm-elf-gcc -c hello.c
$ echo data > data
$ arm-elf-objcopy -Ibinary -Oelf32-littlearm data data.o
$ arm-elf-gcc hello.o data.o
/usr/local/lib/gcc/arm-elf/4.0.1/../../../../arm-elf/bin/ld: warning:
unknown architecture of input file `data.o' is incompatible with arm
output
$ file hello.o data.o
hello.o: ELF 32-bit LSB relocatable, ARM, version 1 (ARM), not stripped
data.o: ELF 32-bit LSB relocatable, no machine, version 1 (ARM), not stripped
It looks like the warning is caused by the machine field of the object
file created by objcopy being set to 'no machine' instead of 'ARM'.
Can I pass an option to objcopy to change the machine field? Or
perhaps the machine field should default to 'ARM'.
> > unknown architecture of input file `empty.o' is incompatible with arm
> > output
>
> But nevertheless the linker should not seg fault, so I have created a
> patch to fix the problem.
>
> Could you do me a couple of favours please ?
>
> 1. Could you try out the attached patch and make sure that it works
> for you with your original test case.
It does! Thank you very much.
> 2. Please could you create a bugzilla entry for this so that we have
> somewhere to record this bug, how to reproduce it and how it was fixed.
http://sourceware.org/bugzilla/show_bug.cgi?id=1147
Thanks, Nick! Cheers,
Shaun
More information about the Binutils
mailing list