vdso.lds.S 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2015 Imagination Technologies
  4. * Author: Alex Smith <[email protected]>
  5. */
  6. #include <asm/sgidefs.h>
  7. #if _MIPS_SIM == _MIPS_SIM_ABI64
  8. OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips", "elf64-tradlittlemips")
  9. #elif _MIPS_SIM == _MIPS_SIM_NABI32
  10. OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips", "elf32-ntradlittlemips")
  11. #else
  12. OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips")
  13. #endif
  14. OUTPUT_ARCH(mips)
  15. SECTIONS
  16. {
  17. PROVIDE(_start = .);
  18. . = SIZEOF_HEADERS;
  19. /*
  20. * In order to retain compatibility with older toolchains we provide the
  21. * ABI flags section ourself. Newer assemblers will automatically
  22. * generate .MIPS.abiflags sections so we discard such input sections,
  23. * and then manually define our own section here. genvdso will patch
  24. * this section to have the correct name/type.
  25. */
  26. .mips_abiflags : { *(.mips_abiflags) } :text :abiflags
  27. .reginfo : { *(.reginfo) } :text :reginfo
  28. .hash : { *(.hash) } :text
  29. .gnu.hash : { *(.gnu.hash) }
  30. .dynsym : { *(.dynsym) }
  31. .dynstr : { *(.dynstr) }
  32. .gnu.version : { *(.gnu.version) }
  33. .gnu.version_d : { *(.gnu.version_d) }
  34. .gnu.version_r : { *(.gnu.version_r) }
  35. .note : { *(.note.*) } :text :note
  36. .text : { *(.text*) } :text
  37. PROVIDE (__etext = .);
  38. PROVIDE (_etext = .);
  39. PROVIDE (etext = .);
  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. _end = .;
  45. PROVIDE(end = .);
  46. /DISCARD/ : {
  47. *(.MIPS.abiflags)
  48. *(.gnu.attributes)
  49. *(.note.GNU-stack)
  50. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  51. *(.bss .sbss .dynbss .dynsbss)
  52. }
  53. }
  54. PHDRS
  55. {
  56. /*
  57. * Provide a PT_MIPS_ABIFLAGS header to assign the ABI flags section
  58. * to. We can specify the header type directly here so no modification
  59. * is needed later on.
  60. */
  61. abiflags 0x70000003;
  62. /*
  63. * The ABI flags header must exist directly after the PT_INTERP header,
  64. * so we must explicitly place the PT_MIPS_REGINFO header after it to
  65. * stop the linker putting one in at the start.
  66. */
  67. reginfo 0x70000000;
  68. text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
  69. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  70. note PT_NOTE FLAGS(4); /* PF_R */
  71. eh_frame_hdr PT_GNU_EH_FRAME;
  72. }
  73. VERSION
  74. {
  75. LINUX_2.6 {
  76. #ifndef CONFIG_MIPS_DISABLE_VDSO
  77. global:
  78. __vdso_clock_gettime;
  79. __vdso_gettimeofday;
  80. __vdso_clock_getres;
  81. #if _MIPS_SIM != _MIPS_SIM_ABI64
  82. __vdso_clock_gettime64;
  83. #endif
  84. #endif
  85. local: *;
  86. };
  87. }