vdso-layout.lds.S 1.5 KB

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