flat assembler
Message board for the users of flat assembler.

Index > OS Construction > PE operations on Non-PE File?

Author
Thread Post new topic Reply to topic
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
Hello! I'm diving back into the world of OS dev. And I must say, it's going better than last time now that I've learned a bit more about it. But, I have a problem.

Everything compiles fine. But when It gets to the linker, it gives me this:

PE operations on Non-PE file

Here's my linker script (link.ld):

Code:
OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
  .text phys : AT(phys) {
    code = .;
    *(.text)
    . = ALIGN(4096);
  }
  .data : AT(phys + (data - code))
  {
    data = .;
    *(.data)
    . = ALIGN(4096);
  }
  .bss : AT(phys + (bss - code))
  {
    bss = .;
    *(.bss)
    . = ALIGN(4096);
  }
  end = .;
}    


Any ideas?
Post 11 Dec 2005, 18:55
View user's profile Send private message Reply with quote
Ivan Poddubny



Joined: 21 Sep 2003
Posts: 32
Location: Yaroslavl, Russia
Ivan Poddubny
I have encountered the same problem with MinGW and here is the solution.

Try the delete first string with OUTPUT_FORMAT in link.ld
ld will produce a PE output file.
Then extract a final binary with "objcopy $(OUTFILE) -O binary"
Post 18 Dec 2005, 12:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.