kern.ldscript revision 1.6
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.1SmattSECTIONS 91.1Smatt{ 101.1Smatt /* Read-only sections, merged into text segment: */ 111.1Smatt .text : 121.1Smatt { 131.5Sryo PROVIDE (__kernel_text = .); 141.1Smatt PROVIDE_HIDDEN (__eprol = .); 151.1Smatt *(.text) 161.1Smatt *(.text.unlikely .text.*_unlikely) 171.1Smatt *(.text.exit .text.exit.*) 181.1Smatt *(.text.startup .text.startup.*) 191.1Smatt *(.text.hot .text.hot.*) 201.1Smatt *(.stub .text.* .gnu.linkonce.t.*) 211.1Smatt /* .gnu.warning sections are handled specially by elf32.em. */ 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.6Sryo /* Adjust the address for the data segment. Move .data to the next L2 block, 361.6Sryo and .text and .rodata will be set readonly if needed. */ 371.6Sryo PROVIDE (_erodata = .); 381.6Sryo . = ALIGN (L2_SIZE); 391.6Sryo . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 401.1Smatt /* Exception handling */ 411.1Smatt .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 421.1Smatt .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 431.1Smatt .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 441.1Smatt .got : { *(.got) *(.igot) } 451.1Smatt . = DATA_SEGMENT_RELRO_END (24, .); 461.1Smatt .got.plt : { *(.got.plt) *(.igot.plt) } 471.1Smatt .data : 481.1Smatt { 491.1Smatt PROVIDE (__data_start = .); 501.5Sryo *(.data .gnu.linkonce.d.*) 511.1Smatt SORT(CONSTRUCTORS) 521.1Smatt } 531.1Smatt .data1 : { *(.data1) } 541.5Sryo 551.5Sryo . = ALIGN(64); /* COHERENCY_UNIT */ 561.5Sryo .data.cacheline_aligned : 571.5Sryo { 581.5Sryo *(.data.cacheline_aligned) 591.5Sryo } 601.5Sryo . = ALIGN(64); /* COHERENCY_UNIT */ 611.5Sryo .data.read_mostly : 621.5Sryo { 631.5Sryo *(.data.read_mostly) 641.5Sryo } 651.5Sryo . = ALIGN(64); /* COHERENCY_UNIT */ 661.5Sryo 671.1Smatt _edata = .; PROVIDE (edata = .); 681.1Smatt . = .; 691.1Smatt __bss_start = .; 701.1Smatt __bss_start__ = .; 711.1Smatt .bss : 721.1Smatt { 731.2Suebayasi *(.dynbss) 741.2Suebayasi *(.bss .bss.* .gnu.linkonce.b.*) 751.2Suebayasi *(COMMON) 761.2Suebayasi /* Align here to ensure that the .bss section occupies space up to 771.2Suebayasi _end. Align after .bss to ensure correct alignment even if the 781.2Suebayasi .bss section disappears because there are no input sections. 791.2Suebayasi FIXME: Why do we need it? When there is no .bss section, we don't 801.2Suebayasi pad the .data section. */ 811.2Suebayasi . = ALIGN(. != 0 ? 32 / 8 : 1); 821.1Smatt } 831.1Smatt _bss_end__ = . ; __bss_end__ = . ; 841.1Smatt . = ALIGN(32 / 8); 851.1Smatt . = ALIGN(32 / 8); 861.1Smatt __end__ = . ; 871.1Smatt _end = .; PROVIDE (end = .); 881.1Smatt . = DATA_SEGMENT_END (.); 891.1Smatt .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 901.1Smatt .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 911.1Smatt} 92