vsyscall.lds 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Linker script for vsyscall DSO. The vsyscall page is an ELF shared
  3. * object prelinked to its virtual address. This script controls its layout.
  4. */
  5. /* This must match <asm/fixmap.h>. */
  6. VSYSCALL_BASE = 0xffffe000;
  7. SECTIONS
  8. {
  9. . = VSYSCALL_BASE + 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. . = VSYSCALL_BASE + 0x400;
  22. .text.vsyscall : { *(.text.vsyscall) } :text =0x90909090
  23. /* This is an 32bit object and we cannot easily get the offsets
  24. into the 64bit kernel. Just hardcode them here. This assumes
  25. that all the stubs don't need more than 0x100 bytes. */
  26. . = VSYSCALL_BASE + 0x500;
  27. .text.sigreturn : { *(.text.sigreturn) } :text =0x90909090
  28. . = VSYSCALL_BASE + 0x600;
  29. .text.rtsigreturn : { *(.text.rtsigreturn) } :text =0x90909090
  30. .note : { *(.note.*) } :text :note
  31. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  32. .eh_frame : { KEEP (*(.eh_frame)) } :text
  33. .dynamic : { *(.dynamic) } :text :dynamic
  34. .useless : {
  35. *(.got.plt) *(.got)
  36. *(.data .data.* .gnu.linkonce.d.*)
  37. *(.dynbss)
  38. *(.bss .bss.* .gnu.linkonce.b.*)
  39. } :text
  40. }
  41. /*
  42. * We must supply the ELF program headers explicitly to get just one
  43. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  44. */
  45. PHDRS
  46. {
  47. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  48. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  49. note PT_NOTE FLAGS(4); /* PF_R */
  50. eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
  51. }
  52. /*
  53. * This controls what symbols we export from the DSO.
  54. */
  55. VERSION
  56. {
  57. LINUX_2.5 {
  58. global:
  59. __kernel_vsyscall;
  60. __kernel_sigreturn;
  61. __kernel_rt_sigreturn;
  62. local: *;
  63. };
  64. }
  65. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  66. ENTRY(__kernel_vsyscall);