>>107575489
I'm going to be completely honest homie, I still have no idea how linker script works - seems quite weird. I cheated and inlined the syscalls directly into the main function and eschewed the _start completely by making main the entry point. Got down to 504 bytes using your linker script:
#define SYS_write 1
#define SYS_exit 60
const char message[] = "Hello, world!\n";
void main(void)
{
asm("xor rbp, rbp");
asm("syscall"
:
: "r"(SYS_write), "r"(1), "r"(message), "r"(sizeof(message) - 1));
asm("syscall" : : "r"(SYS_exit), "r"(0));
}
Comment too long. Click here to view the full text.