public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* ARM elf->coff objcopy mangles relocations?
@ 2000-07-07 16:33 The Chazman
  0 siblings, 0 replies; only message in thread
From: The Chazman @ 2000-07-07 16:33 UTC (permalink / raw)
  To: crossgcc

Hello.  We've got a large-ish ARM-targetted project which we've been
compiling in coff format, and would like to continue doing so.  We
need to link in a third-party library which we cannot get source for.
They will only supply us with object files, and in arm-elf format.
I downloaded binutils 2.10, and compiled a multiple-target version
that understands both arm-coff and arm-elf.  I used objcopy to convert
their object files from elf to coff, but when I link, ld returns a
bunch of "relocation truncated to fit" errors in the converted files.

An excerpt from "objdump -r" on the original files...

synwindow.go:     file format elf32-littlearm

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
000005b8 R_ARM_ABS32       synthesis_win
000005f0 R_ARM_PC24        nonapcs_dctIII_32
000005f8 R_ARM_PC24        .text
00000618 R_ARM_PC24        .text


The same section from our objcopy converted files...


synwindow.go:     file format coff-arm-little

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
000005b8 ARM_32            _synthesis_win
000005f0 ARM_16            _nonapcs_dctIII_32
000005f8 ARM_16            _NONAPCS_SYNWINDOW
00000618 ARM_16            _NONAPCS_SYNWINDOW


I checked over both versions of each object file.  All the original
relocations were either of type R_ARM_ABS32 or R_ARM_PC24, and
every R_ARM_ABS32 had been converted to an ARM_32, and every
R_ARM_PC24 had been converted to an ARM_16.  I'm far from being an
expert on how relocations work, but the PC24 -> 16 conversion sounds
pretty fishy to me.  Can someone confirm for me that objcopy in
fact did not convert the relocations properly, and suggest a
workaround (other than compiling our whole project elf, a painful
road which we're reluctantly starting down)?

Thanks for your thoughts...

-------------------------------------------
Carl Miller               Firmware Engineer
chaz@gordian.com              Gordian, Inc.
(714) 850-0205       http://www.gordian.com

(personal mail: chaz@devastator.extern.ucsd.edu)

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-07 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-07 16:33 ARM elf->coff objcopy mangles relocations? The Chazman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).