vsyscall.lds.S 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Linker script for vsyscall DSO. The vsyscall page is an ELF shared
  3. * object prelinked to its virtual address, and with only one read-only
  4. * segment (that fits in one page). This script controls its layout.
  5. */
  6. #include <asm/asm-offsets.h>
  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. /* This linker script is used both with -r and with -shared.
  18. For the layouts to match, we need to skip more than enough
  19. space for the dynamic symbol table et al. If this amount
  20. is insufficient, ld -shared will barf. Just increase it here. */
  21. . = VDSO_PRELINK + 0x400;
  22. .text : { *(.text) } :text =0x90909090
  23. .note : { *(.note.*) } :text :note
  24. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  25. .eh_frame : { KEEP (*(.eh_frame)) } :text
  26. .dynamic : { *(.dynamic) } :text :dynamic
  27. .useless : {
  28. *(.got.plt) *(.got)
  29. *(.data .data.* .gnu.linkonce.d.*)
  30. *(.dynbss)
  31. *(.bss .bss.* .gnu.linkonce.b.*)
  32. } :text
  33. }
  34. /*
  35. * We must supply the ELF program headers explicitly to get just one
  36. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  37. */
  38. PHDRS
  39. {
  40. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  41. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  42. note PT_NOTE FLAGS(4); /* PF_R */
  43. eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
  44. }
  45. /*
  46. * This controls what symbols we export from the DSO.
  47. */
  48. VERSION
  49. {
  50. LINUX_2.5 {
  51. global:
  52. __kernel_vsyscall;
  53. __kernel_sigreturn;
  54. __kernel_rt_sigreturn;
  55. local: *;
  56. };
  57. }
  58. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  59. ENTRY(__kernel_vsyscall);