- May 29, 2018
-
-
Alessandro Di Federico authored
This test will be useful to test that calls to external libraries using float arguments work as appropriate.
-
Alessandro Di Federico authored
-
- Apr 22, 2018
-
-
Andrea Gussoni authored
This commit introduces the Function Isolation Pass. We use the information provided by the Function Boundaries Detection Pass to organize the code that `revamb` places inside the `root` function in different LLVM functions. To do this we obviously need to introduce some changes and tricks to handle the execution of the translated program. The main idea is to have two different realms (one where the isolated functions live, one in which we have basically the old root function). We start the execution from the realm of the *non isolated* functions, and we transfer, as soon as possible, the execution to the *isolated functions* realm. We then have a fallback mechanism to restore the execution in the right place in the *non isolated* functions realm, and so on. The largest change, besides the re-organization of the code in different functions, is the use of the exception handling mechanism provided by the LLVM framework in order to be able to manage the switch between the two realms. We also introduce the `support.h` header file, which contains a couple of definitions used by `support.c` and that need to be shared with some of the components involved in the translation process. We have defined some helper functions, directly in C, that we use both for handling the exception mechanism and for giving extra debug informations when an exception is raised. The `revamb-dump` utility now supports the `-i` option to specify the path were to save the new LLVM module. The `translate` utility now supports the `-i` option that produces a binary in which the function isolation has been applied. We also introduced some tests that apply the function isolation pass to the `Runtime/` tests already present. In this way we can verify that the translation and the following function isolation preserve the behavior of the program. When serializing the new LLVM module we regenerate the metadata used for debug purposes, and for doing this, since we not longer have only the `root` function, we have changed some details in the `DebugHelper` class in order to be able to emit the metadata for all the functions of our interest in a single shot.
-
- Jan 28, 2018
-
-
Alessandro Di Federico authored
-
Thorbjörn Schulz authored
Added the necessary information for i386 support and a call to a helper function initializing the global descriptor table at runtime.
-
- Jan 17, 2018
-
-
Andrea Gussoni authored
The check to see if a compiler supports the `no-pie` flag was done only for the main C compiler, and not for the cross-compilers used for creating the executables for the different supported architectures. This commit introduces the aforementioned missing checks. In addition instead of hard-coding the flags to check in the CMakeLists file we have a list that we pass each time we instantiate a project for the cross-compilers, and we check for the availability of all the flags. In order to do this we need to apply a sort of serialization and deserialization to avoid the "unpack" of the list passed as argument to the external project (that is implemented as a `;` separated string). Also implemented a fix suggested in the merge request for a line that mistakenly added the `TEST_CFLAGS` variable to the `NO_PIE` variable.
-
- Oct 28, 2017
-
-
Alessandro Di Federico authored
A previous commit introduced `-no-pie` to disable PIE in GCC versions higher than 5.2. However, earlier versions don't support such an option. This commit introduces the necessary detection mechanism to enable it or not.
-
- Aug 28, 2017
-
-
Pietro Fezzardi authored
Add this flag to the flags used for Runtime tests and to the flags used in the translate script. Recent GCC versions (`gcc-7` and later) enable PIE by default, and `-fno-pie` apparently is not enough to disable it.
-
- Aug 12, 2017
-
-
Alessandro Di Federico authored
The stack analysis is the foundation to obtain accurate information about the body of a function, which registers are callee-saved, arguments, return values and so on. It is implemented as a pass to run in revamb-dump. This commit also introduces analysis tests specific to what we aim to obtain from the analysis and also some basic unit tests for data structures related to the stack analysis.
-
Alessandro Di Federico authored
This commit introduces the unit test infrastructure, and a first unit test suite for `LazySmallBitVector`.
-
Alessandro Di Federico authored
-
- Mar 31, 2017
-
-
Alessandro Di Federico authored
Landing pads are basically the `catch` blocks in C++ `try`/`catch` statements. So far we were missing them since they are encoded in a particular way in a way similar to DWARF debugging information in the `.eh_frame` and, more specifically, in the `.gcc_except_table` sections of ELF programs. This commit parses these sections so that the basic blocks associated to landing pads are correctly identified. Personality functions are detected too. A test is also introduced to assess the effectiveness of our code.
-
- Mar 29, 2017
-
-
Alessandro Di Federico authored
Since we now support disjoint ranges in ORSA, let's test it. This commit also introduces some license disclaimers in tests assembly files.
-
- Dec 08, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
So far we only had end-to-end functionality testing. This commit introduces a new part of the testsuite which allows to verify quickly if the results that a certain analysis should give are changed or not. This is vital to be able to make larger changes. So far the test suite is composed by the most difficult case we support (the uClibc ARM memset) and the typical lowering of switch statements for ARM, MIPS and x86-64. I'm so happy now.
-
- Dec 03, 2016
-
-
Alessandro Di Federico authored
* Add a label for runtime and analysis tests * Add support for per-test custom compile flags
-
Alessandro Di Federico authored
So far the only tests we had were end to end tests to assess the functionality of simple programs and, in particular, certain helper functions. In the perspective of being able to test individual features, and in particular check that we have no regressions in our analyses, we isolated these end to end tests in the Runtime directory. We kept in the root test directory the mechanism to compile a binary for a certain architecture so that all the test types can use it.
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
This commit removes all the ELF-specific code from the `CodeGenerator` class by creating a new class, `BinaryFile` which contains all the information about the program that might be needed in an image format independent way. However, `BinaryFile` has some fields which are specific to ELF, we might want to address this when additional file formats are supported. A key benefit of isolating this code is that we can anticipate the parsing of the input file, so that we have its architecture available earlier than when `CodeGenerator` is instantiated, therefore we can drop the `--architecture` parameter.
-
- Sep 22, 2016
-
-
Alessandro Di Federico authored
* Use "$ORIGIN/../lib/" as RPATH when linking the installed binary * Install also support material such as "support.c" * Import the `translate` script for easy end-to-end translation
-
Alessandro Di Federico authored
Add different search paths for QEMU components, in paritcular relative to the program's path. Also, install the revamb.
-
- Sep 20, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
The `path` function allows support.c to decide how to modify the path opened by the translated program.
-
Alessandro Di Federico authored
* Disable PIE if enabled by default * Link librt.so to compiled binaries (sometimes the QEMU runtime needs it) * Replace `strtonum` with `int` in `awk` script * Specify the compiler, not the triple
-
Alessandro Di Federico authored
Check in PATH if there's a compiler compatible with the supported ones (i.e., using uclibc or musl) and use that triple.
-
- Sep 17, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
- Aug 20, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
- Apr 14, 2016
-
-
Alessandro Di Federico authored
`unknownPC` is an extern function we expect to be linked to the output which is called when we have to crash due to an unexpected jump target. * Remove unused references to register variables, now only need the stack pointer * Fix bug in how the auxiliary values were pushed on the stack. * Push 0 HW_CAPs * Implement some glib's functions
-
- Jan 30, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
* Create 3 constant global variables (`phdr_address`, `e_phentsize` and `e_phnum`) in the IR which will be used to populate the auxiliary vectors at run-time. * Update compile options for `support.c` to ignore useless warnings and enable debug information * Implement in `support.c` some functions required by QEMU run-time and other cleanups to make it compatible with programs translated from `_start`, not `root` * Implement in `support.c` the `prepare_stack` function, which initializes the base of the stack with environment variables, arguments and auxiliary vectors * Improve syscall support
-
Alessandro Di Federico authored
-
- Jan 12, 2016
-
-
Alessandro Di Federico authored
-
Alessandro Di Federico authored
-
- Jan 09, 2016
-
-
Alessandro Di Federico authored
* s/`importGlobalData`/`parseELF`/ * Save the entry point specified in the ELF header, which will be used if the user doesn't provide an address. * Let parse `parseELF` take care of informing libtinycode about what has to be mmap'd and where. * Remove some support scripts used during testing, now no longer necessary. * Various cleanups
-