diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/elfload_dump.h | 1 | ||||
| -rw-r--r-- | src/include/elfloader.h | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/include/elfload_dump.h b/src/include/elfload_dump.h index ce0e9c1b..ad2ecd71 100644 --- a/src/include/elfload_dump.h +++ b/src/include/elfload_dump.h @@ -18,6 +18,7 @@ void DumpDynamicRPath(elfheader_t *h); void DumpDynSym(elfheader_t *h); void DumpRelTable(elfheader_t *h, int cnt, Elf64_Rel *rel, const char* name); void DumpRelATable(elfheader_t *h, int cnt, Elf64_Rela *rela, const char* name); +void DumpRelRTable(elfheader_t *h, int cnt, Elf64_Relr *relr, const char *name); void DumpBinary(char* p, int sz); diff --git a/src/include/elfloader.h b/src/include/elfloader.h index ea0928b1..770709c8 100644 --- a/src/include/elfloader.h +++ b/src/include/elfloader.h @@ -1,6 +1,7 @@ #ifndef __ELF_LOADER_H_ #define __ELF_LOADER_H_ #include <stdio.h> +#include <elf.h> typedef struct elfheader_s elfheader_t; typedef struct lib_s lib_t; @@ -14,6 +15,24 @@ typedef struct kh_defaultversion_s kh_defaultversion_t; typedef struct dynablock_s dynablock_t; #endif +// Define for handling .relr.dyn section (since glibc 2.36) +// See Also https://lists.gnu.org/archive/html/info-gnu/2022-08/msg00000.html +// +// if glibc 2.36 is widely used in the future, this part can be removed +#ifndef DT_RELR + +// Copy from (glibc 2.36) elf.h + +#define SHT_RELR 19 /* RELR relative relocations */ + +typedef Elf32_Word Elf32_Relr; +typedef Elf64_Xword Elf64_Relr; + +#define DT_RELRSZ 35 /* Total size of RELR relative relocations */ +#define DT_RELR 36 /* Address of RELR relative relocations */ +#define DT_RELRENT 37 /* Size of one RELR relative relocaction */ +#endif // DT_RELR + // Open an elfheader. Transfert control of f to elfheader also! elfheader_t* LoadAndCheckElfHeader(FILE* f, const char* name, int exec); // exec : 0 = lib, 1 = exec void FreeElfHeader(elfheader_t** head); |