Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2015 Imagination Technologies
0004  * Author: Alex Smith <alex.smith@imgtec.com>
0005  */
0006 
0007 #include <asm/sgidefs.h>
0008 
0009 #if _MIPS_SIM == _MIPS_SIM_ABI64
0010 OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips", "elf64-tradlittlemips")
0011 #elif _MIPS_SIM == _MIPS_SIM_NABI32
0012 OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips", "elf32-ntradlittlemips")
0013 #else
0014 OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips")
0015 #endif
0016 
0017 OUTPUT_ARCH(mips)
0018 
0019 SECTIONS
0020 {
0021     PROVIDE(_start = .);
0022     . = SIZEOF_HEADERS;
0023 
0024     /*
0025      * In order to retain compatibility with older toolchains we provide the
0026      * ABI flags section ourself. Newer assemblers will automatically
0027      * generate .MIPS.abiflags sections so we discard such input sections,
0028      * and then manually define our own section here. genvdso will patch
0029      * this section to have the correct name/type.
0030      */
0031     .mips_abiflags  : { *(.mips_abiflags) }     :text :abiflags
0032 
0033     .reginfo    : { *(.reginfo) }       :text :reginfo
0034 
0035     .hash       : { *(.hash) }          :text
0036     .gnu.hash   : { *(.gnu.hash) }
0037     .dynsym     : { *(.dynsym) }
0038     .dynstr     : { *(.dynstr) }
0039     .gnu.version    : { *(.gnu.version) }
0040     .gnu.version_d  : { *(.gnu.version_d) }
0041     .gnu.version_r  : { *(.gnu.version_r) }
0042 
0043     .note       : { *(.note.*) }        :text :note
0044 
0045     .text       : { *(.text*) }         :text
0046     PROVIDE (__etext = .);
0047     PROVIDE (_etext = .);
0048     PROVIDE (etext = .);
0049 
0050     .eh_frame_hdr   : { *(.eh_frame_hdr) }      :text :eh_frame_hdr
0051     .eh_frame   : { KEEP (*(.eh_frame)) }   :text
0052 
0053     .dynamic    : { *(.dynamic) }       :text :dynamic
0054 
0055     .rodata     : { *(.rodata*) }       :text
0056 
0057     _end = .;
0058     PROVIDE(end = .);
0059 
0060     /DISCARD/   : {
0061         *(.MIPS.abiflags)
0062         *(.gnu.attributes)
0063         *(.note.GNU-stack)
0064         *(.data .data.* .gnu.linkonce.d.* .sdata*)
0065         *(.bss .sbss .dynbss .dynsbss)
0066     }
0067 }
0068 
0069 PHDRS
0070 {
0071     /*
0072      * Provide a PT_MIPS_ABIFLAGS header to assign the ABI flags section
0073      * to. We can specify the header type directly here so no modification
0074      * is needed later on.
0075      */
0076     abiflags    0x70000003;
0077 
0078     /*
0079      * The ABI flags header must exist directly after the PT_INTERP header,
0080      * so we must explicitly place the PT_MIPS_REGINFO header after it to
0081      * stop the linker putting one in at the start.
0082      */
0083     reginfo     0x70000000;
0084 
0085     text        PT_LOAD     FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
0086     dynamic     PT_DYNAMIC  FLAGS(4);       /* PF_R */
0087     note        PT_NOTE     FLAGS(4);       /* PF_R */
0088     eh_frame_hdr    PT_GNU_EH_FRAME;
0089 }
0090 
0091 VERSION
0092 {
0093     LINUX_2.6 {
0094 #ifndef CONFIG_MIPS_DISABLE_VDSO
0095     global:
0096         __vdso_clock_gettime;
0097         __vdso_gettimeofday;
0098         __vdso_clock_getres;
0099 #if _MIPS_SIM != _MIPS_SIM_ABI64
0100         __vdso_clock_gettime64;
0101 #endif
0102 #endif
0103     local: *;
0104     };
0105 }