vdso.lds.S 2.4 KB

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