vdso.lds.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2012 Regents of the University of California
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. OUTPUT_ARCH(riscv)
  14. SECTIONS
  15. {
  16. . = SIZEOF_HEADERS;
  17. .hash : { *(.hash) } :text
  18. .gnu.hash : { *(.gnu.hash) }
  19. .dynsym : { *(.dynsym) }
  20. .dynstr : { *(.dynstr) }
  21. .gnu.version : { *(.gnu.version) }
  22. .gnu.version_d : { *(.gnu.version_d) }
  23. .gnu.version_r : { *(.gnu.version_r) }
  24. .note : { *(.note.*) } :text :note
  25. .dynamic : { *(.dynamic) } :text :dynamic
  26. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  27. .eh_frame : { KEEP (*(.eh_frame)) } :text
  28. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  29. /*
  30. * This linker script is used both with -r and with -shared.
  31. * For the layouts to match, we need to skip more than enough
  32. * space for the dynamic symbol table, etc. If this amount is
  33. * insufficient, ld -shared will error; simply increase it here.
  34. */
  35. . = 0x800;
  36. .text : { *(.text .text.*) } :text
  37. .data : {
  38. *(.got.plt) *(.got)
  39. *(.data .data.* .gnu.linkonce.d.*)
  40. *(.dynbss)
  41. *(.bss .bss.* .gnu.linkonce.b.*)
  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. __vdso_gettimeofday;
  64. __vdso_clock_gettime;
  65. __vdso_clock_getres;
  66. __vdso_getcpu;
  67. __vdso_flush_icache;
  68. local: *;
  69. };
  70. }