Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <asm-generic/vmlinux.lds.h>
0003 
0004 OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT)
0005 
0006 #undef i386
0007 
0008 #include <asm/cache.h>
0009 #include <asm/page_types.h>
0010 
0011 #ifdef CONFIG_X86_64
0012 OUTPUT_ARCH(i386:x86-64)
0013 ENTRY(startup_64)
0014 #else
0015 OUTPUT_ARCH(i386)
0016 ENTRY(startup_32)
0017 #endif
0018 
0019 SECTIONS
0020 {
0021     /* Be careful parts of head_64.S assume startup_32 is at
0022      * address 0.
0023      */
0024     . = 0;
0025     .head.text : {
0026         _head = . ;
0027         HEAD_TEXT
0028         _ehead = . ;
0029     }
0030     .rodata..compressed : {
0031         *(.rodata..compressed)
0032     }
0033     .text : {
0034         _text = .;  /* Text */
0035         *(.text)
0036         *(.text.*)
0037         _etext = . ;
0038     }
0039     .rodata : {
0040         _rodata = . ;
0041         *(.rodata)   /* read-only data */
0042         *(.rodata.*)
0043         _erodata = . ;
0044     }
0045     .data : {
0046         _data = . ;
0047         *(.data)
0048         *(.data.*)
0049         *(.bss.efistub)
0050         _edata = . ;
0051     }
0052     . = ALIGN(L1_CACHE_BYTES);
0053     .bss : {
0054         _bss = . ;
0055         *(.bss)
0056         *(.bss.*)
0057         *(COMMON)
0058         . = ALIGN(8);   /* For convenience during zeroing */
0059         _ebss = .;
0060     }
0061 #ifdef CONFIG_X86_64
0062        . = ALIGN(PAGE_SIZE);
0063        .pgtable : {
0064         _pgtable = . ;
0065         *(.pgtable)
0066         _epgtable = . ;
0067     }
0068 #endif
0069     . = ALIGN(PAGE_SIZE);   /* keep ZO size page aligned */
0070     _end = .;
0071 
0072     STABS_DEBUG
0073     DWARF_DEBUG
0074     ELF_DETAILS
0075 
0076     DISCARDS
0077     /DISCARD/ : {
0078         *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
0079         *(.hash) *(.gnu.hash)
0080         *(.note.*)
0081     }
0082 
0083     .got.plt (INFO) : {
0084         *(.got.plt)
0085     }
0086     ASSERT(SIZEOF(.got.plt) == 0 ||
0087 #ifdef CONFIG_X86_64
0088            SIZEOF(.got.plt) == 0x18,
0089 #else
0090            SIZEOF(.got.plt) == 0xc,
0091 #endif
0092            "Unexpected GOT/PLT entries detected!")
0093 
0094     /*
0095      * Sections that should stay zero sized, which is safer to
0096      * explicitly check instead of blindly discarding.
0097      */
0098     .got : {
0099         *(.got)
0100     }
0101     ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
0102 
0103     .plt : {
0104         *(.plt) *(.plt.*)
0105     }
0106     ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
0107 
0108     .rel.dyn : {
0109         *(.rel.*) *(.rel_*)
0110     }
0111     ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!")
0112 
0113     .rela.dyn : {
0114         *(.rela.*) *(.rela_*)
0115     }
0116     ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
0117 }