Open alessandrocarminati opened 1 year ago
It is very likely to be a relocation issue, unfortunately they are not consistently handled yet. We already looked briefly at these kind of issues and we should definitely work on them at some point, as they produce a few issues.
Thanks for filing this issue! I'll try to have a better look and maybe work on a solution in next days.
rizin -v
full output, not truncated (mandatory)Expected behavior
Don't blame me, I'm not even sure this is a bug. Surely it is something I expected and that I can not see on rizin. To be fair, I had the same issue with radare2, where I opened a bug (https://github.com/radareorg/radare2/issues/21117). Let me summarize my issue: I'm automating a few static analysis tasks by using the pipe. In this particular analysis I'm doing, I face against an unusual case, where a function is both implemented and requested externally. The case is
malloc
in glibc. You can find it both implemented and where is needed it is invoked through the PLT as if it was an external dependency. This behavior is wanted since the library allows themalloc
functions to be replaced with another allocator. Saying that, my problem: When rizin prints the disassembly of a calling function, I expected to find something likesym.imp.malloc
, instead I have something likefcn.00026ee0
. Looking inside the trampoline function, I can see in a comment that the emulation found it to bemalloc
(it writes this info in a comment), but since I'm automating the process it is far less usable. In the radare issue I saw that the PLT is not properly tagged, but rizin I didn't notice the same. That's why I less confident this is an issue. Still, this behavior of renaming the trampoline function with something containing the target name, is so diffused that also the plain binutilsobjdump
has it.Actual behavior
what I got from rizin is:
Notes
Saying that, I'm seeing unresolved "PLT" issues in both radare and rizin, I wonder if the problem I believe to see is related.
Anyhow, I do really like to have a comment on this issue.
I attach the glibc file libc.so.6.gz I tested, but I believe this behavior to be visible with any glibc file, also in more common architectures like the x86_64.