My source is a very short assembly file, compiled with NASM into "kernel.o".
"objdump -i" lists "elf32-i386" as one of the supported formats.
"objdump -x kernel.o" tells me that kernel.o's format is indeed elf32-i386.
I am invoking "ld -T link.ld".
It outputs
Code: Select all
ld: cannot represent machine `elf32-i386'
Code: Select all
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(elf32-i386)
TARGET(elf32-i386)
INPUT(kernel.o)
OUTPUT(kernel.bin)
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 = .;
}
Thanks in advance for the help! Below is the source for kernel.o in case it's important (I don't think it is).
Code: Select all
[BITS 32]
global start
start:
mov esp,_sys_stack
jmp stublet
ALIGN 4
mboot:
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
stublet:
mov ebx,0xb8002
mov [ebx],byte 0x0f
mov [ebx+1],byte '*'
jmp $
SECTION .bss
resb 8192 ; This reserves 8KBytes of memory here
_sys_stack: