macaw/x86
Ryan Scott 97c61e471a Add basic support for simulating PLT stubs and shared libraries
This extends `Data.Macaw.Symbolic.Testing` in `macaw-symbolic` to be able to
handle binaries that depend on shared libraries. This is fully functional for
the x86-64 and AArch32 symbolic backends, and I have added test cases to the
respective repos demonstrating that it works. (The PowerPC backend is not yet
supported. At a minimum, this is blocked on GaloisInc/elf-edit#35.)

To implement this, I also needed to add some additional infrastructure to
`macaw-base` (I put this infrastructure here as it doesn't depend on any
Crucible-specific functionality):

* `Data.Macaw.Memory.ElfLoader.DynamicDependencies`: a basic ELF dynamic
  loader that performs a breadth-first search over all `DT_NEEDED` entries
  that an ELF binary depends on (both directly and indirectly).
* `Data.Macaw.Memory.ElfLoader.PLTStubs`: a collection of heuristics for
  detecting the addresses of PLT stubs in a dynamically linked binary.

It is worth noting that shared libraries are rife with nuance and subtlety,
and the way `macaw` models shared libraries is not 100% accurate. I have
written a length `Note [Shared libraries]` in `Data.Macaw.Symbolic.Testing`
to describe where corners had to be cut.

Fixes #318.
2023-02-23 17:16:12 -05:00
..
src/Data/Macaw Add basic support for simulating PLT stubs and shared libraries 2023-02-23 17:16:12 -05:00
support Add x86-support to travis 2019-03-26 08:21:01 -07:00
tests Revisit handling of tail calls 2022-06-27 15:02:43 -07:00
x86_tests Segment register updates; stack offset calculation. 2019-09-20 13:58:05 -07:00
.gitignore Add x86 specific code. 2017-09-27 15:54:43 -07:00
LICENSE Update license information. 2017-09-27 15:59:06 -07:00
macaw-x86.cabal Add basic support for simulating PLT stubs and shared libraries 2023-02-23 17:16:12 -05:00