vdso.lds.S 2.7 KB

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