Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include "relocs.h"
0003 
0004 #define ELF_BITS 64
0005 
0006 #define ELF_MACHINE             EM_MIPS
0007 #define ELF_MACHINE_NAME        "MIPS64"
0008 #define SHT_REL_TYPE            SHT_RELA
0009 #define Elf_Rel                 Elf64_Rela
0010 
0011 typedef uint8_t Elf64_Byte;
0012 
0013 typedef union {
0014     struct {
0015         Elf64_Word r_sym;   /* Symbol index.  */
0016         Elf64_Byte r_ssym;  /* Special symbol.  */
0017         Elf64_Byte r_type3; /* Third relocation.  */
0018         Elf64_Byte r_type2; /* Second relocation.  */
0019         Elf64_Byte r_type;  /* First relocation.  */
0020     } fields;
0021     Elf64_Xword unused;
0022 } Elf64_Mips_Rela;
0023 
0024 #define ELF_CLASS               ELFCLASS64
0025 #define ELF_R_SYM(val)          (((Elf64_Mips_Rela *)(&val))->fields.r_sym)
0026 #define ELF_R_TYPE(val)         (((Elf64_Mips_Rela *)(&val))->fields.r_type)
0027 #define ELF_ST_TYPE(o)          ELF64_ST_TYPE(o)
0028 #define ELF_ST_BIND(o)          ELF64_ST_BIND(o)
0029 #define ELF_ST_VISIBILITY(o)    ELF64_ST_VISIBILITY(o)
0030 
0031 #include "relocs.c"