diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2019-11-06 04:33:22 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2019-11-06 04:33:56 +0100 |
commit | cb9d1f53717dd67892ba943626f3d1b46f3e760b (patch) | |
tree | 354ae263423ca4c024dd17e5d068f73d4366cd3b /ldso | |
parent | 858ffad217076227089cc17eb832db0bd1497792 (diff) |
riscv64: lazy relocations do not work like sparc/m68k
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/riscv64/elfinterp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ldso/ldso/riscv64/elfinterp.c b/ldso/ldso/riscv64/elfinterp.c index ec1678f2a..b954779bd 100644 --- a/ldso/ldso/riscv64/elfinterp.c +++ b/ldso/ldso/riscv64/elfinterp.c @@ -226,6 +226,8 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, return 0; } +#undef __RISCV_LAZY_RELOC_WORKS +#ifdef __RISCV_LAZY_RELOC_WORKS static int _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab) @@ -250,7 +252,6 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, case R_RISCV_NONE: break; case R_RISCV_JUMP_SLOT: - *reloc_addr += tpnt->loadaddr; break; default: return -1; /*call _dl_exit(1) */ @@ -265,11 +266,17 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope, return 0; } +#endif void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size) { +#ifdef __RISCV_LAZY_RELOC_WORKS (void)_dl_parse(rpnt->dyn, NULL, rel_addr, rel_size, _dl_do_lazy_reloc); +#else + _dl_parse_relocation_information(rpnt, &_dl_loaded_modules->symbol_scope, + rel_addr, rel_size); +#endif } int _dl_parse_relocation_information(struct dyn_elf *rpnt, |