vsyscall.lds.S 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #ifdef CONFIG_CPU_LITTLE_ENDIAN
  8. OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
  9. #else
  10. OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
  11. #endif
  12. OUTPUT_ARCH(sh)
  13. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  14. ENTRY(__kernel_vsyscall);
  15. SECTIONS
  16. {
  17. . = SIZEOF_HEADERS;
  18. .hash : { *(.hash) } :text
  19. .gnu.hash : { *(.gnu.hash) }
  20. .dynsym : { *(.dynsym) }
  21. .dynstr : { *(.dynstr) }
  22. .gnu.version : { *(.gnu.version) }
  23. .gnu.version_d : { *(.gnu.version_d) }
  24. .gnu.version_r : { *(.gnu.version_r) }
  25. /*
  26. * This linker script is used both with -r and with -shared.
  27. * For the layouts to match, we need to skip more than enough
  28. * space for the dynamic symbol table et al. If this amount
  29. * is insufficient, ld -shared will barf. Just increase it here.
  30. */
  31. . = 0x400;
  32. .text : { *(.text) } :text =0x90909090
  33. .note : { *(.note.*) } :text :note
  34. .eh_frame_hdr : { *(.eh_frame_hdr ) } :text :eh_frame_hdr
  35. .eh_frame : {
  36. KEEP (*(.eh_frame))
  37. LONG (0)
  38. } :text
  39. .dynamic : { *(.dynamic) } :text :dynamic
  40. .useless : {
  41. *(.got.plt) *(.got)
  42. *(.data .data.* .gnu.linkonce.d.*)
  43. *(.dynbss)
  44. *(.bss .bss.* .gnu.linkonce.b.*)
  45. } :text
  46. }
  47. /*
  48. * Very old versions of ld do not recognize this name token; use the constant.
  49. */
  50. #define PT_GNU_EH_FRAME 0x6474e550
  51. /*
  52. * We must supply the ELF program headers explicitly to get just one
  53. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  54. */
  55. PHDRS
  56. {
  57. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  58. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  59. note PT_NOTE FLAGS(4); /* PF_R */
  60. eh_frame_hdr PT_GNU_EH_FRAME;
  61. }
  62. /*
  63. * This controls what symbols we export from the DSO.
  64. */
  65. VERSION
  66. {
  67. LINUX_2.6 {
  68. global:
  69. __kernel_vsyscall;
  70. __kernel_sigreturn;
  71. __kernel_rt_sigreturn;
  72. local: *;
  73. };
  74. }