Linker Script Does Not Skip Bytes As Expected
问题 So, I have this assembly file, which I assemble with GNU as and link with GNU ld using a linker script. Linker script ( boot.ld ): INPUT(boot.o) OUTPUT(boot.out) ENTRY(boot_start) SECTIONS { . = 0x7c00; .text : { *(.text) } .data : { *(.data) } . = 0x7dfe; .boot_end : { *(.boot_end) } } As you see I try to make the file exactly 512 bytes as needed for a bootloader by doing . = 0x7cdfe . .boot_end contains the boot signature and thus fills up the remaining two bytes. I create the bootloader as