{simple,shoddy,smart} minsize-oriented linker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
1.6 KiB

/*OUTPUT_FORMAT(binary)*/
ENTRY(_smol_start)
PHDRS {
dyn PT_DYNAMIC FLAGS(0); /* --- */
interp PT_INTERP FLAGS(0); /* --- */
rodttxt PT_LOAD FLAGS(5); /* r-x */
rwdt PT_LOAD FLAGS(6); /* rw- */
}
SECTIONS {
. = 0x10000;
_smol_origin = .;
.header : { KEEP(*(.header)) } :rodttxt
.dynamic : { *(.dynamic .rodata.dynamic) } :dyn :rodttxt
.interp : { *(.interp .rodata.interp) } :interp /*:rodttxt*/
_smol_text_start = .;
_smol_text_off = _smol_text_start - _smol_origin;
.text : {
KEEP(*(.rodata.dynamic))
KEEP(*(.rodata.interp .rodata.neededlibs))
*(.rdata .rdata.* .rodata .rodata.*)
KEEP(*(.text.startup.smol))
KEEP(*(.text.startup._start))
*(.text .text.*)
} :rodttxt
_smol_text_end = .;
_smol_text_size = _smol_text_end - _smol_text_start;
_smol_textandheader_size = _smol_text_end - _smol_origin;
_smol_data_start = .;
_smol_data_off = _smol_data_start - _smol_origin;
.data : {
KEEP(*(.data.smolgot))
*(.data .data.* .tdata .tdata.*)
} :rwdt
.dynstuff : { *(.symtab .strtab .shstrtab .rel.text .got.plt .gnu.linkonce.* .plt .plt.got) } /*:dyn*/ :rodttxt
_smol_data_end = .;
_smol_data_size = _smol_data_end - _smol_data_start;
_smol_total_filesize = . - _smol_origin;
_smol_bss_start = .;
_smol_bss_off = _smol_bss_start - _smol_origin;
.bss : {
*(.bss .bss.* .tbss .tbss.* .sbss .sbss.*)
} :rwdt
_smol_bss_end = .;
_smol_bss_size = _smol_bss_end - _smol_bss_start;
_smol_dataandbss_size = _smol_bss_end - _smol_data_start;
/DISCARD/ : {
*(.*)
}
_smol_total_memsize = . - _smol_origin;
}