This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536
- From: Shaun Jackman <sjackman at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 1 Aug 2005 14:38:47 -0600
- Subject: Re: arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536
- References: <7f45d939050728162929bb9286@mail.gmail.com> <7f45d9390507281741622c194c@mail.gmail.com> <42EA34A6.9050304@redhat.com> <7f45d9390507301517757bf0b7@mail.gmail.com> <42ED1E7E.70202@redhat.com>
- Reply-to: Shaun Jackman <sjackman at gmail dot com>
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