Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover High Level IR from Patchable IR #342

Draft
wants to merge 164 commits into
base: master
Choose a base branch
from
Draft

Conversation

2over12
Copy link
Collaborator

@2over12 2over12 commented Jan 12, 2023

This PR is a notional PR to track merging the patchable IR work back into anvill when we can recover the initial high level anvill representation from the patchable IR

2over12 and others added 30 commits May 10, 2023 07:35
* Performance fixes

* Begin verifying modules move the DSE pass again

* bump remill

* Fix Remill submodule

* Only verify LLVM functions and modules in debug mode

---------

Co-authored-by: 2over12 <[email protected]>
* Get Anvill building with LLVM 16

* Update scripts and CI to use LLVM 16

* Bump cxx-common versions

* Fix scripts to work with new `cxx-common`

* Put code to add SROA pass behind a helper

* Bump Remill

* Bump Remill now that LLVM 16 support has been merged into `master`

* Bump `cxx-common` to v0.3.2

* Remove LLVM 15 support
* Set metadata for live values

* Add type decoding from metadata
* add image base to spec

* add image name to spec

* add image base/name to anvill spec

* use std::uint64_t

* Use const ref where appropriate

* fix dcheck

* maintain backwards compat

---------

Co-authored-by: Alex Cameron <[email protected]>
Co-authored-by: 2over12 <[email protected]>
* Add `required_globals` to spec

* Make `required_globals` a set
* add flags to print llvm ir before/after each llvm pass

* set llvm debug flag earlier

* python script to print diff between llvm opts

* add note on usage

* add comment

* use new pass manager, otherwise debug diff won't work

* don't enable debug logging unless a debug flag is specified

* clang format
* add support for type hints after instructions

* fix annotations to use intrinsics

* remove spurious header

* remove unrequired import

* remove unused import
* implement call site override

* simplify override logic

* address c++ nits

* add missing const

* a bb context should always exist given a valid bb address
* Use UID for codeblocks

* Fix BasicBlockContext lookups

Fixes the missing literal_struct_2 issue

* Test CI

* Strong Uid typing

* Cleanup and support parsing Json spec

* Revert "Test CI"

This reverts commit 4cfe2d9.

* Remove basic block address metadata

Look up address using UID

* Fix review comments and add entry_uid to function spec

* Keep track of UID to CodeBlock mapping

Useful for getting CodeBlock function addresses without a tracked
function

* point to compatible irene

---------

Co-authored-by: 2over12 <[email protected]>
* llvm 17 fixes

* bump remill

* bump llvm, cxx common, xcode, macos, remill

* bump matrix

* bump remill, use irene main

* fix creffolder and dont run on module in inliner
* devectorize

* shift indices into second vec

* make big endian work

* add some sort of actual test

* handle access in middle

* fix dl

* dont go off end of iter

* null check on adapt

* get datalayout from arch

* bump ci

* dlog and comment
* update link to empirehacking slack (#383)

* use sparc sleigh

* update submodule

* bump remill

* bump remill

* update remill

* pass build flags to remill for debug symbols

* update remill

* add noreturn flag

* correctly handle noreturn pt1

* fix return value to also take into account noreturn

* bump remill

* bump remill

* update remill

* bump remill

* bump remill

* bump remill

* bump remill

* bump remill

* adapt type for stack offsets

* use specified register directly

* bump remill

* bump remill

---------

Co-authored-by: James Olds <[email protected]>
Co-authored-by: 2over12 <[email protected]>
The issue that this change solves can be repeated with the following program

```c
// gcc -O0 -g -gdwarf-4 self_refer.c -o self_refer

#include <stdio.h>

struct foo {
  int num;
  struct foo	*foo_next;
};

static struct foo foo0 = {
  .num = 3,
  .foo_next = &foo0
};

int main() {
  printf("Num: %d\n", foo0.foo_next->num);
}
```
* allow for manual workflow trigger

* bump lifting-tools-ci for sparc binaries + clang14

* bump for sparc
* basic pointer fix

* add binary addrs

* spurious header

* add type names

* named types

* default for null ty

* fix typedef
* bump remill and fix initial state pc

* bump remill

* don't install python3 bindings in CI

* dont set body twice if struct named twice

* completely remove python

* try to be robust to overlapping vars

---------

Co-authored-by: William Tan <[email protected]>
* return decl instead of nullptr

* return error/null instead of decl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants