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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking nominally incompatible object files


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello, me again.

While I have a v850 toolchain (GCC + binutils), I'm working on hacking a
copy of the v850 bits so that I can link in libraries supplied by Green
Hills (EM_V800 not EM_V850, different relocs).

So I have a mix of GCC-compiled v850 object files, and Green Hills v800
(what I've called my "new" target) libraries.  When I link them all
together, I get:

+ /mnt/disk2/src/binutils-build/ld/ld-new -e __start -L../../../../../SDK/Lib ../../../../../SDK/Lib/crtPulsarPlus.o -lstartup -lsys
 -lind -larch -lsedgnoe -lansi ../../../../../SDK/Lib/lCore.a -o emv.elf aim.o circbuf.o emv.o file.o mafif.o main.o sps.o swevent_m
an.o tlv.o trace.o utils.o ../../../../manapp/Source/Common/data_store.o ../../../../manapp/Source/Common/event.o ../../../../manapp
/Source/Common/mailbox.o ../../../../manapp/Source/Common/memory.o
lt-ld-new: warning: v850 architecture of input file `aim.o' is incompatible with v850e output
lt-ld-new: warning: v850 architecture of input file `circbuf.o' is incompatible with v850e output

...

reloc type 2 not SUPPORTED
aim.o(.text+0x2c): In function `AimEventHandler':
/mnt/disk2/src/emv/sc5000/dev/PayApp/Emv/MafApp/Source/aim.c:42: internal error: unsupported relocation error

...

The weird thing is, that aim.o is generated by the v850 toolchain, so
its relocs cannot possibly be completely alien (if I link with the
v850-ld and remove all the v800 libraries, the errors are "undefined
reference", not "unsupported relocation").

Is the linker supposed to interpret the relocs based on the input file
format (would be nice) or based on the output file format?  Because,
what seems to be happening now, is that the linker sees relocs in an
input file of format A, but those relocs get misinterpreted as relocs in
format B, and I get segfaults.

Should I just give up now, while I can, before I involuntarily end up as
a BFD hacker?

- -- 
http://voyager.abite.co.za/~berndj/ (f1084a555d2098411cff4cefd41d2e2a1c85d18c)
"years from now, we'll look back on this, laugh nervously and quickly
change the subject" - lee
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAlSNb/FmLrNfLpjMRAmtFAKCPGToQjpHxiFPf+2B3k90BCKOT7ACcCQT/
J3LhFhbb9mtnoUTRhOdGOk4=
=1Mxe
-----END PGP SIGNATURE-----


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