vdso.lds.S 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * GNU linker script for the VDSO library.
  3. *
  4. * Copyright (C) 2012 ARM Limited
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Will Deacon <will.deacon@arm.com>
  19. * Heavily based on the vDSO linker scripts for other archs.
  20. */
  21. #include <linux/const.h>
  22. #include <asm/page.h>
  23. #include <asm/vdso.h>
  24. OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
  25. OUTPUT_ARCH(aarch64)
  26. SECTIONS
  27. {
  28. PROVIDE(_vdso_data = . - PAGE_SIZE);
  29. . = VDSO_LBASE + SIZEOF_HEADERS;
  30. .hash : { *(.hash) } :text
  31. .gnu.hash : { *(.gnu.hash) }
  32. .dynsym : { *(.dynsym) }
  33. .dynstr : { *(.dynstr) }
  34. .gnu.version : { *(.gnu.version) }
  35. .gnu.version_d : { *(.gnu.version_d) }
  36. .gnu.version_r : { *(.gnu.version_r) }
  37. /*
  38. * Discard .note.gnu.property sections which are unused and have
  39. * different alignment requirement from vDSO note sections.
  40. */
  41. /DISCARD/ : {
  42. *(.note.GNU-stack .note.gnu.property)
  43. }
  44. .note : { *(.note.*) } :text :note
  45. . = ALIGN(16);
  46. .text : { *(.text*) } :text =0xd503201f
  47. PROVIDE (__etext = .);
  48. PROVIDE (_etext = .);
  49. PROVIDE (etext = .);
  50. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  51. .eh_frame : { KEEP (*(.eh_frame)) } :text
  52. .dynamic : { *(.dynamic) } :text :dynamic
  53. .rodata : { *(.rodata*) } :text
  54. _end = .;
  55. PROVIDE(end = .);
  56. /DISCARD/ : {
  57. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  58. *(.bss .sbss .dynbss .dynsbss)
  59. }
  60. }
  61. /*
  62. * We must supply the ELF program headers explicitly to get just one
  63. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  64. */
  65. PHDRS
  66. {
  67. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  68. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  69. note PT_NOTE FLAGS(4); /* PF_R */
  70. eh_frame_hdr PT_GNU_EH_FRAME;
  71. }
  72. /*
  73. * This controls what symbols we export from the DSO.
  74. */
  75. VERSION
  76. {
  77. LINUX_2.6.39 {
  78. global:
  79. __kernel_rt_sigreturn;
  80. __kernel_gettimeofday;
  81. __kernel_clock_gettime;
  82. __kernel_clock_getres;
  83. local: *;
  84. };
  85. }
  86. /*
  87. * Make the sigreturn code visible to the kernel.
  88. */
  89. VDSO_sigtramp = __kernel_rt_sigreturn;