LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2008, 05:40 AM   #1
alex1983-0112
Member
 
Registered: Apr 2008
Location: Russia
Distribution: Fedora Core
Posts: 30

Rep: Reputation: 16
Problem with using ld in Cygwin


Hi all!

I have the next problem. I'm using Cygwin for build binary file written on assembler. But when I try to build binary file, ld write "PE operations on none PE file"

Here is my command line:

gcc -c myfile.S
ld -o myfile.bin -Ttext 0x0 -s --oformat binary myfile.o


Thank you!
 
Old 09-04-2008, 08:14 PM   #2
valpa
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Rep: Reputation: 15
May not answer your question.
But why not try " ld -o myfile.bin -Ttext 0x0 -s --oformat elf32-i386 myfile.o "
Also plese cat your -Ttext file.
 
Old 09-04-2008, 10:59 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

It's a limitation of "ld" on Windows (which uses the "PE" object format) - you can't create a .bin image directly. It would work just like you expect on Linux (which uses the "ELF" object format). It'll also work if you use "objcopy". Here's a link that explains further:

http://cygwin.com/ml/cygwin/2006-11/msg00323.html

'Hope that helps .. PSM
 
Old 09-05-2008, 07:19 AM   #4
alex1983-0112
Member
 
Registered: Apr 2008
Location: Russia
Distribution: Fedora Core
Posts: 30

Original Poster
Rep: Reputation: 16
Thanks to all! :-)

I'm already resolve this problem with objcopy.

Best regards, Alexey.

Last edited by alex1983-0112; 09-05-2008 at 07:21 AM.
 
Old 09-05-2008, 07:23 AM   #5
alex1983-0112
Member
 
Registered: Apr 2008
Location: Russia
Distribution: Fedora Core
Posts: 30

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by valpa View Post
Also plese cat your -Ttext file.
"-Ttext" is not file. It is option that point to address of text segment.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cygwin ncurses problem Rostfrei General 2 07-07-2006 09:50 AM
cygwin Problem scbops Linux - General 2 04-06-2006 03:32 AM
problem with cygwin linuxmandrake General 1 01-15-2005 02:26 PM
a problem about cygwin tony_bupt Linux - Newbie 4 09-05-2004 07:50 AM
cygwin ssh problem belorion Linux - General 3 02-25-2004 06:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:56 AM.

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