macaw/x86_symbolic/tests/pass
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
..
so Add basic support for simulating PLT stubs and shared libraries 2023-02-23 17:16:12 -05:00
bitscan.c x86: Fix semantics for BSF and BSR instructions (#216) 2021-07-13 14:14:59 -04:00
bitscan.opt.exe x86: Fix semantics for BSF and BSR instructions (#216) 2021-07-13 14:14:59 -04:00
bitscan.unopt.exe x86: Fix semantics for BSF and BSR instructions (#216) 2021-07-13 14:14:59 -04:00
identity.c Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
identity.opt.exe Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
identity.unopt.exe Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
Makefile Add basic support for simulating PLT stubs and shared libraries 2023-02-23 17:16:12 -05:00
saturate-add.c Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
saturate-add.opt.exe Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
saturate-add.unopt.exe Add a testing framework for macaw-symbolic (#184) 2021-03-01 09:21:44 -08:00
T237.c macaw-x86: Handle sign-extended immediates in def_push 2021-10-12 16:37:21 -04:00
T237.opt.exe macaw-x86: Handle sign-extended immediates in def_push 2021-10-12 16:37:21 -04:00
T237.unopt.exe macaw-x86: Handle sign-extended immediates in def_push 2021-10-12 16:37:21 -04:00