Skip to content

Commit f00bfbf

Browse files
committed
Fix #17523 - Resolve internal symbols referenced from the PLT ##bin
1 parent f56f582 commit f00bfbf

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

libr/bin/format/elf/elf.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ ut64 Elf_(get_main_offset)(ELFOBJ *eo) {
20812081
// non-thumb entry points
20822082
if (!memcmp (buf, "\x00\xb0\xa0\xe3\x00\xe0\xa0\xe3", 8)) {
20832083
if (buf[0x40 + 2] == 0xff && buf[0x40 + 3] == 0xeb) {
2084-
// nothing may happen
2084+
// nothing to do
20852085
} else if (!memcmp (buf + 0x28 + 2, "\xff\xeb", 2)) {
20862086
return Elf_(v2p) (eo, r_read_le32 (&buf[0x34]) & ~1);
20872087
}
@@ -4238,6 +4238,7 @@ RBinSymbol *Elf_(_r_bin_elf_convert_symbol)(struct Elf_(obj_t) *eo, RBinElfSymbo
42384238
ptr->bind = symbol->bind;
42394239
ptr->type = symbol->type;
42404240
ptr->is_imported = symbol->is_imported;
4241+
// ptr->is_internal = symbol->is_internal;
42414242
ptr->paddr = paddr;
42424243
ptr->vaddr = vaddr;
42434244
ptr->size = symbol->size;

libr/bin/format/elf/elf.h

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typedef struct r_bin_elf_symbol_t {
5959
bool is_sht_null;
6060
bool is_vaddr; /* when true, offset is virtual address, otherwise it's physical */
6161
bool is_imported;
62+
bool is_internal;
6263
} RBinElfSymbol;
6364

6465
typedef struct r_bin_elf_reloc_t {

libr/bin/p/bin_elf.inc.c

+3
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ static RList* imports(RBinFile *bf) {
406406

407407
RBinElfSymbol *import_symbol;
408408
r_vector_foreach (import_symbols, import_symbol) {
409+
if (import_symbol->is_internal) {
410+
continue;
411+
}
409412
RBinImport *ptr = R_NEW0 (RBinImport);
410413
if (!ptr) {
411414
break;

0 commit comments

Comments
 (0)