This is the mail archive of the cygwin mailing list for the Cygwin 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]

Re: ld: cannot perform PE operations on non PE output file 'bootsect'.


Salvatore D'Angelo wrote:

> On Linux it works fine but in cygwin I go the following link problem:
> 
> *ld: cannot perform PE operations on non PE output file 'bootsect'.
> 
> *In the cygwin mail archive I saw question like this without response
> please can someone suggest me what is wrong in my Makefile and what I
> have to change?

That's because 'as' and 'ld' on Linux and Cygwin are not configured for
the same default targets.  On Linux they create ELF objects, whereas on
Cygwin the native format is PE.  Whatever tutorial or set of
instructions you are following seem to assume an ELF assembler and
linker.

You might be able to make it work with PE by using objcopy to convert
instead of --oformat, along the lines of:

ld -Ttext 0x0 -s -o bootsect.tmp bootsect.o && \
objcopy -I pei-386 -O binary bootsect.tmp bootsect && \
rm bootsect.tmp

But this will fail if you try to do anything non-trivial that makes use
of any kind of ELF assembler directives.  Perhaps the better way to
proceed would be to build and install a cross-binutils (configure
--target=i686-pc-linux) and then use 'i686-pc-linux-as' and
'i686-pc-linux-ld' instead of 'as' and 'ld' and your Makefiles and
whatever other tutorials/samples/guides ought to all work exactly as on
an ELF system.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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