Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <asm/vmlinux.lds.h>
0003 #include <asm/page.h>
0004 
0005 OUTPUT_FORMAT(ELF_FORMAT)
0006 OUTPUT_ARCH(ELF_ARCH)
0007 ENTRY(_start)
0008 jiffies = jiffies_64;
0009 
0010 VERSION {
0011   {
0012     local: *;
0013   };
0014 }
0015 
0016 SECTIONS
0017 {
0018   /* This must contain the right address - not quite the default ELF one.*/
0019   PROVIDE (__executable_start = START);
0020   /* Static binaries stick stuff here, like the sigreturn trampoline,
0021    * invisibly to objdump.  So, just make __binary_start equal to the very
0022    * beginning of the executable, and if there are unmapped pages after this,
0023    * they are forever unusable.
0024    */
0025   __binary_start = START;
0026 
0027   . = START + SIZEOF_HEADERS;
0028   . = ALIGN(PAGE_SIZE);
0029 
0030   _text = .;
0031   INIT_TEXT_SECTION(0)
0032 
0033   .text      :
0034   {
0035     _stext = .;
0036     TEXT_TEXT
0037     SCHED_TEXT
0038     CPUIDLE_TEXT
0039     LOCK_TEXT
0040     IRQENTRY_TEXT
0041     SOFTIRQENTRY_TEXT
0042     *(.fixup)
0043     /* .gnu.warning sections are handled specially by elf32.em.  */
0044     *(.gnu.warning)
0045     *(.gnu.linkonce.t*)
0046   }
0047 
0048   . = ALIGN(PAGE_SIZE);
0049   .syscall_stub : {
0050     __syscall_stub_start = .;
0051     *(.__syscall_stub*)
0052     __syscall_stub_end = .;
0053   }
0054 
0055   /*
0056    * These are needed even in a static link, even if they wind up being empty.
0057    * Newer glibc needs these __rel{,a}_iplt_{start,end} symbols.
0058    */
0059   .rel.plt : {
0060     *(.rel.plt)
0061     PROVIDE_HIDDEN(__rel_iplt_start = .);
0062     *(.rel.iplt)
0063     PROVIDE_HIDDEN(__rel_iplt_end = .);
0064   }
0065   .rela.plt : {
0066     *(.rela.plt)
0067     PROVIDE_HIDDEN(__rela_iplt_start = .);
0068     *(.rela.iplt)
0069     PROVIDE_HIDDEN(__rela_iplt_end = .);
0070   }
0071 
0072   #include <asm/common.lds.S>
0073 
0074   __init_begin = .;
0075   init.data : { INIT_DATA }
0076   __init_end = .;
0077 
0078   .data    :
0079   {
0080     INIT_TASK_DATA(KERNEL_STACK_SIZE)
0081     . = ALIGN(KERNEL_STACK_SIZE);
0082     *(.data..init_irqstack)
0083     DATA_DATA
0084     *(.gnu.linkonce.d*)
0085     CONSTRUCTORS
0086   }
0087   .data1   : { *(.data1) }
0088   .ctors         :
0089   {
0090     *(.ctors)
0091   }
0092   .dtors         :
0093   {
0094     *(.dtors)
0095   }
0096 
0097   .got           : { *(.got.plt) *(.got) }
0098   .eh_frame       : { KEEP (*(.eh_frame)) }
0099   .dynamic       : { *(.dynamic) }
0100   .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
0101   .tbss       : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
0102   /* We want the small data sections together, so single-instruction offsets
0103      can access them all, and initialized data all before uninitialized, so
0104      we can shorten the on-disk segment size.  */
0105   .sdata     : { *(.sdata) }
0106   _edata  =  .;
0107   PROVIDE (edata = .);
0108   . = ALIGN(PAGE_SIZE);
0109   __bss_start = .;
0110   PROVIDE(_bss_start = .);
0111   SBSS(0)
0112   BSS(0)
0113    __bss_stop = .;
0114   _end = .;
0115   PROVIDE (end = .);
0116 
0117   STABS_DEBUG
0118   DWARF_DEBUG
0119   ELF_DETAILS
0120 
0121   DISCARDS
0122 }