vsyscall.lds.S 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Linker script for vsyscall DSO. The vsyscall page is an ELF shared
  3. * object prelinked to its virtual address, and with only one read-only
  4. * segment (that fits in one page). This script controls its layout.
  5. */
  6. #include <asm/asm-offsets.h>
  7. #ifdef CONFIG_CPU_LITTLE_ENDIAN
  8. OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
  9. #else
  10. OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
  11. #endif
  12. OUTPUT_ARCH(sh)
  13. /* The ELF entry point can be used to set the AT_SYSINFO value. */
  14. ENTRY(__kernel_vsyscall);
  15. SECTIONS
  16. {
  17. . = SIZEOF_HEADERS;
  18. .hash : { *(.hash) } :text
  19. .gnu.hash : { *(.gnu.hash) }
  20. .dynsym : { *(.dynsym) }
  21. .dynstr : { *(.dynstr) }
  22. .gnu.version : { *(.gnu.version) }
  23. .gnu.version_d : { *(.gnu.version_d) }
  24. .gnu.version_r : { *(.gnu.version_r) }
  25. /* This linker script is used both with -r and with -shared.
  26. For the layouts to match, we need to skip more than enough
  27. space for the dynamic symbol table et al. If this amount
  28. is insufficient, ld -shared will barf. Just increase it here. */
  29. . = 0x400;
  30. .text : { *(.text) } :text =0x90909090
  31. .note : { *(.note.*) } :text :note
  32. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  33. .eh_frame : { KEEP (*(.eh_frame)) } :text
  34. .dynamic : { *(.dynamic) } :text :dynamic
  35. .useless : {
  36. *(.got.plt) *(.got)
  37. *(.data .data.* .gnu.linkonce.d.*)
  38. *(.dynbss)
  39. *(.bss .bss.* .gnu.linkonce.b.*)
  40. } :text
  41. }
  42. /*
  43. * We must supply the ELF program headers explicitly to get just one
  44. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  45. */
  46. PHDRS
  47. {
  48. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  49. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  50. note PT_NOTE FLAGS(4); /* PF_R */
  51. eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
  52. }
  53. /*
  54. * This controls what symbols we export from the DSO.
  55. */
  56. VERSION
  57. {
  58. LINUX_2.6 {
  59. global:
  60. __kernel_vsyscall;
  61. __kernel_sigreturn;
  62. __kernel_rt_sigreturn;
  63. local: *;
  64. };
  65. }