All in the name of size!

This commit is contained in:
numzero 2024-08-12 00:16:09 +03:00
parent 8be7bb8718
commit ae54bb7b92
2 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,5 @@
server: main.o func.o server: link.ld main.o func.o
gcc main.o func.o -o server -nostdlib -static gcc -T link.ld main.o func.o -o server -nostdlib -static
main.o: main.S main.o: main.S
gcc -c main.S gcc -c main.S

15
link.ld Normal file
View File

@ -0,0 +1,15 @@
ENTRY(_start)
SECTIONS {
. = 4M;
. = . + SIZEOF_HEADERS;
.text : { *(.text) } :text
.rodata : { *(.rodata) }
. = ALIGN(4K);
.bss : { *(COMMON) *(.bss) } :bss
}
PHDRS {
text PT_LOAD FILEHDR PHDRS FLAGS(5);
bss PT_LOAD;
}