Commit Graph

332 Commits

Author SHA1 Message Date
Joe Hendrix
4afe6fd82e Specify function name in register use error message 2021-07-12 11:59:43 -07:00
Joe Hendrix
a50faaebd1 Move isExecutableSegOff check in discovery 2021-06-13 11:55:08 -07:00
Joe Hendrix
cda1d50b28 Expand register use error reasons.
This allows architecture-specific functions to add additional detail.
2021-06-12 12:33:42 -07:00
Joe Hendrix
ad6573556b Cleanups, formatting changes, and remove unused functionality. 2021-06-10 14:09:04 -07:00
Joe Hendrix
7729de2d2c Fix typos in error message; export ArchAddrWidth 2021-06-05 16:07:03 -07:00
Joe Hendrix
e55ebc95cd WIP. Improved error messages 2021-05-27 14:13:13 -07:00
Joe Hendrix
8216088158 Invariant inference changes.
This refactors demand analysis so we export assignment inferred values
and also no longer compute demands for assigments when inference
infers a value for them.

This exposes more information but requires changes to consumers of
information.
2021-05-24 14:03:24 -07:00
Joe Hendrix
7db9baf439 Support elf-edit changes 2021-05-07 14:18:56 -07:00
Joe Hendrix
12c3829a1e Reorganize event reporting for Reopt compatibility. 2021-04-27 23:54:11 -07:00
Joe Hendrix
e2ae54cd04 Add error messages and generalize function argument analysis. 2021-04-27 23:54:11 -07:00
Joe Hendrix
3fb39610bb Export lower level function for getting memory from elf segments. 2021-04-27 23:54:11 -07:00
Joe Hendrix
b26a4e64d8 Declare BlockInvariantMap 2021-04-27 23:54:11 -07:00
Joe Hendrix
483cc25553 Relax requirement on pointer type byte size attribute. 2021-04-27 23:54:11 -07:00
Joe Hendrix
1cb86f771c Cleanup discovery; fix macaw-symbolic 2021-04-21 11:27:27 -07:00
Joe Hendrix
1dd776b636 Introduce incremental computation monad; use in discovery. 2021-04-21 11:27:27 -07:00
Kevin Quick
05f10ed6c9
Update ElfLoader error messages to be more generic. 2021-04-05 08:45:00 -07:00
Kevin Quick
b5c5ebcf42
Comment/haddock updates in ElfLoader. 2021-04-05 08:44:59 -07:00
Joe Hendrix
7f32ea5b42 Vector operations; widthEqSym 2021-03-23 21:58:37 -07:00
Joe Hendrix
19f0e9814e Remove unused import 2021-03-23 21:58:15 -07:00
Joe Hendrix
8756d2e9d3 Minor layout changes 2021-01-29 12:01:16 -08:00
Joe Hendrix
4abbe8817f Relax constraints on stack read/write for register use. 2021-01-29 12:00:58 -08:00
Joe Hendrix
6d1e47623d Provide jumptable layout info 2021-01-27 15:27:53 -08:00
Tristan Ravitch
a84fa82d90
Export the DwarfExpr constructor (#182)
This enables client code to decode the rest of the DWARF structure (which may
produce errors that we don't want to expose in the macaw-provided API).
2020-12-10 12:55:03 -08:00
Brian Huffman
b3af7d63e9 Use OverloadedStrings for the prettyprinter Doc type. 2020-12-02 17:23:47 -08:00
Brian Huffman
2a620d41de Switch from ansi-wl-pprint to the prettyprinter package.
This patch relies on the following submodule updates:
- GaloisInc/what4#77
- GaloisInc/elf-edit#20
- GaloisInc/crucible#586
- GaloisInc/asl-translator#28

This patch updates the following packages:
- macaw-base
- macaw-symbolic
- macaw-x86
- macaw-x86-symbolic
- macaw-aarch32
- macaw-ppc
- macaw-semmc
- macaw-refinement
2020-12-02 11:38:19 -08:00
Joe Hendrix
d977d72006 Minr format change. 2020-11-12 13:59:06 -08:00
Joe Hendrix
0ec2dae8e6 Minor refactorings to clarify and simplify macaw base. 2020-11-12 12:37:30 -08:00
Joe Hendrix
d2b81d3c2f Fixes for jump table tests.
* Update macaw-x86-tests to build properly.
* Fix off by two error in memMapOverwrite
* Introduce some special handling for unsigned-extension in stack
  analysis so it knows one value is the unsigned extension of another.
* Error report formating improvements
* Slightly more precise treatment of archfn is bound updates.
2020-11-12 11:25:30 -08:00
Joe Hendrix
5aad8ca32e Upgrade to elf-edit 0.39 and other libraries. 2020-11-10 17:15:47 -08:00
Joe Hendrix
95f7fd7db7 Add limited global address checking for jump table bounds check.
This also fixes a bug in extendDyn and gets better jump table coverage.
2020-11-06 14:37:13 -08:00
Joe Hendrix
5f5de06e70 Remove unused constraint on MemAddr instance. 2020-11-06 14:37:13 -08:00
Joe Hendrix
22a9104faa Various cleanups.
Consolidate three different checks that control when to explore
a function into a single one defined in exploreFunPred.

Modify noreturn function calls to not treat the return address
as a potential function entry point.

Add basic checking of LSDA address to compare-dwarfdump.

Minor code refactoring and submodule updates.
2020-11-06 14:37:13 -08:00
Joe Hendrix
9203a37b94 Minor cleanups; dwarf updates 2020-11-06 14:35:06 -08:00
Joe Hendrix
b180145002 Generalize symbol resolver to support low-level elf-edit functions. 2020-11-06 14:29:04 -08:00
Joe Hendrix
42f7a43b32 Update dwarf parsing to increase laziness and robustness. 2020-11-06 14:27:36 -08:00
Joe Hendrix
a276dbaea4 Update to work with latest elf-edit. 2020-11-06 14:01:04 -08:00
Joe Hendrix
f2c0f00075 Allow functions to be explicitly marked as no-return. 2020-11-06 14:01:04 -08:00
Joe Hendrix
ab2bf08946 Merge subprograms with abstract origin. 2020-11-06 14:01:04 -08:00
Joe Hendrix
cbd16ed481 Update dwarf parsing to increase laziness and robustness. 2020-11-06 13:56:37 -08:00
Joe Hendrix
c9218a9284 Fix undefined MkTuple typeRepr 2020-11-06 13:48:26 -08:00
Joe Hendrix
da3d43d805 Update elf-edit; export additional capabilities for Reopt.
This adds a mechanism for filtering out function addressses.  Used by
Reopt for the PLT table.
2020-11-06 13:48:26 -08:00
Joe Hendrix
c356694627 Update to work with latest elf-edit. 2020-11-06 13:48:26 -08:00
Joe Hendrix
1510c247e3 Add MkTuple primitive. 2020-11-06 13:02:09 -08:00
Lisanna Dettwyler
47544e4b2d Fix warnings in GHC 8.10 2020-10-20 13:53:22 -07:00
Ben Selfridge
039b8497fc
updates what4, crucible, etc. (#146)
* update to bv-sized branch of what4 and other things

* removed parameterized-utils submodule completely

* Updates submodules

* Fixes macaw-symbolic w.r.t. crucible-llvm changes

Co-authored-by: Ben Selfridge <ben@000548-benselfridge.local>
2020-06-16 16:49:55 -07:00
Sam Breese
02c6cc3cb5
Handle bitwise operations on stack offset abstract values (#136)
- Generalize handling of bitwise operations to also apply them to stack offsets
- Use the extended bitwise handling on AND
2020-05-28 14:04:06 -04:00
Ben Selfridge
76868cf457
Fixed buggy rewrite rules involving testBit/shifts (#132)
* Fixed buggy rewrite rule involving testBit/shifts
2020-05-05 15:45:36 -07:00
Tristan Ravitch
e536e43f1b Introduce macaw-aarch32 and macaw-aarch32-symbolic
These packages replace the old macaw-arm (which has been removed).  The only
change to the core macaw is to introduce a `Lift` instance for the Endianness
data type, which is used in macaw-semmc.

The macaw-aarch32 package uses the official ARM semantics (via the
asl-translator package).  In its current state, macaw-aarch32 seems to handle
the common idioms of simple ARM binaries.  Position independent executables have
not been tested yet.  The semantics and disassemblers for Thumb are present, but
not integrated into code discovery at this time.  There are some tests in
macaw-aarch32.  Compile times are longer than necessarily desired.
macaw-aarch32 can be compiled in two modes: lite mode (cabal flag -fasl-lite),
which uses a restricted set of instructions for testing, and takes less time to
compile.  The full instruction set is the default, though there are a few
undefined functions that are not yet handled for the full set, mostly relating
to floating point operations.

The macaw-aarch32-symbolic package is currently a stub, but is implemented to
provide a few necessary instances.
2020-04-12 19:53:00 -07:00
Tristan Ravitch
958aeaa3ed Remove the nested mux match rule from macaw core
We can now do enough rewriting in the ARM backend that it isn't needed.  This
adds extra ARM rewriting rules and a term cache to make matching easier.
2020-04-08 19:46:32 -07:00
Daniel Matichuk
77e721ac0e add support for redundant nested muxes 2020-04-04 22:24:47 -07:00