vdso.lds.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. .note : { *(.note.*) } :text :note
  23. .dynamic : { *(.dynamic) } :text :dynamic
  24. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  25. .eh_frame : { KEEP (*(.eh_frame)) } :text
  26. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  27. /*
  28. * This linker script is used both with -r and with -shared.
  29. * For the layouts to match, we need to skip more than enough
  30. * space for the dynamic symbol table, etc. If this amount is
  31. * insufficient, ld -shared will error; simply increase it here.
  32. */
  33. . = 0x800;
  34. .text : { *(.text .text.*) } :text
  35. .data : {
  36. *(.got.plt) *(.got)
  37. *(.data .data.* .gnu.linkonce.d.*)
  38. *(.dynbss)
  39. *(.bss .bss.* .gnu.linkonce.b.*)
  40. }
  41. }
  42. /*
  43. * We must supply the ELF program headers explicitly to get just one
  44. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  45. */
  46. PHDRS
  47. {
  48. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  49. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  50. note PT_NOTE FLAGS(4); /* PF_R */
  51. eh_frame_hdr PT_GNU_EH_FRAME;
  52. }
  53. /*
  54. * This controls what symbols we export from the DSO.
  55. */
  56. VERSION
  57. {
  58. LINUX_4.15 {
  59. global:
  60. __vdso_rt_sigreturn;
  61. #ifdef HAS_VGETTIMEOFDAY
  62. __vdso_gettimeofday;
  63. __vdso_clock_gettime;
  64. __vdso_clock_getres;
  65. #endif
  66. __vdso_getcpu;
  67. __vdso_flush_icache;
  68. local: *;
  69. };
  70. }