kern.ldscript revision 1.8
11.6Sryo#include "assym.h" 21.6Sryo 31.1Smatt/* Default linker script, for normal executables */ 41.1SmattOUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", 51.1Smatt "elf64-littleaarch64") 61.1SmattOUTPUT_ARCH(aarch64) 71.1SmattENTRY(_start) 81.8Smaxv 91.1SmattSECTIONS 101.1Smatt{ 111.8Smaxv .text : 121.8Smaxv { 131.8Smaxv PROVIDE (__kernel_text = .); 141.8Smaxv PROVIDE_HIDDEN (__eprol = .); 151.8Smaxv *(.text) 161.8Smaxv *(.text.unlikely .text.*_unlikely) 171.8Smaxv *(.text.exit .text.exit.*) 181.8Smaxv *(.text.startup .text.startup.*) 191.8Smaxv *(.text.hot .text.hot.*) 201.8Smaxv *(.stub .text.* .gnu.linkonce.t.*) 211.8Smaxv /* .gnu.warning sections are handled specially by elf32.em. */ 221.8Smaxv } =0 231.8Smaxv 241.8Smaxv /* Move .rodata to the next L2 block to set unexecutable */ 251.8Smaxv . = ALIGN (L2_SIZE); 261.8Smaxv PROVIDE (__rodata_start = .); 271.8Smaxv .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 281.8Smaxv .rodata1 : { *(.rodata1) } 291.8Smaxv .eh_frame_hdr : { *(.eh_frame_hdr) } 301.8Smaxv .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 311.8Smaxv .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 321.8Smaxv .gcc_except_table.*) } 331.8Smaxv 341.8Smaxv /* These sections are generated by the Sun/Oracle C++ compiler. */ 351.8Smaxv .exception_ranges : ONLY_IF_RO { *(.exception_ranges 361.8Smaxv .exception_ranges*) } 371.8Smaxv PROVIDE (__etext = .); 381.8Smaxv PROVIDE (_etext = .); 391.8Smaxv PROVIDE (etext = .); 401.8Smaxv 411.8Smaxv /* 421.8Smaxv * Adjust the address for the data segment. Move .data to the next 431.8Smaxv * L2 block, and .text and .rodata will be set readonly if needed. 441.8Smaxv */ 451.8Smaxv PROVIDE (_erodata = .); 461.8Smaxv . = ALIGN (L2_SIZE); 471.8Smaxv . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 481.8Smaxv /* Exception handling */ 491.8Smaxv .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 501.8Smaxv .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 511.8Smaxv .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 521.8Smaxv .got : { *(.got) *(.igot) } 531.8Smaxv . = DATA_SEGMENT_RELRO_END (24, .); 541.8Smaxv .got.plt : { *(.got.plt) *(.igot.plt) } 551.8Smaxv .data : 561.8Smaxv { 571.8Smaxv PROVIDE (__data_start = .); 581.8Smaxv *(.data .gnu.linkonce.d.*) 591.8Smaxv SORT(CONSTRUCTORS) 601.8Smaxv } 611.8Smaxv .data1 : { *(.data1) } 621.8Smaxv 631.8Smaxv . = ALIGN(64); /* COHERENCY_UNIT */ 641.8Smaxv .data.cacheline_aligned : 651.8Smaxv { 661.8Smaxv *(.data.cacheline_aligned) 671.8Smaxv } 681.8Smaxv . = ALIGN(64); /* COHERENCY_UNIT */ 691.8Smaxv .data.read_mostly : 701.8Smaxv { 711.8Smaxv *(.data.read_mostly) 721.8Smaxv } 731.8Smaxv . = ALIGN(64); /* COHERENCY_UNIT */ 741.8Smaxv 751.8Smaxv _edata = .; PROVIDE (edata = .); 761.8Smaxv . = .; 771.8Smaxv 781.8Smaxv __bss_start = .; 791.8Smaxv __bss_start__ = .; 801.8Smaxv .bss : 811.8Smaxv { 821.8Smaxv *(.dynbss) 831.8Smaxv *(.bss .bss.* .gnu.linkonce.b.*) 841.8Smaxv *(COMMON) 851.8Smaxv 861.8Smaxv /* 871.8Smaxv * Align here to ensure that the .bss section occupies space 881.8Smaxv * up to _end. Align after .bss to ensure correct alignment 891.8Smaxv * even if the .bss section disappears because there are no 901.8Smaxv * input sections. 911.8Smaxv * 921.8Smaxv * FIXME: Why do we need it? When there is no .bss section, 931.8Smaxv * we don't pad the .data section. 941.8Smaxv */ 951.8Smaxv . = ALIGN(. != 0 ? 32 / 8 : 1); 961.8Smaxv } 971.8Smaxv _bss_end__ = . ; __bss_end__ = . ; 981.8Smaxv . = ALIGN(32 / 8); 991.8Smaxv . = ALIGN(32 / 8); 1001.8Smaxv 1011.8Smaxv __end__ = . ; 1021.8Smaxv _end = .; PROVIDE (end = .); 1031.8Smaxv . = DATA_SEGMENT_END (.); 1041.8Smaxv .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 1051.8Smaxv .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 1061.1Smatt} 107