i have yet again a problem linking somthing. suppose i have the following object file:
Code: Select all
main.o: file format elf32-i386
Disassembly of section .data:
00000000 <.data>:
0: ff (bad)
1: ff (bad)
2: ff (bad)
3: ff .byte 0xff
Disassembly of section .text:
00000000 <.text>:
0: 06 push %es
1: 00 00 add %al,(%eax)
3: 00 06 add %al,(%esi)
5: 00 00 add %al,(%eax)
7: 00 48 65 add %cl,0x65(%eax)
a: 6c insb (%dx),%es:(%edi)
b: 6c insb (%dx),%es:(%edi)
c: 6f outsl %ds:(%esi),(%dx)
d: 2e 00 00 add %al,%cs:(%eax)
Disassembly of section .text:
00000000 <start>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 68 08 00 00 00 push $0x8
8: e8 fc ff ff ff call 9 <start+0x9>
d: 89 ec mov %ebp,%esp
f: 5d pop %ebp
10: c3 ret
Code: Select all
ld main.o video.o utilities.o -e start -N -o boot.bin --oformat binary -T script
Code: Select all
SECTIONS
{
. = 0x0;
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss) }
}
Code: Select all
00000000 06 push es
00000001 0000 add [eax],al
00000003 0006 add [esi],al
00000005 0000 add [eax],al
00000007 004865 add [eax+0x65],cl
0000000A 6C insb
0000000B 6C insb
0000000C 6F outsd
0000000D 2E0000 add [cs:eax],al
00000010 55 push ebp
00000011 89E5 mov ebp,esp
...and so on
Thanks
Martin