This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ARM elf->coff objcopy mangles relocations?



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]