vdso.lds.S 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. . = VDSO_LBASE + SIZEOF_HEADERS;
  29. .hash : { *(.hash) } :text
  30. .gnu.hash : { *(.gnu.hash) }
  31. .dynsym : { *(.dynsym) }
  32. .dynstr : { *(.dynstr) }
  33. .gnu.version : { *(.gnu.version) }
  34. .gnu.version_d : { *(.gnu.version_d) }
  35. .gnu.version_r : { *(.gnu.version_r) }
  36. .note : { *(.note.*) } :text :note
  37. . = ALIGN(16);
  38. .text : { *(.text*) } :text =0xd503201f
  39. PROVIDE (__etext = .);
  40. PROVIDE (_etext = .);
  41. PROVIDE (etext = .);
  42. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  43. .eh_frame : { KEEP (*(.eh_frame)) } :text
  44. .dynamic : { *(.dynamic) } :text :dynamic
  45. .rodata : { *(.rodata*) } :text
  46. _end = .;
  47. PROVIDE(end = .);
  48. . = ALIGN(PAGE_SIZE);
  49. PROVIDE(_vdso_data = .);
  50. /DISCARD/ : {
  51. *(.note.GNU-stack)
  52. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  53. *(.bss .sbss .dynbss .dynsbss)
  54. }
  55. }
  56. /*
  57. * We must supply the ELF program headers explicitly to get just one
  58. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  59. */
  60. PHDRS
  61. {
  62. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  63. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  64. note PT_NOTE FLAGS(4); /* PF_R */
  65. eh_frame_hdr PT_GNU_EH_FRAME;
  66. }
  67. /*
  68. * This controls what symbols we export from the DSO.
  69. */
  70. VERSION
  71. {
  72. LINUX_2.6.39 {
  73. global:
  74. __kernel_rt_sigreturn;
  75. __kernel_gettimeofday;
  76. __kernel_clock_gettime;
  77. __kernel_clock_getres;
  78. local: *;
  79. };
  80. }
  81. /*
  82. * Make the sigreturn code visible to the kernel.
  83. */
  84. VDSO_sigtramp = __kernel_rt_sigreturn;