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