vsyscall.lds.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 : { KEEP (*(.eh_frame)) } :text
  36. .dynamic : { *(.dynamic) } :text :dynamic
  37. .useless : {
  38. *(.got.plt) *(.got)
  39. *(.data .data.* .gnu.linkonce.d.*)
  40. *(.dynbss)
  41. *(.bss .bss.* .gnu.linkonce.b.*)
  42. } :text
  43. }
  44. /*
  45. * Very old versions of ld do not recognize this name token; use the constant.
  46. */
  47. #define PT_GNU_EH_FRAME 0x6474e550
  48. /*
  49. * We must supply the ELF program headers explicitly to get just one
  50. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  51. */
  52. PHDRS
  53. {
  54. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  55. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  56. note PT_NOTE FLAGS(4); /* PF_R */
  57. eh_frame_hdr PT_GNU_EH_FRAME;
  58. }
  59. /*
  60. * This controls what symbols we export from the DSO.
  61. */
  62. VERSION
  63. {
  64. LINUX_2.6 {
  65. global:
  66. __kernel_vsyscall;
  67. __kernel_sigreturn;
  68. __kernel_rt_sigreturn;
  69. local: *;
  70. };
  71. }