Skip to content
Snippets Groups Projects
  1. Aug 28, 2017
    • Pietro Fezzardi's avatar
      Add `-no-pie` to compiler flags · 55eb769a
      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.
      55eb769a
  2. Aug 12, 2017
  3. Mar 31, 2017
    • Alessandro Di Federico's avatar
      Detect `try`/`catch` landing pads · d8f13c79
      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.
      d8f13c79
  4. Mar 29, 2017
  5. Dec 08, 2016
    • Alessandro Di Federico's avatar
      c4221f1a
    • Alessandro Di Federico's avatar
      Introduce tests for the analyses · f6b61384
      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.
      f6b61384
  6. Dec 03, 2016
    • Alessandro Di Federico's avatar
      Improve testsuite · a7f10979
      Alessandro Di Federico authored
      * Add a label for runtime and analysis tests
      * Add support for per-test custom compile flags
      a7f10979
    • Alessandro Di Federico's avatar
      Reorganize testsuite · f67f7aef
      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.
      f67f7aef
    • Alessandro Di Federico's avatar
    • Alessandro Di Federico's avatar
      Isolate ELF code and remove architecture parameter · 83ea2caa
      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.
      83ea2caa
  7. Sep 22, 2016
    • Alessandro Di Federico's avatar
      Improve installation · d4871549
      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
      d4871549
    • Alessandro Di Federico's avatar
      Make revamb portable · 59c871af
      Alessandro Di Federico authored
      Add different search paths for QEMU components, in paritcular relative
      to the program's path.
      Also, install the revamb.
      59c871af
  8. Sep 20, 2016
  9. Sep 17, 2016
  10. Aug 20, 2016
  11. Apr 14, 2016
    • Alessandro Di Federico's avatar
      `support.c`: introduce `unknownPC` plus fixes · b74f09ca
      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
      b74f09ca
  12. Jan 30, 2016
    • Alessandro Di Federico's avatar
      Let tests run from `_start` · c8274af3
      Alessandro Di Federico authored
      c8274af3
    • Alessandro Di Federico's avatar
      Prepare stack for the translated program · 32b75651
      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
      32b75651
    • Alessandro Di Federico's avatar
      71f91967
  13. Jan 12, 2016
  14. Jan 09, 2016
    • Alessandro Di Federico's avatar
      Simplify command line usage exploiting ELF info · d510fea8
      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
      d510fea8
  15. Jan 07, 2016
  16. Jan 04, 2016
  17. Dec 04, 2015
  18. Nov 15, 2015
    • Alessandro Di Federico's avatar
      Add support for indirect jumps and function calls · 1d4e3169
      Alessandro Di Federico authored
      The main aim of these changes is to support `ret` instructions (that are
      indirect jumps), so that function calls can now work properly.
      
      * Emit a dummy call to a `@newPC` function to record where a new
        instruction in the original assembly started, what is its PC and its
        size. The `Size` parameter for these function call is initially zero,
        and it's updated later when a new instruction is met or the current
        basic block is terminated. All these calls, before the final emission
        of the IR are removed `InstructionTranslator::removeNewPCMarkers`.
      * Transform translateMoveToPC into an LLVM pass
        (`TranslateDirectBranchesPass`).
      * Implement `getNextPC`, which returns the next program counter by
        looking for a call to `@newpc` in the current basic block, and,
        recursively, in all the basic blocks dominating the current one. This
        function is used to force exploration of the basic block coming after
        a direct jump, which is paritcularly useful in case of a function call.
      * Introduce `translateIndirectJumps`, which translates all the leftover
        writes to the PC, i.e. all the indirect ones, by diverting execution
        to a large switch statement mapping addresses in the original program
        to the corresponding basic blocks in the translated program.
      * Introduce `function_call`, a simple test for function calls.
      * Other minor changes and whitespace fixes.
      1d4e3169
  19. Nov 10, 2015
  20. Nov 09, 2015
  21. Nov 07, 2015
Loading