elf.S 1.6 KB

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