vdso.lds.S 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Adapted from arm64 version.
  3. *
  4. * GNU linker script for the VDSO library.
  5. *
  6. * Copyright (C) 2012 ARM Limited
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Author: Will Deacon <will.deacon@arm.com>
  21. * Heavily based on the vDSO linker scripts for other archs.
  22. */
  23. #include <linux/const.h>
  24. #include <asm/page.h>
  25. #include <asm/vdso.h>
  26. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  27. OUTPUT_ARCH(arm)
  28. SECTIONS
  29. {
  30. PROVIDE(_start = .);
  31. . = SIZEOF_HEADERS;
  32. .hash : { *(.hash) } :text
  33. .gnu.hash : { *(.gnu.hash) }
  34. .dynsym : { *(.dynsym) }
  35. .dynstr : { *(.dynstr) }
  36. .gnu.version : { *(.gnu.version) }
  37. .gnu.version_d : { *(.gnu.version_d) }
  38. .gnu.version_r : { *(.gnu.version_r) }
  39. .note : { *(.note.*) } :text :note
  40. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  41. .eh_frame : { KEEP (*(.eh_frame)) } :text
  42. .dynamic : { *(.dynamic) } :text :dynamic
  43. .rodata : { *(.rodata*) } :text
  44. .text : { *(.text*) } :text =0xe7f001f2
  45. .got : { *(.got) }
  46. .rel.plt : { *(.rel.plt) }
  47. /DISCARD/ : {
  48. *(.note.GNU-stack)
  49. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  50. *(.bss .sbss .dynbss .dynsbss)
  51. }
  52. }
  53. /*
  54. * We must supply the ELF program headers explicitly to get just one
  55. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  56. */
  57. PHDRS
  58. {
  59. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  60. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  61. note PT_NOTE FLAGS(4); /* PF_R */
  62. eh_frame_hdr PT_GNU_EH_FRAME;
  63. }
  64. VERSION
  65. {
  66. LINUX_2.6 {
  67. global:
  68. __vdso_clock_gettime;
  69. __vdso_gettimeofday;
  70. local: *;
  71. };
  72. }