gate.lds.S 2.6 KB

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