vdso.lds.S 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * GNU linker script for the VDSO library.
  4. *
  5. * Copyright (C) 2012 ARM Limited
  6. *
  7. * Author: Will Deacon <[email protected]>
  8. * Heavily based on the vDSO linker scripts for other archs.
  9. */
  10. #include <linux/const.h>
  11. #include <asm/page.h>
  12. #include <asm/vdso.h>
  13. #include <asm-generic/vmlinux.lds.h>
  14. OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
  15. OUTPUT_ARCH(aarch64)
  16. SECTIONS
  17. {
  18. PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
  19. #ifdef CONFIG_TIME_NS
  20. PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
  21. #endif
  22. . = VDSO_LBASE + SIZEOF_HEADERS;
  23. .hash : { *(.hash) } :text
  24. .gnu.hash : { *(.gnu.hash) }
  25. .dynsym : { *(.dynsym) }
  26. .dynstr : { *(.dynstr) }
  27. .gnu.version : { *(.gnu.version) }
  28. .gnu.version_d : { *(.gnu.version_d) }
  29. .gnu.version_r : { *(.gnu.version_r) }
  30. /*
  31. * Discard .note.gnu.property sections which are unused and have
  32. * different alignment requirement from vDSO note sections.
  33. */
  34. /DISCARD/ : {
  35. *(.note.GNU-stack .note.gnu.property)
  36. }
  37. .note : { *(.note.*) } :text :note
  38. . = ALIGN(16);
  39. .text : { *(.text*) } :text =0xd503201f
  40. PROVIDE (__etext = .);
  41. PROVIDE (_etext = .);
  42. PROVIDE (etext = .);
  43. . = ALIGN(4);
  44. .altinstructions : {
  45. __alt_instructions = .;
  46. *(.altinstructions)
  47. __alt_instructions_end = .;
  48. }
  49. .dynamic : { *(.dynamic) } :text :dynamic
  50. .rela.dyn : ALIGN(8) { *(.rela .rela*) }
  51. .rodata : {
  52. *(.rodata*)
  53. *(.got)
  54. *(.got.plt)
  55. *(.plt)
  56. *(.plt.*)
  57. *(.iplt)
  58. *(.igot .igot.plt)
  59. } :text
  60. _end = .;
  61. PROVIDE(end = .);
  62. DWARF_DEBUG
  63. ELF_DETAILS
  64. /DISCARD/ : {
  65. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  66. *(.bss .sbss .dynbss .dynsbss)
  67. *(.eh_frame .eh_frame_hdr)
  68. }
  69. }
  70. /*
  71. * We must supply the ELF program headers explicitly to get just one
  72. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  73. */
  74. PHDRS
  75. {
  76. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  77. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  78. note PT_NOTE FLAGS(4); /* PF_R */
  79. }
  80. /*
  81. * This controls what symbols we export from the DSO.
  82. */
  83. VERSION
  84. {
  85. LINUX_2.6.39 {
  86. global:
  87. __kernel_rt_sigreturn;
  88. __kernel_gettimeofday;
  89. __kernel_clock_gettime;
  90. __kernel_clock_getres;
  91. local: *;
  92. };
  93. }
  94. /*
  95. * Make the sigreturn code visible to the kernel.
  96. */
  97. VDSO_sigtramp = __kernel_rt_sigreturn;