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 ELF R_X86_64_PLT32 relocation entries patching ##bin #17587
Conversation
Correctly get the address of the PLT entry for a symbol. If the symbol was not yet added to the .got.r2 section, then take the first available address (vaddr), otherwise retrieve it from the hashtable.
7791974
to
0fca53f
Compare
Ok apparently it is not working well yet. Moving it back to draft :( |
@@ -1512,13 +1512,6 @@ static int handleMidFlags(RCore *core, RDisasmState *ds, bool print) { | |||
} else if (!strncmp (fi->name, "str.", 4)) { | |||
ds->midflags = R_MIDFLAGS_REALIGN; | |||
} else if (!strncmp (fi->name, "reloc.", 6)) { | |||
if (print) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only it seems unnecessary because, as written in the comment, there is already a comment for relocations. But it is also wrong in some cases.
RBinReloc *rel; | ||
rel = r_core_getreloc (ds->core, ds->analop.addr, ds->analop.size); | ||
RBinReloc *rel = NULL; | ||
if (!ds->core->bin->is_reloc_patched) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GustavoLCR I saw this was done by you in #14587 to correctly show relocations when -e io.cache=true
is not used. However, when that's used this causes issues because the relocations AFAIK change positions.
Your checklist for this pull request
Detailed description
See issue, it's well described.
Test plan
See radareorg/radare2-testbins#49.
Closing issues
Closes #17583