LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-04-2011, 02:13 AM   #1
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Relocatable linking on x86-64 for i386


Hello. I am trying to make relocatable linking on x86-64 box for objects in format i386

Naive
Code:
ld -r file1.o file2.o -o output.o
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to format elf64-x86-64 (output.o) is not supported
doesn't work.

But even when I add --oformat situation not improved:
Code:
ld --output-format elf32-i386 -r file1.o file2.o -o output.o
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to format elf32-i386 (output.o) is not supported
So linker correctly recognize what input and output format should be,
but for some reason don't want do it.

Do you have any ideas if it can be done at all and how?

Thanks.
Valery

Last edited by Valery Reznic; 04-04-2011 at 02:16 AM.
 
Old 04-04-2011, 06:23 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Valery Reznic View Post
But even when I add --oformat situation not improved:
Code:
ld --output-format elf32-i386 -r file1.o file2.o -o output.o
ld: Relocatable linking with relocations from format elf32-i386 (file1.o) to format elf32-i386 (output.o) is not supported
I believe the correct option is -m elf_i386

I have no idea how to get information like that from the various ld documentation I have read. I have searched that documentation many times trying to answer questions that simple and failed.

I got that one by using the command gcc -v -m32 test.c

That causes gcc to compile and link the indicated program for 32 bit, and to show you the commands used for each operation, including the ld command.

Last edited by johnsfine; 04-04-2011 at 06:27 AM.
 
1 members found this post helpful.
Old 04-04-2011, 06:34 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by johnsfine View Post
I believe the correct option is -m elf_i386

I have no idea how to get information like that from the various ld documentation I have read. I have searched that documentation many times trying to answer questions that simple and failed.

I got that one by using the command gcc -v -m32 test.c

That causes gcc to compile and link the indicated program for 32 bit, and to show you the commands used for each operation, including the ld command.
Thank you. It solved problem
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What does i386, i586 and x86-64 mean? jerkmonkee Linux - Newbie 8 08-15-2017 10:00 PM
assembly error: i386 architecture incompatible with i386:x86-64 output rohedin Programming 11 08-11-2015 08:13 AM
i386 :/x86-64 architecture of input file '*.o' is incompatible with i386 output Fiona Linux - Newbie 1 05-07-2008 07:23 AM
what is x86, i386, ect Dirty_Ink Linux - Newbie 6 05-20-2004 07:20 PM
What is x86, i386, etc... xconspirisist Linux - Hardware 3 11-08-2003 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration