[PTLsim-devel] ld problem

Matt T. Yourst
Thu Oct 11 20:16:34 EDT 2007


On Thursday 11 October 2007 16:35, Jorge Albericio wrote:
> Hello,
> today I tried to compile ptlsim (r225) in open suse 10.3 (x86_64) in
> userspace mode, I did the same on opensuse 10.1 this week without
> errors but with the new version that contains gcc 4.2.1 and binutils
> 2.17.50  I got these errors
>
> ld: i386 architecture of input file `lowlevel-32bit.o' is incompatible
> with i386:x86-64 output
> ld: i386 architecture of input file `injectcode-32bit.o' is
> incompatible with i386:x86-64 output
> ld: i386 architecture of input file `ptlsim.dst.o' is incompatible
> with i386:x86-64 output
> make: *** [ptlsim] Error 1
>

Yes, I know about that problem - we just upgraded our own machines and 
encountered this same problem.

I was going to add a fix to the next PTLsim release, but then I realized it 
wouldn't work for people still using older linker versions.

I've come up with a patch (attached) that should work correctly for all 
versions of binutils. When it makes usage.o, it sets "-O elf64-x86-64" when 
compiling a 64-bit PTLsim and "-O elf32-i386" for 32-bit PTLsim.

Probably I'll have to come up with a similar fix for injectcode-32bit.o, since 
that's actually 32-bit code, not data. You can try to figure it out on your 
own while I do some more testing with various versions of the linker.

(see the attached patch)
        
- Matt

-------------------------------------------------------
 Matt T. Yourst                    yourst at peptidal.com
 Peptidal Research Inc., Co-Founder and Lead Architect
-------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ld-objcopy-32bit-vs-64bit.diff
Type: text/x-diff
Size: 613 bytes
Desc: not available
Url : https://ptlsim.org/pipermail/ptlsim-devel/attachments/20071011/58b7aa4b/attachment.bin 


More information about the PTLsim-devel mailing list