need help linking asm files

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
thoover

need help linking asm files

Post by thoover »

i am using link.ld for the djgpp linker;

Code: Select all

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 = .;
}
it works corectly on all O-files exept those made by nasm so i cant start my kernel and that gets agervating any ideas.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:need help linking asm files

Post by Pype.Clicker »

that could come from a "wrong" output format in nasm command line. make sure the way you call nasm is compatible with the list of accepted object format of LD. [tt]ld --help[/tt] should tell you something like
ld: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big elf64-x86-64 elf64-little elf64-big srec symbolsrec tekhex binary ihex trad-core
so "nasm -faout" might work here, but "nasm -fcoff" would fail miserably. With DJGPP, chances are that "nasm -felf" will fail miserably and "-fcoff" will work better.
thoover

Re:need help linking asm files

Post by thoover »

I found what was wrong i didnt put all the C programs in the batch it works now sorry for interupting anyone oh and only -faut works
Post Reply