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 <asm/system.h>
  7. SECTIONS
  8. {
  9. . = GATE_ADDR + SIZEOF_HEADERS;
  10. .hash : { *(.hash) } :readable
  11. .dynsym : { *(.dynsym) }
  12. .dynstr : { *(.dynstr) }
  13. .gnu.version : { *(.gnu.version) }
  14. .gnu.version_d : { *(.gnu.version_d) }
  15. .gnu.version_r : { *(.gnu.version_r) }
  16. .dynamic : { *(.dynamic) } :readable :dynamic
  17. /*
  18. * This linker script is used both with -r and with -shared. For the layouts to match,
  19. * we need to skip more than enough space for the dynamic symbol table et al. If this
  20. * amount is insufficient, ld -shared will barf. Just increase it here.
  21. */
  22. . = GATE_ADDR + 0x500;
  23. .data.patch : {
  24. __start_gate_mckinley_e9_patchlist = .;
  25. *(.data.patch.mckinley_e9)
  26. __end_gate_mckinley_e9_patchlist = .;
  27. __start_gate_vtop_patchlist = .;
  28. *(.data.patch.vtop)
  29. __end_gate_vtop_patchlist = .;
  30. __start_gate_fsyscall_patchlist = .;
  31. *(.data.patch.fsyscall_table)
  32. __end_gate_fsyscall_patchlist = .;
  33. __start_gate_brl_fsys_bubble_down_patchlist = .;
  34. *(.data.patch.brl_fsys_bubble_down)
  35. __end_gate_brl_fsys_bubble_down_patchlist = .;
  36. } :readable
  37. .IA_64.unwind_info : { *(.IA_64.unwind_info*) }
  38. .IA_64.unwind : { *(.IA_64.unwind*) } :readable :unwind
  39. #ifdef HAVE_BUGGY_SEGREL
  40. .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) } :readable
  41. #else
  42. . = ALIGN (PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1));
  43. .text : { *(.text) *(.text.*) } :epc
  44. #endif
  45. /DISCARD/ : {
  46. *(.got.plt) *(.got)
  47. *(.data .data.* .gnu.linkonce.d.*)
  48. *(.dynbss)
  49. *(.bss .bss.* .gnu.linkonce.b.*)
  50. *(__ex_table)
  51. *(__mca_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)