vsyscall.lds.S 2.1 KB

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