Skip to content

Commit 9c9530e

Browse files
radaretrufae
authored andcommitted
Implement support for R_AARCH64_RELATIVE for ELF imports ##bin
1 parent 4ae6b53 commit 9c9530e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libr/bin/format/elf/elf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,8 @@ static ut64 get_import_addr_arm64(ELFOBJ *eo, RBinElfReloc *rel) {
17021702

17031703
switch (rel->type) {
17041704
case R_AARCH64_RELATIVE:
1705-
R_LOG_WARN ("Unsupported arm64 relocation type for imports %d", rel->type);
1706-
return UT64_MAX;
1705+
// Direct binding: adjust by program base for relative relocations.
1706+
return eo->baddr + rel->addend;
17071707
case R_AARCH64_IRELATIVE:
17081708
if (rel->addend > plt_addr) { // start
17091709
return (plt_addr + pos * 16 + 32) + rel->addend;

0 commit comments

Comments
 (0)