Redesign data structures, make basic reladd work. newparser
authornorly <ny-git@enpas.org>
Thu, 30 May 2013 03:01:51 +0000 (04:01 +0100)
committernorly <ny-git@enpas.org>
Thu, 30 May 2013 03:36:39 +0000 (04:36 +0100)
commit4addee4bda6064926b24cd1ae929303003bd9ff1
tree10bad1be5ff2f71981fe87e1c43e171e94dacc8a
parenteb5a1daba781013ccf168b95510d0f67f0b9c946
Redesign data structures, make basic reladd work.

The memory ELF model is now a tree structure:
  ELF +--> PHDRs +--> PHDR +--> Section
      |          |         +--> Section
      |          |         ...
      |          |         \--> Section
      |          |
      |          +--> PHDR +--> Section
      |          |         ...
      |          ...
      |
      \--> Orphaned sections +--> Section
                             ...
                             \--> Section

This effectively introduces semantics into the binary blob we are
editing, and allows us to re-layout its contents much more easily
while keeping as close as possible to what is assumed to be the
original semantics.

As a side-effect, a first meta-function had to be introduced
(elfu_mScnForall) in order to traverse all leaves of the tree.
Much old code has been removed given the leaner environment
available now, and automated insertion of .text and .data sections
from object files into executables now works. However nothing else
is inserted (such as string tables or .bss) and no relocation takes
place yet.
21 files changed:
include/libelfu/generic.h
include/libelfu/libelfu.h
include/libelfu/modelops.h
include/libelfu/modeltypes.h [deleted file]
include/libelfu/types.h
src/main.c
src/model/check.c
src/model/clone.c
src/model/count.c [deleted file]
src/model/dump.c
src/model/expandNobits.c [deleted file]
src/model/fromFile.c
src/model/insert.c [deleted file]
src/model/phdr.c [new file with mode: 0644]
src/model/reladd.c
src/model/section-by-type.c [deleted file]
src/model/section-in-segment.c [deleted file]
src/model/section-name.c [deleted file]
src/model/section.c [new file with mode: 0644]
src/model/toFile.c
src/options.c