^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2015 Imagination Technologies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Author: Alex Smith <alex.smith@imgtec.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <asm/sgidefs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #if _MIPS_SIM == _MIPS_SIM_ABI64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips", "elf64-tradlittlemips")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #elif _MIPS_SIM == _MIPS_SIM_NABI32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips", "elf32-ntradlittlemips")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) OUTPUT_ARCH(mips)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) SECTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) PROVIDE(_start = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) . = SIZEOF_HEADERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * In order to retain compatibility with older toolchains we provide the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * ABI flags section ourself. Newer assemblers will automatically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * generate .MIPS.abiflags sections so we discard such input sections,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * and then manually define our own section here. genvdso will patch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * this section to have the correct name/type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) .mips_abiflags : { *(.mips_abiflags) } :text :abiflags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) .reginfo : { *(.reginfo) } :text :reginfo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) .hash : { *(.hash) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) .gnu.hash : { *(.gnu.hash) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) .dynsym : { *(.dynsym) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) .dynstr : { *(.dynstr) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) .gnu.version : { *(.gnu.version) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) .gnu.version_d : { *(.gnu.version_d) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) .gnu.version_r : { *(.gnu.version_r) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) .note : { *(.note.*) } :text :note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) .text : { *(.text*) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) PROVIDE (__etext = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) PROVIDE (_etext = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) PROVIDE (etext = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) .eh_frame : { KEEP (*(.eh_frame)) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) .dynamic : { *(.dynamic) } :text :dynamic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) .rodata : { *(.rodata*) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) _end = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) PROVIDE(end = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) /DISCARD/ : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) *(.MIPS.abiflags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) *(.gnu.attributes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) *(.note.GNU-stack)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) *(.data .data.* .gnu.linkonce.d.* .sdata*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) *(.bss .sbss .dynbss .dynsbss)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) PHDRS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * Provide a PT_MIPS_ABIFLAGS header to assign the ABI flags section
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * to. We can specify the header type directly here so no modification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * is needed later on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) abiflags 0x70000003;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * The ABI flags header must exist directly after the PT_INTERP header,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) * so we must explicitly place the PT_MIPS_REGINFO header after it to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) * stop the linker putting one in at the start.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) reginfo 0x70000000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) note PT_NOTE FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) eh_frame_hdr PT_GNU_EH_FRAME;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) VERSION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) LINUX_2.6 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) #ifndef CONFIG_MIPS_DISABLE_VDSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) global:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) __vdso_clock_gettime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __vdso_gettimeofday;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __vdso_clock_getres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #if _MIPS_SIM != _MIPS_SIM_ABI64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) __vdso_clock_gettime64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) local: *;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) }