elf.S 1.8 KB

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