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