vdso-layout.lds.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Linker script for vDSO. This is an ELF shared object prelinked to
  4. * its virtual address, and with only one read-only segment.
  5. * This script controls its layout.
  6. */
  7. SECTIONS
  8. {
  9. . = VDSO_PRELINK + SIZEOF_HEADERS;
  10. .hash : { *(.hash) } :text
  11. .gnu.hash : { *(.gnu.hash) }
  12. .dynsym : { *(.dynsym) }
  13. .dynstr : { *(.dynstr) }
  14. .gnu.version : { *(.gnu.version) }
  15. .gnu.version_d : { *(.gnu.version_d) }
  16. .gnu.version_r : { *(.gnu.version_r) }
  17. .note : { *(.note.*) } :text :note
  18. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  19. .eh_frame : { KEEP (*(.eh_frame)) } :text
  20. .dynamic : { *(.dynamic) } :text :dynamic
  21. .rodata : { *(.rodata*) } :text
  22. .data : {
  23. *(.data*)
  24. *(.sdata*)
  25. *(.got.plt) *(.got)
  26. *(.gnu.linkonce.d.*)
  27. *(.bss*)
  28. *(.dynbss*)
  29. *(.gnu.linkonce.b.*)
  30. }
  31. .altinstructions : { *(.altinstructions) }
  32. .altinstr_replacement : { *(.altinstr_replacement) }
  33. /*
  34. * Align the actual code well away from the non-instruction data.
  35. * This is the best thing for the I-cache.
  36. */
  37. . = ALIGN(0x100);
  38. .text : { *(.text*) } :text =0x90909090
  39. }
  40. /*
  41. * Very old versions of ld do not recognize this name token; use the constant.
  42. */
  43. #define PT_GNU_EH_FRAME 0x6474e550
  44. /*
  45. * We must supply the ELF program headers explicitly to get just one
  46. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  47. */
  48. PHDRS
  49. {
  50. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  51. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  52. note PT_NOTE FLAGS(4); /* PF_R */
  53. eh_frame_hdr PT_GNU_EH_FRAME;
  54. }