gate.lds.S 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Linker script for gate DSO. The gate pages are an ELF shared object
  4. * prelinked to its virtual address, with only one read-only segment and
  5. * one execute-only segment (both fit in one page). This script controls
  6. * its layout.
  7. */
  8. #include <asm/page.h>
  9. SECTIONS
  10. {
  11. . = GATE_ADDR + SIZEOF_HEADERS;
  12. .hash : { *(.hash) } :readable
  13. .gnu.hash : { *(.gnu.hash) }
  14. .dynsym : { *(.dynsym) }
  15. .dynstr : { *(.dynstr) }
  16. .gnu.version : { *(.gnu.version) }
  17. .gnu.version_d : { *(.gnu.version_d) }
  18. .gnu.version_r : { *(.gnu.version_r) }
  19. .note : { *(.note*) } :readable :note
  20. .dynamic : { *(.dynamic) } :readable :dynamic
  21. /*
  22. * This linker script is used both with -r and with -shared. For
  23. * the layouts to match, we need to skip more than enough space for
  24. * the dynamic symbol table et al. If this amount is insufficient,
  25. * ld -shared will barf. Just increase it here.
  26. */
  27. . = GATE_ADDR + 0x600;
  28. .data..patch : {
  29. __start_gate_mckinley_e9_patchlist = .;
  30. *(.data..patch.mckinley_e9)
  31. __end_gate_mckinley_e9_patchlist = .;
  32. __start_gate_vtop_patchlist = .;
  33. *(.data..patch.vtop)
  34. __end_gate_vtop_patchlist = .;
  35. __start_gate_fsyscall_patchlist = .;
  36. *(.data..patch.fsyscall_table)
  37. __end_gate_fsyscall_patchlist = .;
  38. __start_gate_brl_fsys_bubble_down_patchlist = .;
  39. *(.data..patch.brl_fsys_bubble_down)
  40. __end_gate_brl_fsys_bubble_down_patchlist = .;
  41. } :readable
  42. .IA_64.unwind_info : { *(.IA_64.unwind_info*) }
  43. .IA_64.unwind : { *(.IA_64.unwind*) } :readable :unwind
  44. #ifdef HAVE_BUGGY_SEGREL
  45. .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) } :readable
  46. #else
  47. . = ALIGN(PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1));
  48. .text : { *(.text) *(.text.*) } :epc
  49. #endif
  50. /DISCARD/ : {
  51. *(.got.plt) *(.got)
  52. *(.data .data.* .gnu.linkonce.d.*)
  53. *(.dynbss)
  54. *(.bss .bss.* .gnu.linkonce.b.*)
  55. *(__ex_table)
  56. *(__mca_table)
  57. }
  58. }
  59. /*
  60. * ld does not recognize this name token; use the constant.
  61. */
  62. #define PT_IA_64_UNWIND 0x70000001
  63. /*
  64. * We must supply the ELF program headers explicitly to get just one
  65. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  66. */
  67. PHDRS
  68. {
  69. readable PT_LOAD FILEHDR PHDRS FLAGS(4); /* PF_R */
  70. #ifndef HAVE_BUGGY_SEGREL
  71. epc PT_LOAD FILEHDR PHDRS FLAGS(1); /* PF_X */
  72. #endif
  73. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  74. note PT_NOTE FLAGS(4); /* PF_R */
  75. unwind PT_IA_64_UNWIND;
  76. }
  77. /*
  78. * This controls what symbols we export from the DSO.
  79. */
  80. VERSION
  81. {
  82. LINUX_2.5 {
  83. global:
  84. __kernel_syscall_via_break;
  85. __kernel_syscall_via_epc;
  86. __kernel_sigtramp;
  87. local: *;
  88. };
  89. }
  90. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  91. ENTRY(__kernel_syscall_via_epc)