rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.7k stars 361 forks source link

Split off Relocs Code from bin_elf.inc #1141

Open thestr4ng3r opened 3 years ago

thestr4ng3r commented 3 years ago

From https://github.com/rizinorg/rizin/pull/1079#discussion_r632270049

Conceptually librz/bin/p/bin_elf.inc should implement the side towards the RzBin plugin interface, while standalong ELF parsing should mostly be in librz/bin/format/elf instead. Relocs handling and patching is quite a chunk of code and it is currently implemented in librz/bin/p/bin_elf.inc, but a lot of it falls more in the category of ELF parsing so it would fit better in librz/bin/format/elf, in a new file elf_reloc.c. What is a bit tricky here is that reloc patching somewhat depends on the generated final maps to know where to point relocs to (reloc_targets_map_base()).

XVilka commented 3 years ago

There are hundreds of the relocations missing as well, we should add all supported by the Binutils.