mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
ElfXX_Rel, ElfXX_Rela
This commit is contained in:
parent
da6a9bf3eb
commit
e0c11956a6
45
src/p_elf.h
45
src/p_elf.h
|
@ -91,6 +91,27 @@ __packed_struct(Dyn)
|
|||
__packed_struct_end()
|
||||
|
||||
|
||||
template <class TElfITypes>
|
||||
__packed_struct(Rel)
|
||||
typedef typename TElfITypes::Xword Xword;
|
||||
typedef typename TElfITypes::Addr Addr;
|
||||
|
||||
Addr r_offset;
|
||||
Xword r_info;
|
||||
__packed_struct_end()
|
||||
|
||||
|
||||
template <class TElfITypes>
|
||||
__packed_struct(Rela)
|
||||
typedef typename TElfITypes::Xword Xword;
|
||||
typedef typename TElfITypes::Addr Addr;
|
||||
|
||||
Addr r_offset;
|
||||
Xword r_info;
|
||||
Xword r_addend;
|
||||
__packed_struct_end()
|
||||
|
||||
|
||||
template <class TElfITypes>
|
||||
__packed_struct(External_Note)
|
||||
typedef typename TElfITypes::Word Word;
|
||||
|
@ -277,6 +298,8 @@ struct ElfClass_32
|
|||
typedef N_Elf32::Phdr<ElfITypes> Phdr;
|
||||
typedef N_Elf32::Shdr<ElfITypes> Shdr;
|
||||
typedef N_Elf ::Dyn <ElfITypes> Dyn;
|
||||
typedef N_Elf ::Rel <ElfITypes> Rel;
|
||||
typedef N_Elf ::Rela<ElfITypes> Rela;
|
||||
typedef N_Elf32::Sym <ElfITypes> Sym;
|
||||
typedef N_Elf ::External_Note<ElfITypes> External_Note;
|
||||
|
||||
|
@ -286,11 +309,15 @@ struct ElfClass_32
|
|||
COMPILE_TIME_ASSERT(sizeof(Phdr) == 32)
|
||||
COMPILE_TIME_ASSERT(sizeof(Shdr) == 40)
|
||||
COMPILE_TIME_ASSERT(sizeof(Dyn) == 8)
|
||||
COMPILE_TIME_ASSERT(sizeof(Rel) == 8)
|
||||
COMPILE_TIME_ASSERT(sizeof(Rela) == 12)
|
||||
COMPILE_TIME_ASSERT(sizeof(Sym) == 16)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Ehdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Phdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Shdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Dyn)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Rel)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Rela)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Sym)
|
||||
}
|
||||
};
|
||||
|
@ -312,6 +339,8 @@ struct ElfClass_64
|
|||
typedef N_Elf64::Phdr<ElfITypes> Phdr;
|
||||
typedef N_Elf64::Shdr<ElfITypes> Shdr;
|
||||
typedef N_Elf ::Dyn <ElfITypes> Dyn;
|
||||
typedef N_Elf ::Rel <ElfITypes> Rel;
|
||||
typedef N_Elf ::Rela<ElfITypes> Rela;
|
||||
typedef N_Elf64::Sym <ElfITypes> Sym;
|
||||
typedef N_Elf ::External_Note<ElfITypes> External_Note;
|
||||
|
||||
|
@ -321,11 +350,15 @@ struct ElfClass_64
|
|||
COMPILE_TIME_ASSERT(sizeof(Phdr) == 56)
|
||||
COMPILE_TIME_ASSERT(sizeof(Shdr) == 64)
|
||||
COMPILE_TIME_ASSERT(sizeof(Dyn) == 16)
|
||||
COMPILE_TIME_ASSERT(sizeof(Rel) == 16)
|
||||
COMPILE_TIME_ASSERT(sizeof(Rela) == 24)
|
||||
COMPILE_TIME_ASSERT(sizeof(Sym) == 24)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Ehdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Phdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Shdr)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Dyn)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Rel)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Rela)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(Sym)
|
||||
}
|
||||
};
|
||||
|
@ -350,6 +383,8 @@ typedef ElfClass_Host32::Ehdr Elf32_Ehdr;
|
|||
typedef ElfClass_Host32::Phdr Elf32_Phdr;
|
||||
typedef ElfClass_Host32::Shdr Elf32_Shdr;
|
||||
typedef ElfClass_Host32::Dyn Elf32_Dyn;
|
||||
typedef ElfClass_Host32::Rel Elf32_Rel;
|
||||
typedef ElfClass_Host32::Rela Elf32_Rela;
|
||||
typedef ElfClass_Host32::Sym Elf32_Sym;
|
||||
typedef ElfClass_Host32::External_Note Elf32_External_Note;
|
||||
|
||||
|
@ -357,6 +392,8 @@ typedef ElfClass_Host64::Ehdr Elf64_Ehdr;
|
|||
typedef ElfClass_Host64::Phdr Elf64_Phdr;
|
||||
typedef ElfClass_Host64::Shdr Elf64_Shdr;
|
||||
typedef ElfClass_Host64::Dyn Elf64_Dyn;
|
||||
typedef ElfClass_Host64::Rel Elf64_Rel;
|
||||
typedef ElfClass_Host64::Rela Elf64_Rela;
|
||||
typedef ElfClass_Host64::Sym Elf64_Sym;
|
||||
typedef ElfClass_Host64::External_Note Elf64_External_Note;
|
||||
|
||||
|
@ -364,6 +401,8 @@ typedef ElfClass_BE32::Ehdr Elf_BE32_Ehdr;
|
|||
typedef ElfClass_BE32::Phdr Elf_BE32_Phdr;
|
||||
typedef ElfClass_BE32::Shdr Elf_BE32_Shdr;
|
||||
typedef ElfClass_BE32::Dyn Elf_BE32_Dyn;
|
||||
typedef ElfClass_BE32::Rel Elf_BE32_Rel;
|
||||
typedef ElfClass_BE32::Rela Elf_BE32_Rela;
|
||||
typedef ElfClass_BE32::Sym Elf_BE32_Sym;
|
||||
typedef ElfClass_BE32::External_Note Elf_BE32_External_Note;
|
||||
|
||||
|
@ -371,6 +410,8 @@ typedef ElfClass_BE64::Ehdr Elf_BE64_Ehdr;
|
|||
typedef ElfClass_BE64::Phdr Elf_BE64_Phdr;
|
||||
typedef ElfClass_BE64::Shdr Elf_BE64_Shdr;
|
||||
typedef ElfClass_BE64::Dyn Elf_BE64_Dyn;
|
||||
typedef ElfClass_BE64::Rel Elf_BE64_Rel;
|
||||
typedef ElfClass_BE64::Rela Elf_BE64_Rela;
|
||||
typedef ElfClass_BE64::Sym Elf_BE64_Sym;
|
||||
typedef ElfClass_BE64::External_Note Elf_BE64_External_Note;
|
||||
|
||||
|
@ -378,6 +419,8 @@ typedef ElfClass_LE32::Ehdr Elf_LE32_Ehdr;
|
|||
typedef ElfClass_LE32::Phdr Elf_LE32_Phdr;
|
||||
typedef ElfClass_LE32::Shdr Elf_LE32_Shdr;
|
||||
typedef ElfClass_LE32::Dyn Elf_LE32_Dyn;
|
||||
typedef ElfClass_LE32::Rel Elf_LE32_Rel;
|
||||
typedef ElfClass_LE32::Rela Elf_LE32_Rela;
|
||||
typedef ElfClass_LE32::Sym Elf_LE32_Sym;
|
||||
typedef ElfClass_LE32::External_Note Elf_LE32_External_Note;
|
||||
|
||||
|
@ -385,6 +428,8 @@ typedef ElfClass_LE64::Ehdr Elf_LE64_Ehdr;
|
|||
typedef ElfClass_LE64::Phdr Elf_LE64_Phdr;
|
||||
typedef ElfClass_LE64::Shdr Elf_LE64_Shdr;
|
||||
typedef ElfClass_LE64::Dyn Elf_LE64_Dyn;
|
||||
typedef ElfClass_LE64::Rel Elf_LE64_Rel;
|
||||
typedef ElfClass_LE64::Rela Elf_LE64_Rela;
|
||||
typedef ElfClass_LE64::Sym Elf_LE64_Sym;
|
||||
typedef ElfClass_LE64::External_Note Elf_LE64_External_Note;
|
||||
|
||||
|
|
|
@ -145,6 +145,10 @@
|
|||
DT_HASH = 4, /* Hash table of symbol names */
|
||||
DT_STRTAB = 5, /* String table */
|
||||
DT_SYMTAB = 6, /* Symbol table */
|
||||
DT_RELA = 7, /* Relocations which do contain an addend */
|
||||
DT_RELAENT = 9, /* Size of one RELA relocation */
|
||||
DT_REL = 17, /* Relocations which contain no addend */
|
||||
DT_RELENT = 19, /* Size of one Rel relocation */
|
||||
DT_STRSZ = 10, /* Sizeof string table */
|
||||
DT_PLTREL = 20, /* Type of reloc in PLT */
|
||||
DT_JMPREL = 23, /* Address of PLT relocs */
|
||||
|
|
Loading…
Reference in New Issue
Block a user