xref: /openbmc/linux/arch/mips/boot/tools/relocs_64.c (revision 766c580356ecca88b32c47b8128bec7d6d014533)
1*766c5803SMatt Redfearn #include "relocs.h"
2*766c5803SMatt Redfearn 
3*766c5803SMatt Redfearn #define ELF_BITS 64
4*766c5803SMatt Redfearn 
5*766c5803SMatt Redfearn #define ELF_MACHINE             EM_MIPS
6*766c5803SMatt Redfearn #define ELF_MACHINE_NAME        "MIPS64"
7*766c5803SMatt Redfearn #define SHT_REL_TYPE            SHT_RELA
8*766c5803SMatt Redfearn #define Elf_Rel                 Elf64_Rela
9*766c5803SMatt Redfearn 
10*766c5803SMatt Redfearn typedef uint8_t Elf64_Byte;
11*766c5803SMatt Redfearn 
12*766c5803SMatt Redfearn typedef struct {
13*766c5803SMatt Redfearn 	Elf64_Word r_sym;	/* Symbol index.  */
14*766c5803SMatt Redfearn 	Elf64_Byte r_ssym;	/* Special symbol.  */
15*766c5803SMatt Redfearn 	Elf64_Byte r_type3;	/* Third relocation.  */
16*766c5803SMatt Redfearn 	Elf64_Byte r_type2;	/* Second relocation.  */
17*766c5803SMatt Redfearn 	Elf64_Byte r_type;	/* First relocation.  */
18*766c5803SMatt Redfearn } Elf64_Mips_Rela;
19*766c5803SMatt Redfearn 
20*766c5803SMatt Redfearn #define ELF_CLASS               ELFCLASS64
21*766c5803SMatt Redfearn #define ELF_R_SYM(val)          (((Elf64_Mips_Rela *)(&val))->r_sym)
22*766c5803SMatt Redfearn #define ELF_R_TYPE(val)         (((Elf64_Mips_Rela *)(&val))->r_type)
23*766c5803SMatt Redfearn #define ELF_ST_TYPE(o)          ELF64_ST_TYPE(o)
24*766c5803SMatt Redfearn #define ELF_ST_BIND(o)          ELF64_ST_BIND(o)
25*766c5803SMatt Redfearn #define ELF_ST_VISIBILITY(o)    ELF64_ST_VISIBILITY(o)
26*766c5803SMatt Redfearn 
27*766c5803SMatt Redfearn #include "relocs.c"
28