Autor Thema: Linker Problem  (Gelesen 2128 mal)

fkrauthan

  • Beiträge: 19
    • Profil anzeigen
    • http://www.fkrauthan.de
Gespeichert
« am: 30. January 2007, 19:26 »
So ich habe folgendes Problem:
BFD: Binary/stYJ2QrA: warning: allocated section `.text' not in segment

Ich benutze den compiler und linker von cygwin.

Hier der Linker Script:
ENTRY(_start)
SECTIONS
{
. = 0x00100000;
__kernel_start = .;

.text :
{
code = .;
*(.text)
. = ALIGN(4096);
}

.rodata :
{
rodata = .;
*(.rodata)
. = ALIGN(4096);
}

.data :
{
data = .;
*(.data)
. = ALIGN(4096);
}

.bss :
{
bss = .;
*(COMMON)
*(.bss)
. = ALIGN(4096);
}
__kernel_end = .;
}

Und hier noch der Script mit dem ich compelire:
nasm -f elf -o Binary\asm\start.o Source\asm\start.asm
gcc -c -fleading-underscore -Wall -ffreestanding -nostdlib -fno-builtin -nostdinc -I .\Source\include -o Binary\main.o .\Source\kernel.c
ld -o Binary\kernel.bin -T link.ld Binary/asm/start.o Binary/main.o

Er kann alles compeliren und auch linken kommt halt oben genannte Warnung nur Grub meckert dann das er das Format nicht kennt.
« Letzte Änderung: 30. January 2007, 19:28 von fkrauthan »

FalShen

  • Beiträge: 73
    • Profil anzeigen
    • ScénOS
Gespeichert
« Antwort #1 am: 30. January 2007, 19:42 »
Probier mal mit OUTPUT_FORMAT(elf32_i386) am anfang der link.ld, das sagt ihm er soll kein windows PE draus machen, sondern ein elf format das GRUB versteht.

fkrauthan

  • Beiträge: 19
    • Profil anzeigen
    • http://www.fkrauthan.de
Gespeichert
« Antwort #2 am: 03. February 2007, 20:02 »
Hat sich erledigt bin mim Compiler umgestiegen :-D

 

Einloggen