gate.lds.S 2.6 KB

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