airbus-seclab / bincat

Binary code static analyser, with IDA integration. Performs value and taint analysis, type reconstruction, use-after-free and double-free detection
1.68k stars 162 forks source link

ELF loader cannot load ELF binaries with relocation section not pointing to a symbol section #70

Open phil777 opened 6 years ago

phil777 commented 6 years ago

Static executable generated with gcc 7 for ARM create an ELF executable with this REL section header (note the readelf warning):

  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .note.ABI-tag     NOTE            00010114 000114 000020 00   A  0   0  4
  [ 2] .note.gnu.build-i NOTE            00010134 000134 000024 00   A  0   0  4
readelf: Warning: [ 3]: Link field (0) should index a symtab section.
  [ 3] .rel.dyn          REL             00010158 000158 000008 08   A  0   0  4

Created with

arm-linux-gnueabihf-gcc-7 -static xxx.c

Bincat will abort with

EXCEPTION: Exceptions.Error("symbol 0 of section 0 not found for reloc in section 3")