Problem with the linker.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
maakera
Posts: 14
Joined: Sun Apr 10, 2011 10:23 am
Location: Estonia

Problem with the linker.

Post by maakera »

Hi, i could use you're help.

Is there something wrong with this script?

Code: Select all

OUTPUT_FORMAT("binary")
ENTRY(start)
INPUT(kernel.o ks.o)
SECTIONS
{
  .text  0x100000 : {
    code = .; _code = .; __code = .;
    *(.text)
    . = ALIGN(4096);
  }
  .data  : {
    data = .; _data = .; __data = .;
    *(.data)
    . = ALIGN(4096);
  }
  .bss  :
  {
    bss = .; _bss = .; __bss = .;
    *(.bss)
    . = ALIGN(4096);
  }
  end = .; _end = .; __end = .;
}
Command line:

Code: Select all

ld -T link.ld -o kernel.bin
Error line:

Code: Select all

ks.o: file not recognized: File format not recognized

Hope you can help ;)
The most basic language is the most advanced language.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Problem with the linker.

Post by Chandra »

We can help, if you become more specific about the problem. What flags are you passing to the compiler? What formats are you linking? Are you using a Cross Compiler? You should have posted your complete build script.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
maakera
Posts: 14
Joined: Sun Apr 10, 2011 10:23 am
Location: Estonia

Re: Problem with the linker.

Post by maakera »

Basically, i solved the problem myself ^^
The most basic language is the most advanced language.
Post Reply