Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #17523 - Resolve internal symbols referenced from the PLT ##bin #23805

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libr/bin/format/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@ ut64 Elf_(get_main_offset)(ELFOBJ *eo) {
// non-thumb entry points
if (!memcmp (buf, "\x00\xb0\xa0\xe3\x00\xe0\xa0\xe3", 8)) {
if (buf[0x40 + 2] == 0xff && buf[0x40 + 3] == 0xeb) {
// nothing may happen
// nothing to do
} else if (!memcmp (buf + 0x28 + 2, "\xff\xeb", 2)) {
return Elf_(v2p) (eo, r_read_le32 (&buf[0x34]) & ~1);
}
Expand Down Expand Up @@ -4375,6 +4375,7 @@ RBinSymbol *Elf_(convert_symbol)(ELFOBJ *eo, RBinElfSymbol *symbol) {
ptr->bind = symbol->bind;
ptr->type = symbol->type;
ptr->is_imported = symbol->is_imported;
// ptr->is_internal = symbol->is_internal;
ptr->paddr = paddr;
ptr->vaddr = vaddr;
ptr->size = symbol->size;
Expand Down
1 change: 1 addition & 0 deletions libr/bin/format/elf/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct r_bin_elf_symbol_t {
bool is_sht_null;
bool is_vaddr; /* when true, offset is virtual address, otherwise it's physical */
bool is_imported;
bool is_internal;
} RBinElfSymbol;

typedef struct r_bin_elf_reloc_t {
Expand Down
3 changes: 3 additions & 0 deletions libr/bin/p/bin_elf.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ static RList* imports(RBinFile *bf) {

RBinElfSymbol *is;
R_VEC_FOREACH (imports, is) {
if (import_symbol->is_internal) {
trufae marked this conversation as resolved.
Show resolved Hide resolved
continue;
}
RBinImport *ptr = R_NEW0 (RBinImport);
if (!ptr) {
break;
Expand Down
Loading