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