Bug 7093 - LD is unable to create reloacatable from binary
Summary: LD is unable to create reloacatable from binary
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-10 23:43 UTC by Søren Holm
Modified: 2009-04-09 17:31 UTC (History)
1 user (show)

See Also:
Host:
Target: arm-elf
Build:
Last reconfirmed:


Attachments
Check input file type before processing it as an ARM ELF object file (344 bytes, patch)
2008-12-23 11:41 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Søren Holm 2008-12-10 23:43:38 UTC
Trying to create a relocatable object from a binary file generates and error :

 arm-elf-ld -r -b binary -o pleoff.o stripbmp


arm-elf-ld: BFD (GNU Binutils) 2.19 internal error, aborting at
/home/sgh/cvs/toolchain/i686-linux-gnu-arm-elf_build//binutils-2.19/bfd/elf.c
line 370 in bfd_elf_get_elf_syms

arm-elf-ld: Please report this bug.


It does not matter what type of file I'm trying. It fails everytime.
Comment 1 Nick Clifton 2008-12-23 11:41:39 UTC
Created attachment 3624 [details]
Check input file type before processing it as an ARM ELF object file
Comment 2 Nick Clifton 2008-12-23 11:44:25 UTC
Hi Soren,

  Thanks for reporting this bug.  I have checked in the uploaded patch to fix
the problem, along with the changelog entry below.

  By the way - are you aware of the .incbin assembler pseudo-op which can be
used to insert binary data into an assembler source file ?  Using it is an
easier way to create an object file from binary data.

Cheers
  Nick
Comment 3 Nick Clifton 2008-12-23 11:44:51 UTC
oops - forgot the changelog entry:

bfd/ChangeLog
2008-12-23  Nick Clifton  <nickc@redhat.com>

	PR 7093
	* elf32-arm.c (bfd_elf32_arm_init_maps): Only process ARM ELF
	object files.
Comment 4 Sourceware Commits 2008-12-23 11:46:31 UTC
Subject: Bug 7093

CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2008-12-23 11:46:17

Modified files:
	bfd            : ChangeLog elf32-arm.c 

Log message:
	PR 7093
	* elf32-arm.c (bfd_elf32_arm_init_maps): Only process ARM ELF
	object files.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4401&r2=1.4402
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-arm.c.diff?cvsroot=src&r1=1.162&r2=1.163

Comment 5 Søren Holm 2008-12-25 21:48:36 UTC
This works great. 
Thank you Nick :D
Comment 6 Søren Holm 2009-02-20 15:50:17 UTC
I'm reopening this bug because the newest releast now says the following under
the earlier descibed circumstances.

arm-elf-ld: BFD (GNU Binutils) 2.19.1 internal error, aborting at
/home/sgh/cvs/toolchain/i686-linux-gnu-arm-elf_build//binutils-2.19.1/bfd/elf.c
line 370 in bfd_elf_get_elf_syms
Comment 7 Søren Holm 2009-02-20 15:59:40 UTC
Hmm.. it's the same bug. Pleas apply the patch to the next release.
Comment 8 Nick Clifton 2009-04-09 14:45:32 UTC
Hi Soren,

  The patch is applied to the mainline code and will be present in the next release.

Cheers
  Nick
Comment 9 Søren Holm 2009-04-09 17:31:11 UTC
excellent, thanks :D