18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Linker script for vDSO. This is an ELF shared object prelinked to 48c2ecf20Sopenharmony_ci * its virtual address, and with only one read-only segment. 58c2ecf20Sopenharmony_ci * This script controls its layout. 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciSECTIONS 98c2ecf20Sopenharmony_ci{ 108c2ecf20Sopenharmony_ci . = VDSO_PRELINK + SIZEOF_HEADERS; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci .hash : { *(.hash) } :text 138c2ecf20Sopenharmony_ci .gnu.hash : { *(.gnu.hash) } 148c2ecf20Sopenharmony_ci .dynsym : { *(.dynsym) } 158c2ecf20Sopenharmony_ci .dynstr : { *(.dynstr) } 168c2ecf20Sopenharmony_ci .gnu.version : { *(.gnu.version) } 178c2ecf20Sopenharmony_ci .gnu.version_d : { *(.gnu.version_d) } 188c2ecf20Sopenharmony_ci .gnu.version_r : { *(.gnu.version_r) } 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci .note : { *(.note.*) } :text :note 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr 238c2ecf20Sopenharmony_ci .eh_frame : { KEEP (*(.eh_frame)) } :text 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci .dynamic : { *(.dynamic) } :text :dynamic 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci .rodata : { *(.rodata*) } :text 288c2ecf20Sopenharmony_ci .data : { 298c2ecf20Sopenharmony_ci *(.data*) 308c2ecf20Sopenharmony_ci *(.sdata*) 318c2ecf20Sopenharmony_ci *(.got.plt) *(.got) 328c2ecf20Sopenharmony_ci *(.gnu.linkonce.d.*) 338c2ecf20Sopenharmony_ci *(.bss*) 348c2ecf20Sopenharmony_ci *(.dynbss*) 358c2ecf20Sopenharmony_ci *(.gnu.linkonce.b.*) 368c2ecf20Sopenharmony_ci } 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci .altinstructions : { *(.altinstructions) } 398c2ecf20Sopenharmony_ci .altinstr_replacement : { *(.altinstr_replacement) } 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci /* 428c2ecf20Sopenharmony_ci * Align the actual code well away from the non-instruction data. 438c2ecf20Sopenharmony_ci * This is the best thing for the I-cache. 448c2ecf20Sopenharmony_ci */ 458c2ecf20Sopenharmony_ci . = ALIGN(0x100); 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci .text : { *(.text*) } :text =0x90909090 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci/* 518c2ecf20Sopenharmony_ci * Very old versions of ld do not recognize this name token; use the constant. 528c2ecf20Sopenharmony_ci */ 538c2ecf20Sopenharmony_ci#define PT_GNU_EH_FRAME 0x6474e550 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci/* 568c2ecf20Sopenharmony_ci * We must supply the ELF program headers explicitly to get just one 578c2ecf20Sopenharmony_ci * PT_LOAD segment, and set the flags explicitly to make segments read-only. 588c2ecf20Sopenharmony_ci */ 598c2ecf20Sopenharmony_ciPHDRS 608c2ecf20Sopenharmony_ci{ 618c2ecf20Sopenharmony_ci text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ 628c2ecf20Sopenharmony_ci dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 638c2ecf20Sopenharmony_ci note PT_NOTE FLAGS(4); /* PF_R */ 648c2ecf20Sopenharmony_ci eh_frame_hdr PT_GNU_EH_FRAME; 658c2ecf20Sopenharmony_ci} 66