This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Fwd: Re: [Fwd: Linker problems]]
- From: "Andrei B" <baie0668 at scs dot ubbcluj dot ro>
- To: binutils at sourceware dot org
- Date: Sat, 17 Apr 2010 17:10:33 +0300
- Subject: [Fwd: Re: [Fwd: Linker problems]]
---------------------------- Original Message ----------------------------
Subject: Re: [Fwd: Linker problems]
From: "Andrei B" <baie0668@localhost>
Date: Sat, April 17, 2010 5:07 pm
To: "Ian Lance Taylor" <iant@google.com>
--------------------------------------------------------------------------
>
> I'm not sure what you mean by "a flat binary."
>
> Precisely how is ld being invoked?
>
Hello. This is how:
---
ld -T link.ld -o kernel.bin start.o main.o scrn.o gdt.o idt.o isrs.o irq.o
timer.o kb.o
---
start.o is assembled by NASM and is a:
start.o: Linux/i386 impure executable (OMAGIC)
All other objects compiled with GCC.
Below is the link.ld script:
---
OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
*(.rodata)
. = ALIGN(4096);
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}
---
Also, to any moderators: please organize these messages if you see fit. I
am having a webmail problem which prevents me from replying directly to
the other user. Until I figure out what's wrong I can only forward my
replies.
-AB