ARM elf->coff objcopy mangles relocations?

The Chazman
Fri Jul 7 16:33:00 GMT 2000

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

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

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              Gordian, Inc.
(714) 850-0205

(personal mail:

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list