support more relocation type in elfloader

mostly copied from linux kernel 4.20, Shh...
This commit is contained in:
daishengdong
2020-06-09 20:26:12 +08:00
parent 0a2d5a4e90
commit 5e16690f7b
5 changed files with 172 additions and 16 deletions

View File

@@ -20,18 +20,19 @@
typedef enum elfloader_err_en {
ELFLOADER_ERR_NONE,
ELFLOADER_ERR_FD_READ_FAILED,
ELFLOADER_ERR_HEADER_INVALID,
ELFLOADER_ERR_TYPE_INVALID,
ELFLOADER_ERR_NO_DYN,
ELFLOADER_ERR_NO_SYMTAB,
ELFLOADER_ERR_NO_STRTAB,
ELFLOADER_ERR_NO_TEXT,
ELFLOADER_ERR_NO_LOAD_SEGMENTS,
ELFLOADER_ERR_FD_READ_FAILED,
ELFLOADER_ERR_OUT_OF_MEMORY,
ELFLOADER_ERR_RELOCATE_FAILED,
ELFLOADER_ERR_PTR_NULL,
ELFLOADER_ERR_SECTION_NOT_FOUND,
ELFLOADER_ERR_SYM_NOT_FOUND,
ELFLOADER_ERR_OUT_OF_MEMORY,
ELFLOADER_ERR_PTR_NULL,
ELFLOADER_ERR_TYPE_INVALID,
} el_err_t;
#endif /* _TOS_ELFLOADER_ERR_H_ */

View File

@@ -18,7 +18,7 @@
#ifndef _TOS_ELFLOADER_RELOCATE_H_
#define _TOS_ELFLOADER_RELOCATE_H_
__KNL__ void elfloader_arch_relocate(uint32_t reloc_addr, int32_t load_bias, uint32_t addr, elf32_rela_t *rela, int is_rela);
__KNL__ el_err_t elfloader_arch_relocate(uint32_t reloc_addr, int32_t load_bias, uint32_t addr, elf32_rela_t *rela, int is_rela, elf32_sym_t *sym);
#endif /* _TOS_ELFLOADER_RELOCATE_H_ */