Recently i decided to rewite screen handling as object. Unfortunately i can't now link it, linker gives me:
Code: Select all
main.o: In function `main':
main.cpp:(.text+0x7e): undefined reference to `_Unwind_Resume'
main.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
Code: Select all
SOURCES=boot.o main.o common.o screen.o
CPPFLAGS=-nostdlib -nostdinc -fno-builtin -fno-stack-protector
LDFLAGS=-Tlink.ld
ASFLAGS=-felf
all: $(SOURCES) link
clean:
-rm *.o kernel
link:
ld $(LDFLAGS) -o kernel $(SOURCES)
.asm.o:
nasm $(ASFLAGS) $<
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data :
{
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}