Commit Graph

390 Commits

Author SHA1 Message Date
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
Daniel Matichuk
5dab9c5209 Merge remote-tracking branch 'origin/master' into feature/asl 2020-04-03 23:38:19 -07:00
Ben Selfridge
8afc18dc62 feature/asl: BROKEN BUILD -- updated asl-translator, need to fix 2020-04-03 18:33:31 -07:00
Joe Hendrix
14da5837a6 Remove spurious warnings from function args. 2020-03-25 23:20:53 -07:00
Joe Hendrix
2f93b70946 Fix register-use; add null terminated string reader to Memory. 2020-03-20 18:22:48 -07:00
Tristan Ravitch
e024646860
macaw-refinement (#114)
This commit updates macaw-refinement to work with the latest macaw/crucible and makes a few improvements along the way.

The major changes involved in this are:
* Block labels were removed from macaw, so we had to come up with an alternative approach to making synthetic blocks to represent dispatch resolved by macaw-refinement that is not really a jump table. We considered adding a new terminator that encoded "computed IP-based dispatch", but there was concern about the impact on client code. Instead, we added a field to the `DiscoveryFunInfo` that records "external" resolutions to indirect control flow (e.g., as by an SMT solver in macaw-refinement). The hook by which we feed SMT-based resolutions back into macaw was modified accordingly (`addDiscoveredFunctionBlockTargets`).
* Solver invocation changed to allow solver selection and parallel solver application.
* Logging is now done via the `lumberjack` library.
* macaw-symbolic now uses the "external" resolutions in `DiscoveryFunInfo` while building crucible CFGs.
* The path creation code in macaw-refinement was simplified significantly and the approach to path creation has been documented.
* The run-refinement tool is now more featureful.
* The test suite is a bit more structured and no longer depends on the printed output of the discovery process.
2020-03-12 17:15:08 -07:00
Ben Selfridge
deb6d2b161 feature/asl: lifted endianness out of macaw-semmc TH 2020-03-09 16:07:07 -07:00
Tristan Ravitch
c825332f39
Update/ghc 8.8 (#112)
Updates for GHC 8.8

The two main classes of update are related to MonadFail and type alias expansion.

The MonadFail updates introduce explicit MonadFail instances and backward-compatible `fail` implementations under `Monad` for older GHC versions.

The type alias expansion rules changed in GHC 8.8 in a way that breaks the `Simple Lens` idiom; instead, we have to use `Lens'`.  Lens started supporting this alias in version 3.8, which was released in 2013.

This change includes necessary submodule updates, as well as the update for the split of what4 into its own repository.
2020-03-03 13:28:26 -08:00
Joe Hendrix
54a9f93431 Remove invariant type from registeruse 2020-02-07 00:19:19 -08:00
Joe Hendrix
5925c4f68f Code cleanups 2020-02-06 19:26:46 -08:00
Joe Hendrix
00303e8f40 Fix warnings; code cleanups. 2020-02-06 19:26:46 -08:00
Joe Hendrix
46be7aa52b Implement new registerUse analysis.
The new registerUse analysis uses a three phase process:

Phase 1 computes invariants about the start state of each block.  It
will indicate when registers/stack locations store stack offsets, and
where callee saved registers are stashed.  It also memoizes
information about stack reads and writes to simplify later passes.

Phase 2 is a demand analysis that computes which registers and stack
locations must be available to execute the program.  It then
propagates those constraints across blocks in the function.

Phase 3 combines the information into a form relevant for function
recovery.
2020-02-06 19:26:46 -08:00
Joe Hendrix
9433737292 Bump macaw base version 2020-02-06 19:16:23 -08:00
Joe Hendrix
0236aa5d9a Introduce separate stack-analysis algorithm. 2020-02-06 19:16:23 -08:00
Tristan Ravitch
c1d4155f3d
Merge branch 'master' into tr/block-classifier-context-type 2019-12-06 10:56:44 -08:00
Joe Hendrix
145bca4591
Add reopt dependency analysis to macaw. 2019-12-04 15:23:44 -08:00
Tristan Ravitch
5509548372 Change the BlockClassifierContext in Discovery into a datatype (from a tuple)
I'm about to add a new field, and the 7-tuple was a bit confusing.
2019-11-27 11:57:13 -08:00
Joe Hendrix
df9b5bbe27
Support for offset jump tables. 2019-11-19 14:52:58 -08:00
Tristan Ravitch
1c5abc6728 Documentation updates in macaw-base 2019-11-12 17:27:14 -08:00
Joe Hendrix
1cc36b4d0c
Propagate correct stack value after call. 2019-10-28 13:49:00 -07:00
Joe Hendrix
cf8c33398e
Additional exports; bounds pretty printing. 2019-10-28 13:47:59 -07:00
Joe Hendrix
81d0469fbe
Group mod/div x86 functions. 2019-10-21 14:59:43 -07:00
Joe Hendrix
d5a51ff9c3
Cleanups to jump bounds. 2019-10-17 23:33:57 -07:00
Joe Hendrix
26f29f3005
Generalizations to support reopt. 2019-10-16 13:57:19 -07:00
Joe Hendrix
d16f2b2ea0
Remove spurius calls to error in AbsState bvsbb. 2019-10-02 12:32:42 -07:00
Kevin Quick
4536e9d33e
[base] Fix GHC 8.4.4 haddock 2019-10-01 14:09:18 -07:00
Joe Hendrix
5e834122d1
Segment register updates; stack offset calculation. 2019-09-20 13:58:05 -07:00
Joe Hendrix
94549ef6cb
Update minor version for precondition addition. 2019-09-04 23:29:14 -07:00
Joe Hendrix
df95e65987
Various changes to support VCG.
The changes include:

  Clean up elf loading to fix a bug in rel addend parsing.

  Introduce block preconditions for populating reopt-vcg fields.

  Change load options to match reopt's interface.
2019-09-04 23:21:23 -07:00
Joe Hendrix
28e3624ca6
Bump parameterized-utils version 2019-08-30 00:02:23 -07:00
Joe Hendrix
5a8d7d5f07
Update cached fold to use CValue constructor. 2019-08-29 23:50:25 -07:00
Kevin Quick
a2af885b67
Cannot haddock tuple fields, so use pre-type haddock over entire tuple.
This is less satisfying because it separates the documentation from
the fields, but it seems to be necessary for haddock to work.
2019-08-28 10:07:13 -07:00
Kevin Quick
8f32297a35
Haddock works better with constructor pre-documentation.
I believe this is due to an ambiguity of whether the
post-documentation reference is to the previous constructor or just
the last argument of the previous constructor.  By moving the haddocks
to be a pre-doc this seems to work better.
2019-08-28 09:59:15 -07:00
Kevin Quick
bc9d5433ee
Haddock requires indentation to match the constructor argument. 2019-08-28 09:58:35 -07:00
Kevin Quick
f342c9d000
Haddock cannot document constructor fields with strictness annotations.
It also cannot handle the UNPACK pragma, which could probably be
removed since -funbox-small-strict-fields is on by default, but
haddock would still fail for the strictness annotation.

By moving the haddocks to the constructor instead of the individual
fields the strictness restriction can be avoided.
2019-08-28 09:56:01 -07:00
Joe Hendrix
433df7399e
Additional Hashable instances for Macaw/hashtable compatibility. 2019-08-27 16:40:16 -07:00
Joe Hendrix
821d434370
Add support for equalities in jump table bounds. 2019-08-27 16:39:41 -07:00
Joe Hendrix
8376ecbed6
Fix warnings. 2019-08-23 09:57:54 -07:00
Joe Hendrix
c2545b1bb1
Work-in-progres: Cleanups to discovery for jumpbounds improvements. 2019-08-23 01:11:52 -07:00
Joe Hendrix
b1c6fb8b77
Fix parameterized-utils dependency 2019-08-21 23:59:22 -07:00
Joe Hendrix
494aff6ff0
This makes a number of changes to abstract domains.
The goal is to support a jumptable testcase that is not supported by
the current jump bounds check.  The jump bounds check needs to be
augmented so that it understands equality relationships between stack
values and registers, and bounds on both.

This patch tracks when a register points to a concrete stack offset.

As part of this, we droped the AbsDomain instance for AbsBlockState.
Clients should now likely use `fnStartAbsBlockState` in lieu of `top`.

The other client visible change is that the ClassifyFailure
constructor now has an extra argument with details about why
classification failure occured.
2019-08-21 23:29:16 -07:00
Joe Hendrix
e8c4d39840
Introduce MemInt 2019-08-21 23:17:18 -07:00
Kevin Quick
84a14372cd
Fix parse error for haddock. 2019-08-12 22:11:25 -07:00
Joe Hendrix
f03fdce04b
Remove other unpack 2019-08-12 12:51:09 -07:00
Joe Hendrix
68d881c96f
Fix warnings 2019-08-12 11:44:39 -07:00
Joe Hendrix
073e774a43
Introduce CValue; clarify function arguments fields.
This introduces a new datatype CValue for representing constants
in Macaw programs, modifies the existing Value datatype to use then,
and introduces patterns for compatibility with existing datatypes.

The patch also updates the function argument analysis to use more
explicit argument passing rather than monadic updates.  The intent is
to help clarify when data is initialized rather than updated.

Finally this updates a README and does some minor updates.
2019-08-06 09:37:41 -07:00
Joe Hendrix
dfd92b047a
Add support for additional ARM relocations. 2019-08-01 09:43:36 -07:00
Joe Hendrix
a99d999fd0
Update for android compatibility 2019-07-29 11:41:50 -07:00
Joe Hendrix
bb66fd64ec
Merge branch 'master' into jhx/absstate 2019-07-12 00:31:46 +01:00
Kevin Quick
01c2d5d387
Add mhnf rewriting.
The parseFetchAndExecute in Discovery attempts to identify ParsedITE
terminal statements by examining the value of the ip_reg via
valueAsApp and pattern matching on a Mux statement.  This patch adds
specific handling in the Macaw CFG Rewriter to attempt to float Mux
statements upwards (aka "Mux Head Normal Form") so that they will be
the top-most ip_reg value and therefore be recognized as a ParsedITE
terminator.

For macaw-ppc testing of the 988KB gzip binary, this increased the
number of blocks found from 1339 to 37950 (and increased the test
runtime from 1.36s to 88.14s).
2019-07-10 23:59:11 -07:00
Joe Hendrix
a7a145be77
Fix compilation bugs in bcinc. 2019-07-03 13:50:01 -07:00
Joe Hendrix
b604cb28f1
Merge remote-tracking branch 'origin/master' into jhx/absstate 2019-07-03 13:24:46 -07:00
Joe Hendrix
52cf172c69
Minor layout/clarity updates. 2019-07-03 13:22:40 -07:00
Kevin Quick
1d03a7b3b6
[base] update ParsedIte/ParsedBranch reference in comment. 2019-07-02 11:09:16 -07:00
Joe Hendrix
f2249ffc23
Bump macaw-base version for export 2019-07-01 16:47:46 -07:00
Joe Hendrix
17c09c974f
Bump submodules; clarify stack offset abstract values 2019-07-01 16:35:47 -07:00
Joe Hendrix
cbb3814017
Fix warnings. 2019-06-13 09:33:58 -07:00
Joe Hendrix
c4870f9a37
Merge remote-tracking branch 'origin/master' into jhx/funargs 2019-06-12 15:51:55 -07:00
Joe Hendrix
dba7a2e88d
Bump submodules; version dependencies 2019-06-12 15:49:05 -07:00
Joe Hendrix
ee6f1379ae
Additional cleanup to function args; bump versions.
This also provides some exports needed by Reopt.
2019-06-12 15:26:19 -07:00
Kevin Quick
7bacee3e9d
[base] fix haddock syntax error. 2019-06-05 14:40:59 -07:00
Joe Hendrix
d3c23cbe55
Remove CPP extension 2019-06-05 15:55:29 -04:00
Joe Hendrix
ee137cccc4
Cleanup warnings. 2019-06-05 15:31:03 -04:00
Joe Hendrix
4368ed6239
Fix parameterized-utils and bump version. 2019-06-05 09:50:12 -04:00
Joe Hendrix
c3f747aa86
Update dependencies/minor corrections. 2019-06-05 09:02:25 -04:00
Joe Hendrix
d58292feda
Generalize function argument analysis.
This patch focuses on function argument analysis, but includes some
other cleanups.

The main changes are to add additional comments and cleanups to the
function argument analysis code.  This also extends the analysis so
that we can annotate the types of some of the functions and use those
types during analysis.

As part of this we tighten the PLTStub checking, and clean up the
elfloader in some minor ways.
2019-06-05 04:42:02 -04:00
Joe Hendrix
5c097b45b7
Continue exporting width equality proofs comparison/equality. 2019-05-30 22:54:49 -07:00
Joe Hendrix
5221880b10
This makes a few minor changes primarily for reopt.
WidthEqProofs are now irrelevant.  Two proofs with the same
coercision source and destination will be equal.  This allows us to
add a transitivity constructor without introducing spurious
inequalities, and will in the future allow us to collapse multiple
bitcasts into a single bitcast.

adjustedLoadRegionIndex is exported for reopt.

TypeRepr now has a pretty instance.
2019-05-30 10:31:45 -07:00
Joe Hendrix
f0f5d0e123
Improve jump table bounds accuracy.
This adds functionality to the jump table bounds to work with trunc
that was deliberately removed in the last patch due to buggy code.
2019-05-14 21:03:08 -07:00
Joe Hendrix
0b7dae7add
Merge remote-tracking branch 'origin/jhx/no-branch' into jhx/no-branch 2019-05-14 17:48:37 -07:00
Joe Hendrix
1607e83eef
Minor refactoring; improved branch abstract state propagation.
This primarily refines the abstract state propagated to branch
pairs.  It was needed on the ARM platform to support the IT blocks
with the changes to the Core representation in macaw-base 0.3.6.

This also includes a few simplifications added and comment
improvements.
2019-05-14 17:45:30 -07:00
Joe Hendrix
6299fa489b
Fix bug in AbsState.trunc 2019-05-11 16:29:54 -07:00
Joe Hendrix
ca2ca7d130
Merge remote-tracking branch 'origin/master' into jhx/no-branch 2019-05-06 10:54:35 -07:00
Joe Hendrix
56cadae3ae
Update submodules 2019-05-02 14:29:10 -07:00
Joe Hendrix
d20a3a9820
Update elf loader to use dynamic symbol table. 2019-05-02 12:36:43 -07:00
Joe Hendrix
008a53f3db
Add parsedTermSucc 2019-04-30 13:09:39 -07:00
Joe Hendrix
c6a7ba7cd6
Rename pblock fields to be more descriptive. 2019-04-29 22:21:10 -07:00
Joe Hendrix
581a01b5ef
Delete BlockLabel now that it is unused. 2019-04-29 21:57:41 -07:00
Joe Hendrix
70ea5b9036
Remove ParsedIte 2019-04-29 20:46:54 -07:00
Joe Hendrix
8aa4650683
Introduce ParsedBranch constructor. 2019-04-29 10:49:00 -07:00
Joe Hendrix
3331a19571
Drop support for branches within blocks. 2019-04-28 13:19:20 -07:00
Joe Hendrix
89f89e9ce6
This adds a conditional memory write to macaw. 2019-04-17 11:15:12 -07:00
Joe Hendrix
4513a92848
Update comments. 2019-04-08 16:31:28 -07:00
Joe Hendrix
62d27d629d
Update to latest elf-edit; bump other submodules. 2019-04-08 16:21:08 -07:00
Joe Hendrix
82b96fb62a
Fix warnings; improve PLTStub comment. 2019-03-25 19:27:46 -07:00
Joe Hendrix
f1f16b7509
Remove warnings 2019-03-22 14:40:14 -07:00
Joe Hendrix
51333f4612
Deprecate outdated disassemble block functions. 2019-03-14 10:41:11 -07:00
Daniel Wagner
b6778a80c1 comparisons with max or min values are easy 2019-03-04 14:38:31 -05:00
Joe Hendrix
e8d2efcaae
Implement bitcast changes to macaw-symbolic 2019-02-26 17:53:34 -08:00
Joe Hendrix
00096344a7
Support float/vector in reads/writes; Use floating point types. 2019-02-20 15:40:59 -08:00
Joe Hendrix
35af2a5c3a
Rename VectorTypeRepr to VecTypeRepr 2019-02-19 10:18:12 -08:00
Joe Hendrix
3b7e12de16
Update to fix build process. 2019-02-15 00:28:35 -08:00
Joe Hendrix
d3947f32b4
Support ZMM, bitcasting, and fixed length vectors. 2019-02-14 11:06:45 -08:00
Luke Maurer
97a6a43c5b Fix for GHC versions < 8.4 2019-02-13 13:42:43 -08:00
Langston Barrett
274808a8ae update parameterized-utils submodule 2019-02-11 11:47:19 -08:00
Kevin Quick
35a16c587b
Merge branch 'master' of github.com:GaloisInc/macaw 2019-02-07 16:36:54 -08:00
Kevin Quick
36a8be1c4e
Merge branch 'refinement' of github.com:GaloisInc/macaw into refinement 2019-02-06 17:51:21 -08:00
Kevin Quick
5136973565
[base] remove unneeded import. 2019-02-06 17:44:46 -08:00
Kevin Quick
166af1bd20
[base] documentation updates. 2019-02-06 17:43:56 -08:00
Kevin Quick
03e48c7baf
[base] Add external TermStmt Rewriter capability.
The caller (e.g. macaw-refinement) can provide an additional Rewriter
operation that can operate on TermStmts for blocks (typically those
for which a previous Discovery was unable to determine a transfer
target).  There is an additional
entrypoint ('addDiscoveredFunctionBlockTargets') that will allow this
additional rewriter to be supplied for updating an existing
DiscoveryState.
2019-02-06 17:41:40 -08:00
Kevin Quick
a4e1a58a98
[base] code simplification and removal of widely scoped variable. 2019-02-06 17:38:58 -08:00
Kevin Quick
83a1b2fb4c
[base] Allow the Rewriter to generate additional blocks.
Some of the TermStmt and other elements might generate new blocks as
part of the Rewrite operation (e.g. adding a new 'Branch' TermStmt) so
this change allows the rewrite context to update the generated block
labels and collect these newly generated blocks for inclusing in the
results passed to the parser.
2019-02-06 17:36:04 -08:00
Kevin Quick
7ead2c0247
[refinement] Use BlockLabel and StatementLabel type aliases.
Both map to Word64 but the named aliases clarify which is intended to
be used where.
2019-02-06 14:42:11 -08:00
Kevin Quick
d9ee884a90
Documentation/comment fixes. 2019-02-03 10:57:01 -08:00
Luke Maurer
bc5442a223 Force entire statement list when filtering it
Keeping it lazy meant that the entire list would stick around in memory
for a while; now the statements that aren't kept are garbage-collected.
2019-01-28 14:47:06 -08:00
Joe Hendrix
6d1cc603d0
Merge remote-tracking branch 'public/jhx/minor-additions' into jhx/block-addr-removal
Also fixes some warnings.
2019-01-22 11:32:00 -05:00
Joe Hendrix
23186a4991
Minor comments; fix stack.yaml 2019-01-22 05:36:17 -05:00
Joe Hendrix
0eac4d6b49
Remove blockAddr; update dependencies 2019-01-22 05:07:52 -05:00
Tristan Ravitch
68c5578f03 symbolic: Translate the InstructionStart metadata statement into Crucible
Before, we just discarded them during the translation.  They are useful metadata
for generating diagnostics in Crucible, so this commit translates them.  They
are no-ops during symbolic evaluation.

To make them truly useful, they need to include the address of the block that
they belong to (their data payload in macaw is just an offset from the start of
a block).  This information wasn't available before, so it has to be plumbed
through in macaw-x86.
2019-01-10 22:23:39 -08:00
Kevin Quick
98807daee2
Added -Wcompat for warnings about future compatibility. 2019-01-10 13:43:27 -08:00
Kevin Quick
16a867efd2
Haddock and README fixes. 2019-01-08 16:38:38 -08:00
Luke Maurer
b93302a536 Cache map with arch registers as keys
The use of `Data.Parameterized.Map.fromList` in `mkRegStateM` was
showing up in profiling as a huge time sink.  We don't actually need to
build the map from scratch there, though, since the keys are known ahead
of time.  Adding an `archRegSet` variable to the `RegisterInfo` class
(with the obvious default implementation) ensures that a `MapF` with the
right keys will be built once and then reused.
2018-12-27 11:32:56 -08:00
Luke Maurer
64a1c01a7b Use RULE to optimize uses of boundValue as getter
GHC was leaving `boundValue` in its higher-order form, which was causing
slowdowns accounting for ~3% of runtime in Brittle.
2018-12-27 11:32:46 -08:00
Andrei Stefanescu
76ac547995 Merge branch 'master' of github.com:GaloisInc/macaw into fix/keep-return-address-stack-write 2018-12-18 14:31:08 -08:00
Tristan Ravitch
96129be6de Keep the write of the return address to the stack (x86)
This mostly affects x86.  Previously, we threw away the write of the return
address to the stack when identifying calls for macaw-x86.  This was partly for
hygiene and partly to support the "addresses written to memory are function
pointers" heuristic.  Treating the return address as a potential function
pointer breaks function identification, so that is important.

The problem comes in the translation of macaw into crucible - we never write the
return address to the stack, but returns still read the return address from the
stack.  If it wasn't written in the first place, this leads to a read
from (potentially) uninitialized memory, which causes errors in the symbolic
simulator.  There are two solutions:

1. Make returns not read from the stack
2. Keep the write of the return address to the stack

Solution 1 is a problem, as we have a data dependency on the read.  Eliding it
breaks Crucible generation later and produces an invalid CFG.

Solution 2 works well.  The implementation is actually simple.  We can keep
identifyCall the same for x86 and just construct the basic block not from the
return value but from the original list of statements (unaltered).  We do need
to have identifyCall still give us the reduced statement list, which we use for
identifying possible function pointers written onto the stack (but not the
return address, which we do not want to treat as a function pointer).
2018-12-07 15:11:39 -08:00
Brian Huffman
3fc657782d Add Semigroup instance to make GHC 8.4 happy. 2018-12-07 13:48:38 -08:00
Joe Hendrix
3dd2f15dd6
Add mapsRegsWith; 8.6 compatibility. 2018-12-04 13:41:07 -08:00
Joe Hendrix
25e922ef83
Fix previous commit 2018-12-04 09:02:27 -08:00
Joe Hendrix
ebc5d9575e
Merge remote-tracking branch 'public/master' into jhx/plt-support 2018-12-04 08:04:32 -08:00
Joe Hendrix
f03941d607
Add test-plt test case, and fix discovery to use trust symbols. 2018-12-04 00:04:23 -08:00
Joe Hendrix
a0a89083e8
Support X86 Relative; other minor changes. 2018-12-03 20:52:44 -08:00
Kevin Quick
7a64cb614f
Explicit NoStarIsType with Data.Kind.Type and increasing do indentation (for GHC 8.6) 2018-11-20 09:43:48 +00:00
Joe Hendrix
c4b7252c77
Add specialized terminal statement for PLT stubs. 2018-11-16 13:40:40 -05:00
Joe Hendrix
bb63f9f859
This fixes tail call detection, and allows architecture-specific checks. 2018-11-12 11:56:44 -05:00
Kevin Quick
8e55f1644f
[base] Remove obsolete/unused GaloisDwarf.hs file. 2018-11-02 15:56:20 -07:00
Joe Hendrix
8ce9d06d27
Fix handling for non-position independent, but dynamically linked executables. 2018-10-25 13:49:21 -07:00
Joe Hendrix
2e93d42893
Merge remote-tracking branch 'public/master' 2018-10-22 13:04:30 -07:00
Kevin Quick
46a2c1c72a
Minor spelling fix in Types haddock docs. 2018-10-18 22:31:13 -07:00
Joe Hendrix
3948314813
Export AddrSymMap 2018-10-18 12:59:53 -07:00
Joe Hendrix
c886c19b03
Rename Memory exports.
This update renames many of the declarations exported by
Data.Macaw.Memory so that we have more consistent names.

The majority of the existing names are now exported with DEPRECATION
warnings.  Some of the symbol declarations that were not used by the
Memory datatype have been moved to other modules.

The minor version of macaw-base has been incremented.
2018-10-18 10:07:20 -07:00
Luke Maurer
8b0c58c661 Make architecture type families injective
This should cut down on the number of proxies/explicit type arguments
needed when dealing with these types.

Awkwardly, ArchTermStmt isn't injective, because PPC32 and PPC64 happen
to use exactly the same type. We could add an argument to that type and
then all the families could be injective.
2018-10-12 15:23:13 -07:00
Andrei Stefanescu
9c64a192d2 Evaluate PopCount and Bsr with concrete arguments. 2018-09-27 23:23:25 -07:00
Joey Dodds
1d3ce2ce77 add back import 2018-09-27 16:48:05 -07:00
Joey Dodds
d681046ddd removed an extra space 2018-09-27 16:15:18 -07:00
Joey Dodds
4f1f8656dd Merge branch 'master' of https://github.com/GaloisInc/macaw into HEAD 2018-09-27 15:39:01 -07:00
Joey Dodds
82b60bc315 add memory command to return all symbols as opposed to just function symbols 2018-09-27 15:18:15 -07:00
Daniel Wagner
d3f19048ce don't double-offset in pretty-printer
The pretty-printer for Stmts takes a pretty-printer function as an
argument. This used when a Stmt stores an offset from the beginning of a
block can, but we don't have information about that block internally in
the Stmt.

An ArchState Stmt stores an ArchMemAddr, which is independent of the
block it's in. Previously we were treating the ArchMemAddr as an offset
and passing it to the pretty-printer function for offsets; in practice
this means most of them were printed as values about twice as big as
they were supposed to be.
2018-09-26 16:29:26 -04:00
Joe Hendrix
96bd9bee1a
Fix off-by-one bug in applying relocations. 2018-09-17 16:20:51 -07:00
Joe Hendrix
73d24d42f9
Bump elf-edit compat 2018-09-17 15:32:18 -07:00
Joe Hendrix
c3dcfd7e3f
Update ElfLoader to apply PLT relocations. 2018-09-17 15:28:13 -07:00
Joe Hendrix
491f40caf1
Add support for R_ARM_GLOB_DAT. 2018-09-11 00:26:23 -07:00
Joe Hendrix
e180b996ce
Merge branch 'master' of github.com:GaloisInc/macaw 2018-09-10 15:34:14 -07:00
Joe Hendrix
4104191b54
Fix relocation handling; update for elf-edit/binary-symbols changes. 2018-09-10 15:33:35 -07:00