This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: ld: cannot perform PE operations on non PE output file 'bootsect'.
- From: Brian Dessent <brian at dessent dot net>
- To: Salvatore D'Angelo <koala dot gnu at tiscali dot it>
- Cc: cygwin at cygwin dot com
- Date: Mon, 13 Nov 2006 17:35:03 -0800
- Subject: Re: ld: cannot perform PE operations on non PE output file 'bootsect'.
- References: <45590DE6.4040106@tiscali.it>
- Reply-to: cygwin at cygwin dot com
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/