vdso.lds.S 1.7 KB

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