18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#include "relocs.h"
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#define ELF_BITS 64
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#define ELF_MACHINE             EM_MIPS
78c2ecf20Sopenharmony_ci#define ELF_MACHINE_NAME        "MIPS64"
88c2ecf20Sopenharmony_ci#define SHT_REL_TYPE            SHT_RELA
98c2ecf20Sopenharmony_ci#define Elf_Rel                 Elf64_Rela
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_citypedef uint8_t Elf64_Byte;
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_citypedef union {
148c2ecf20Sopenharmony_ci	struct {
158c2ecf20Sopenharmony_ci		Elf64_Word r_sym;	/* Symbol index.  */
168c2ecf20Sopenharmony_ci		Elf64_Byte r_ssym;	/* Special symbol.  */
178c2ecf20Sopenharmony_ci		Elf64_Byte r_type3;	/* Third relocation.  */
188c2ecf20Sopenharmony_ci		Elf64_Byte r_type2;	/* Second relocation.  */
198c2ecf20Sopenharmony_ci		Elf64_Byte r_type;	/* First relocation.  */
208c2ecf20Sopenharmony_ci	} fields;
218c2ecf20Sopenharmony_ci	Elf64_Xword unused;
228c2ecf20Sopenharmony_ci} Elf64_Mips_Rela;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define ELF_CLASS               ELFCLASS64
258c2ecf20Sopenharmony_ci#define ELF_R_SYM(val)          (((Elf64_Mips_Rela *)(&val))->fields.r_sym)
268c2ecf20Sopenharmony_ci#define ELF_R_TYPE(val)         (((Elf64_Mips_Rela *)(&val))->fields.r_type)
278c2ecf20Sopenharmony_ci#define ELF_ST_TYPE(o)          ELF64_ST_TYPE(o)
288c2ecf20Sopenharmony_ci#define ELF_ST_BIND(o)          ELF64_ST_BIND(o)
298c2ecf20Sopenharmony_ci#define ELF_ST_VISIBILITY(o)    ELF64_ST_VISIBILITY(o)
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#include "relocs.c"
32