rizin/shlr/java
Riccardo Schirone 2df06bd870 Fix ELF issue with null SHT entries (#10449)
* format/elf: extract function to avoid duplicated code
* format/elf: use ut64 to avoid errors in ELF32

Otherwise, while analyzing ELF32, -1 will be interpreted as the unsigned
value 0xffffffff, which is very different from -1 (0xffffffffffffffff).

* format/elf: fix symbols with shndx == SHT_NULL

Symbols with shndx == SHT_NULL should not be listed as symbols but they
should be available when other ELF structures (imports, relocs, etc.)
reference them.

This patch adds those symbols in the symbols_by_ord table but not to the
list of available symbols. Imports/relocs/etc. work by indexing symbols
by symbol index, so they are going to use the symbols_by_ord table and
make everything work.

Moreover, it refactors a bit the relocs function to avoid duplicated
code.

* bin: setimportd/setsymbold should clone the import/symbol
* bin/bin.c: free fields only when sym is not NULL
* format/elf: do not filter out symbols with size == 0 and consider sht_null symbols in shdr too.
* bin/bin.c: create R_STR_DUP macro and use it in _clone functions
* format/elf: when parsing symbols from phdr, stop at first UNK type/bind
* create some R_BIN defines to handle strings related to TYPE and BIND
  in RBinSymbols
* format/elf: add a doc
2018-06-26 13:48:53 +02:00
..
class.c Fix ELF issue with null SHT entries (#10449) 2018-06-26 13:48:53 +02:00
class.h Meson: enable Propeller and Java (#9639) 2018-03-09 20:05:47 +08:00
code.c Fix typo regarding byte size (#9067) 2017-12-27 18:33:58 +01:00
code.h
deps.mk
dsojson.c Meson: some cleanup (#10076) 2018-05-16 10:24:35 +02:00
dsojson.h Meson: some cleanup (#10076) 2018-05-16 10:24:35 +02:00
main.c
Makefile
ops.c