Removed the typedefs for Elf32 word types

This commit is contained in:
Charles Rozhon 2014-08-20 15:21:41 -05:00
parent d84b2f3be4
commit 965b1f1f2c
2 changed files with 49 additions and 55 deletions

View File

@ -5,14 +5,15 @@
#include <string>
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Core/Boot/ElfReader.h"
#include "Core/Debugger/Debugger_SymbolMap.h"
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/PPCSymbolDB.h"
static void bswap(Elf32_Word &w) {w = Common::swap32(w);}
static void bswap(Elf32_Half &w) {w = Common::swap16(w);}
static void bswap(u32 &w) {w = Common::swap32(w);}
static void bswap(u16 &w) {w = Common::swap16(w);}
static void byteswapHeader(Elf32_Ehdr &ELF_H)
{

View File

@ -184,69 +184,62 @@ enum ElfSectionFlags
#define DT_LOPROC 0x70000000
#define DT_HIPROC 0x7FFFFFFF
typedef u32 Elf32_Addr;
typedef u16 Elf32_Half;
typedef u32 Elf32_Off;
typedef s32 Elf32_Sword;
typedef u32 Elf32_Word;
// ELF file header
struct Elf32_Ehdr
{
u8 e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry;
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
u8 e_ident[EI_NIDENT];
u16 e_type;
u16 e_machine;
u32 e_version;
u32 e_entry;
u32 e_phoff;
u32 e_shoff;
u32 e_flags;
u16 e_ehsize;
u16 e_phentsize;
u16 e_phnum;
u16 e_shentsize;
u16 e_shnum;
u16 e_shstrndx;
};
// Section header
struct Elf32_Shdr
{
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
u32 sh_name;
u32 sh_type;
u32 sh_flags;
u32 sh_addr;
u32 sh_offset;
u32 sh_size;
u32 sh_link;
u32 sh_info;
u32 sh_addralign;
u32 sh_entsize;
};
// Segment header
struct Elf32_Phdr
{
Elf32_Word p_type;
Elf32_Off p_offset;
Elf32_Addr p_vaddr;
Elf32_Addr p_paddr;
Elf32_Word p_filesz;
Elf32_Word p_memsz;
Elf32_Word p_flags;
Elf32_Word p_align;
u32 p_type;
u32 p_offset;
u32 p_vaddr;
u32 p_paddr;
u32 p_filesz;
u32 p_memsz;
u32 p_flags;
u32 p_align;
};
// Symbol table entry
struct Elf32_Sym
{
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
u8 st_info;
u8 st_other;
Elf32_Half st_shndx;
u32 st_name;
u32 st_value;
u32 st_size;
u8 st_info;
u8 st_other;
u16 st_shndx;
};
#define ELF32_ST_BIND(i) ((i)>>4)
@ -256,15 +249,15 @@ struct Elf32_Sym
// Relocation entries
struct Elf32_Rel
{
Elf32_Addr r_offset;
Elf32_Word r_info;
u32 r_offset;
u32 r_info;
};
struct Elf32_Rela
{
Elf32_Addr r_offset;
Elf32_Word r_info;
Elf32_Sword r_addend;
u32 r_offset;
u32 r_info;
s32 r_addend;
};
#define ELF32_R_SYM(i) ((i)>>8)
@ -274,10 +267,10 @@ struct Elf32_Rela
struct Elf32_Dyn
{
Elf32_Sword d_tag;
s32 d_tag;
union
{
Elf32_Word d_val;
Elf32_Addr d_ptr;
u32 d_val;
u32 d_ptr;
} d_un;
};