Over sized kernel.bin after linking with -Ttext 0x1000
Posted: Sun Apr 26, 2020 3:40 am
I got an over sized binary file (around 129M) after linking with parameter -Ttext0x1000
ld -melf_i386 -o kernel.bin -Ttext 0x1000 kernel.o --oformat binary
(The kernel.o is only 2K)
But after removing the -Ttext0x1000, by just using:
ld -melf_i386 -o kernel.bin kernel.o --oformat binary
The size of kernel.bin will be only around 8K
Any idea about that? need some configs for linking? thanks a lot.
Environment:
WSL2 / Ubuntu
ld version: GNU ld (GNU Binutils for Ubuntu) 2.33
ld -melf_i386 -o kernel.bin -Ttext 0x1000 kernel.o --oformat binary
(The kernel.o is only 2K)
But after removing the -Ttext0x1000, by just using:
ld -melf_i386 -o kernel.bin kernel.o --oformat binary
The size of kernel.bin will be only around 8K
Any idea about that? need some configs for linking? thanks a lot.
Environment:
WSL2 / Ubuntu
ld version: GNU ld (GNU Binutils for Ubuntu) 2.33