gate.lds.S 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 <linux/config.h>
  7. #include <asm/system.h>
  8. SECTIONS
  9. {
  10. . = GATE_ADDR + SIZEOF_HEADERS;
  11. .hash : { *(.hash) } :readable
  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. }
  53. }
  54. /*
  55. * We must supply the ELF program headers explicitly to get just one
  56. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  57. */
  58. PHDRS
  59. {
  60. readable PT_LOAD FILEHDR PHDRS FLAGS(4); /* PF_R */
  61. #ifndef HAVE_BUGGY_SEGREL
  62. epc PT_LOAD FILEHDR PHDRS FLAGS(1); /* PF_X */
  63. #endif
  64. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  65. unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
  66. }
  67. /*
  68. * This controls what symbols we export from the DSO.
  69. */
  70. VERSION
  71. {
  72. LINUX_2.5 {
  73. global:
  74. __kernel_syscall_via_break;
  75. __kernel_syscall_via_epc;
  76. __kernel_sigtramp;
  77. local: *;
  78. };
  79. }
  80. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  81. ENTRY(__kernel_syscall_via_epc)