18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2015 Imagination Technologies 48c2ecf20Sopenharmony_ci * Author: Alex Smith <alex.smith@imgtec.com> 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <asm/sgidefs.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#if _MIPS_SIM == _MIPS_SIM_ABI64 108c2ecf20Sopenharmony_ciOUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips", "elf64-tradlittlemips") 118c2ecf20Sopenharmony_ci#elif _MIPS_SIM == _MIPS_SIM_NABI32 128c2ecf20Sopenharmony_ciOUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips", "elf32-ntradlittlemips") 138c2ecf20Sopenharmony_ci#else 148c2ecf20Sopenharmony_ciOUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips") 158c2ecf20Sopenharmony_ci#endif 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciOUTPUT_ARCH(mips) 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciSECTIONS 208c2ecf20Sopenharmony_ci{ 218c2ecf20Sopenharmony_ci PROVIDE(_start = .); 228c2ecf20Sopenharmony_ci . = SIZEOF_HEADERS; 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci /* 258c2ecf20Sopenharmony_ci * In order to retain compatibility with older toolchains we provide the 268c2ecf20Sopenharmony_ci * ABI flags section ourself. Newer assemblers will automatically 278c2ecf20Sopenharmony_ci * generate .MIPS.abiflags sections so we discard such input sections, 288c2ecf20Sopenharmony_ci * and then manually define our own section here. genvdso will patch 298c2ecf20Sopenharmony_ci * this section to have the correct name/type. 308c2ecf20Sopenharmony_ci */ 318c2ecf20Sopenharmony_ci .mips_abiflags : { *(.mips_abiflags) } :text :abiflags 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci .reginfo : { *(.reginfo) } :text :reginfo 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci .hash : { *(.hash) } :text 368c2ecf20Sopenharmony_ci .gnu.hash : { *(.gnu.hash) } 378c2ecf20Sopenharmony_ci .dynsym : { *(.dynsym) } 388c2ecf20Sopenharmony_ci .dynstr : { *(.dynstr) } 398c2ecf20Sopenharmony_ci .gnu.version : { *(.gnu.version) } 408c2ecf20Sopenharmony_ci .gnu.version_d : { *(.gnu.version_d) } 418c2ecf20Sopenharmony_ci .gnu.version_r : { *(.gnu.version_r) } 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci .note : { *(.note.*) } :text :note 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci .text : { *(.text*) } :text 468c2ecf20Sopenharmony_ci PROVIDE (__etext = .); 478c2ecf20Sopenharmony_ci PROVIDE (_etext = .); 488c2ecf20Sopenharmony_ci PROVIDE (etext = .); 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr 518c2ecf20Sopenharmony_ci .eh_frame : { KEEP (*(.eh_frame)) } :text 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci .dynamic : { *(.dynamic) } :text :dynamic 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci .rodata : { *(.rodata*) } :text 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci _end = .; 588c2ecf20Sopenharmony_ci PROVIDE(end = .); 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci /DISCARD/ : { 618c2ecf20Sopenharmony_ci *(.MIPS.abiflags) 628c2ecf20Sopenharmony_ci *(.gnu.attributes) 638c2ecf20Sopenharmony_ci *(.note.GNU-stack) 648c2ecf20Sopenharmony_ci *(.data .data.* .gnu.linkonce.d.* .sdata*) 658c2ecf20Sopenharmony_ci *(.bss .sbss .dynbss .dynsbss) 668c2ecf20Sopenharmony_ci } 678c2ecf20Sopenharmony_ci} 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciPHDRS 708c2ecf20Sopenharmony_ci{ 718c2ecf20Sopenharmony_ci /* 728c2ecf20Sopenharmony_ci * Provide a PT_MIPS_ABIFLAGS header to assign the ABI flags section 738c2ecf20Sopenharmony_ci * to. We can specify the header type directly here so no modification 748c2ecf20Sopenharmony_ci * is needed later on. 758c2ecf20Sopenharmony_ci */ 768c2ecf20Sopenharmony_ci abiflags 0x70000003; 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci /* 798c2ecf20Sopenharmony_ci * The ABI flags header must exist directly after the PT_INTERP header, 808c2ecf20Sopenharmony_ci * so we must explicitly place the PT_MIPS_REGINFO header after it to 818c2ecf20Sopenharmony_ci * stop the linker putting one in at the start. 828c2ecf20Sopenharmony_ci */ 838c2ecf20Sopenharmony_ci reginfo 0x70000000; 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ 868c2ecf20Sopenharmony_ci dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 878c2ecf20Sopenharmony_ci note PT_NOTE FLAGS(4); /* PF_R */ 888c2ecf20Sopenharmony_ci eh_frame_hdr PT_GNU_EH_FRAME; 898c2ecf20Sopenharmony_ci} 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ciVERSION 928c2ecf20Sopenharmony_ci{ 938c2ecf20Sopenharmony_ci LINUX_2.6 { 948c2ecf20Sopenharmony_ci#ifndef CONFIG_MIPS_DISABLE_VDSO 958c2ecf20Sopenharmony_ci global: 968c2ecf20Sopenharmony_ci __vdso_clock_gettime; 978c2ecf20Sopenharmony_ci __vdso_gettimeofday; 988c2ecf20Sopenharmony_ci __vdso_clock_getres; 998c2ecf20Sopenharmony_ci#if _MIPS_SIM != _MIPS_SIM_ABI64 1008c2ecf20Sopenharmony_ci __vdso_clock_gettime64; 1018c2ecf20Sopenharmony_ci#endif 1028c2ecf20Sopenharmony_ci#endif 1038c2ecf20Sopenharmony_ci local: *; 1048c2ecf20Sopenharmony_ci }; 1058c2ecf20Sopenharmony_ci} 106