gate.lds.S 2.6 KB

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