$ cat kernel.lds
SECTIONS {
.text 0x7e00:
{
*(.text)
}
/DISCARD/ :
{
*(*)
}
}
$ ld -e kmain -T kernel.lds test.o --oformat=binary -o kernel-lds.bin
$ hexdump -Cv kernel-lds.bin
00000000 55 48 89 e5 b8 01 00 00 00 5d c3 |UH.......].|
0000000b