elf.S 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "vdso.h"
  11. #include <asm/isa-rev.h>
  12. #include <linux/elfnote.h>
  13. #include <linux/version.h>
  14. ELFNOTE_START(Linux, 0, "a")
  15. .long LINUX_VERSION_CODE
  16. ELFNOTE_END
  17. /*
  18. * The .MIPS.abiflags section must be defined with the FP ABI flags set
  19. * to 'any' to be able to link with both old and new libraries.
  20. * Newer toolchains are capable of automatically generating this, but we want
  21. * to work with older toolchains as well. Therefore, we define the contents of
  22. * this section here (under different names), and then genvdso will patch
  23. * it to have the correct name and type.
  24. *
  25. * We base the .MIPS.abiflags section on preprocessor definitions rather than
  26. * CONFIG_* because we need to match the particular ABI we are building the
  27. * VDSO for.
  28. *
  29. * See https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
  30. * for the .MIPS.abiflags section description.
  31. */
  32. .section .mips_abiflags, "a"
  33. .align 3
  34. __mips_abiflags:
  35. .hword 0 /* version */
  36. .byte __mips /* isa_level */
  37. /* isa_rev */
  38. .byte MIPS_ISA_REV
  39. /* gpr_size */
  40. #ifdef __mips64
  41. .byte 2 /* AFL_REG_64 */
  42. #else
  43. .byte 1 /* AFL_REG_32 */
  44. #endif
  45. /* cpr1_size */
  46. #if (MIPS_ISA_REV >= 6) || defined(__mips64)
  47. .byte 2 /* AFL_REG_64 */
  48. #else
  49. .byte 1 /* AFL_REG_32 */
  50. #endif
  51. .byte 0 /* cpr2_size (AFL_REG_NONE) */
  52. .byte 0 /* fp_abi (Val_GNU_MIPS_ABI_FP_ANY) */
  53. .word 0 /* isa_ext */
  54. .word 0 /* ases */
  55. .word 0 /* flags1 */
  56. .word 0 /* flags2 */