kern.ldscript revision 1.1
11.1Smatt/* Default linker script, for normal executables */ 21.1SmattOUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", 31.1Smatt "elf64-littleaarch64") 41.1SmattOUTPUT_ARCH(aarch64) 51.1SmattENTRY(_start) 61.1SmattSECTIONS 71.1Smatt{ 81.1Smatt /* Read-only sections, merged into text segment: */ 91.1Smatt PROVIDE (__kernel_text = .; 101.1Smatt .text : 111.1Smatt { 121.1Smatt PROVIDE_HIDDEN (__eprol = .); 131.1Smatt *(.text) 141.1Smatt *(.text.unlikely .text.*_unlikely) 151.1Smatt *(.text.exit .text.exit.*) 161.1Smatt *(.text.startup .text.startup.*) 171.1Smatt *(.text.hot .text.hot.*) 181.1Smatt *(.stub .text.* .gnu.linkonce.t.*) 191.1Smatt /* .gnu.warning sections are handled specially by elf32.em. */ 201.1Smatt . = ALIGN(0x800) 211.1Smatt *(.vectors) 221.1Smatt } =0 231.1Smatt .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 241.1Smatt .rodata1 : { *(.rodata1) } 251.1Smatt .eh_frame_hdr : { *(.eh_frame_hdr) } 261.1Smatt .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 271.1Smatt .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 281.1Smatt .gcc_except_table.*) } 291.1Smatt /* These sections are generated by the Sun/Oracle C++ compiler. */ 301.1Smatt .exception_ranges : ONLY_IF_RO { *(.exception_ranges 311.1Smatt .exception_ranges*) } 321.1Smatt PROVIDE (__etext = .); 331.1Smatt PROVIDE (_etext = .); 341.1Smatt PROVIDE (etext = .); 351.1Smatt /* Adjust the address for the data segment. We want to adjust up to 361.1Smatt the same address within the page on the next page up. */ 371.1Smatt . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 381.1Smatt /* Exception handling */ 391.1Smatt .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 401.1Smatt .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 411.1Smatt .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 421.1Smatt .got : { *(.got) *(.igot) } 431.1Smatt . = DATA_SEGMENT_RELRO_END (24, .); 441.1Smatt .got.plt : { *(.got.plt) *(.igot.plt) } 451.1Smatt .data : 461.1Smatt { 471.1Smatt PROVIDE (__data_start = .); 481.1Smatt *(.data .data.* .gnu.linkonce.d.*) 491.1Smatt SORT(CONSTRUCTORS) 501.1Smatt } 511.1Smatt .data1 : { *(.data1) } 521.1Smatt _edata = .; PROVIDE (edata = .); 531.1Smatt . = .; 541.1Smatt __bss_start = .; 551.1Smatt __bss_start__ = .; 561.1Smatt .bss : 571.1Smatt { 581.1Smatt *(.dynbss) 591.1Smatt *(.bss .bss.* .gnu.linkonce.b.*) 601.1Smatt *(COMMON) 611.1Smatt /* Align here to ensure that the .bss section occupies space up to 621.1Smatt _end. Align after .bss to ensure correct alignment even if the 631.1Smatt .bss section disappears because there are no input sections. 641.1Smatt FIXME: Why do we need it? When there is no .bss section, we don't 651.1Smatt pad the .data section. */ 661.1Smatt . = ALIGN(. != 0 ? 32 / 8 : 1); 671.1Smatt } 681.1Smatt _bss_end__ = . ; __bss_end__ = . ; 691.1Smatt . = ALIGN(32 / 8); 701.1Smatt . = ALIGN(32 / 8); 711.1Smatt __end__ = . ; 721.1Smatt _end = .; PROVIDE (end = .); 731.1Smatt . = DATA_SEGMENT_END (.); 741.1Smatt .comment 0 : { *(.comment) } 751.1Smatt .ident 0 : { *(.ident) } 761.1Smatt /* DWARF debug sections. 771.1Smatt Symbols in the DWARF debugging sections are relative to the beginning 781.1Smatt of the section so we begin them at 0. */ 791.1Smatt /* DWARF 1 */ 801.1Smatt .debug 0 : { *(.debug) } 811.1Smatt .line 0 : { *(.line) } 821.1Smatt /* GNU DWARF 1 extensions */ 831.1Smatt .debug_srcinfo 0 : { *(.debug_srcinfo) } 841.1Smatt .debug_sfnames 0 : { *(.debug_sfnames) } 851.1Smatt /* DWARF 1.1 and DWARF 2 */ 861.1Smatt .debug_aranges 0 : { *(.debug_aranges) } 871.1Smatt .debug_pubnames 0 : { *(.debug_pubnames) } 881.1Smatt /* DWARF 2 */ 891.1Smatt .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 901.1Smatt .debug_abbrev 0 : { *(.debug_abbrev) } 911.1Smatt .debug_line 0 : { *(.debug_line) } 921.1Smatt .debug_frame 0 : { *(.debug_frame) } 931.1Smatt .debug_str 0 : { *(.debug_str) } 941.1Smatt .debug_loc 0 : { *(.debug_loc) } 951.1Smatt .debug_macinfo 0 : { *(.debug_macinfo) } 961.1Smatt /* SGI/MIPS DWARF 2 extensions */ 971.1Smatt .debug_weaknames 0 : { *(.debug_weaknames) } 981.1Smatt .debug_funcnames 0 : { *(.debug_funcnames) } 991.1Smatt .debug_typenames 0 : { *(.debug_typenames) } 1001.1Smatt .debug_varnames 0 : { *(.debug_varnames) } 1011.1Smatt /* DWARF 3 */ 1021.1Smatt .debug_pubtypes 0 : { *(.debug_pubtypes) } 1031.1Smatt .debug_ranges 0 : { *(.debug_ranges) } 1041.1Smatt /* DWARF Extension. */ 1051.1Smatt .debug_macro 0 : { *(.debug_macro) } 1061.1Smatt .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 1071.1Smatt .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 1081.1Smatt /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } 1091.1Smatt} 110