vdso.lds.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 Regents of the University of California
  4. */
  5. #include <asm/page.h>
  6. #include <asm/vdso.h>
  7. OUTPUT_ARCH(riscv)
  8. SECTIONS
  9. {
  10. PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
  11. #ifdef CONFIG_TIME_NS
  12. PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
  13. #endif
  14. . = SIZEOF_HEADERS;
  15. .hash : { *(.hash) } :text
  16. .gnu.hash : { *(.gnu.hash) }
  17. .dynsym : { *(.dynsym) }
  18. .dynstr : { *(.dynstr) }
  19. .gnu.version : { *(.gnu.version) }
  20. .gnu.version_d : { *(.gnu.version_d) }
  21. .gnu.version_r : { *(.gnu.version_r) }
  22. .dynamic : { *(.dynamic) } :text :dynamic
  23. .rodata : {
  24. *(.rodata .rodata.* .gnu.linkonce.r.*)
  25. *(.got.plt) *(.got)
  26. *(.data .data.* .gnu.linkonce.d.*)
  27. *(.dynbss)
  28. *(.bss .bss.* .gnu.linkonce.b.*)
  29. }
  30. .note : { *(.note.*) } :text :note
  31. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  32. .eh_frame : { KEEP (*(.eh_frame)) } :text
  33. /*
  34. * Text is well-separated from actual data: there's plenty of
  35. * stuff that isn't used at runtime in between.
  36. */
  37. . = ALIGN(16);
  38. .text : { *(.text .text.*) } :text
  39. . = ALIGN(4);
  40. .alternative : {
  41. *(.alternative)
  42. }
  43. }
  44. /*
  45. * We must supply the ELF program headers explicitly to get just one
  46. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  47. */
  48. PHDRS
  49. {
  50. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  51. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  52. note PT_NOTE FLAGS(4); /* PF_R */
  53. eh_frame_hdr PT_GNU_EH_FRAME;
  54. }
  55. /*
  56. * This controls what symbols we export from the DSO.
  57. */
  58. VERSION
  59. {
  60. LINUX_4.15 {
  61. global:
  62. __vdso_rt_sigreturn;
  63. #ifdef HAS_VGETTIMEOFDAY
  64. __vdso_gettimeofday;
  65. __vdso_clock_gettime;
  66. __vdso_clock_getres;
  67. #endif
  68. __vdso_getcpu;
  69. __vdso_flush_icache;
  70. #ifndef COMPAT_VDSO
  71. __vdso_riscv_hwprobe;
  72. #endif
  73. local: *;
  74. };
  75. }