Skip to content
Permalink
Branch: develop
Commits on Feb 19, 2019
  1. Force linking of all the original libraries

    aleclearmind committed Feb 19, 2019
    Certain libraries linked to the input executable sometimes are not
    required by the executable or other dynamic libraries. Therefore, the
    `ld -l` switch ignores them.
    
    This commit forces linking of all the required libraries, no matter
    what, by wrapping the list of dynamic libraries in `-Wl,--no-as-needed`
    and `-Wl,--as-needed`.
  2. Handle libraries not ending with `.so`

    aleclearmind committed Feb 19, 2019
    Sometimes dynamic libraries linked to executables do not end in
    `.so`. Previously, we assumed that a version of the library ending in
    `.so` was available on the system. However, this is not always the
    case. In particular, Ubuntu 16.04 links `ls` to `libselinux.so.1` but no
    `libselinux.so` file is available. This can lead to a linking failure.
    
    This commit, correctly handles libraries whose name doesn't end in `.so`
    by using the `-l:` linker option (e.g., `-l:libselinux.so.1`).
Commits on Feb 18, 2019
  1. Add `lib/revng/analyses` to `RPATH`

    aleclearmind committed Feb 18, 2019
    When installing programs we used to add to `RPATH` the `../lib`
    directory. However, this is not enough, since the analysis libraries
    reside in `../lib/revng/analyses`. This commit fixes the issue.
Commits on Feb 12, 2019
  1. Use `LD_PRELOAD` instead of `opt -load`

    aleclearmind committed Feb 12, 2019
    In `opt -load`, the order in which the libraries are provided
    matters. Using `LD_PRELOAD` circumvents this issue.
  2. Force Python versions

    aleclearmind committed Feb 12, 2019
    This commit switches all scripts to Python 3, except for
    `revng-merge-dynamic` which requires Python 2 due to a limitation of
    pyelftools.
Commits on Feb 11, 2019
  1. s/revamb/revng/g

    aleclearmind committed Feb 11, 2019
Commits on Jan 18, 2019
  1. Add `opt` options to moderate runtime

    aleclearmind committed Jan 18, 2019
    Pass to the Global Value Numbering pass the `enable-pre=false` and
    `enable-load-pre=false` since they have been identified as a major
    source of slowdown with very large binaries.
  2. Enable PIC project-wide

    aleclearmind committed Jan 16, 2019
  3. Update `FunctionIsolation` to use the new FBDP

    aleclearmind committed Jan 17, 2019
    This commit updates the function isolation transformation to handle the
    metadata as provided by the new `FunctionBoundariesDetectionPass`.
  4. Introduce SA-based ABIDetection and FBD passes

    aleclearmind committed Jan 16, 2019
    This commit drops the old FunctionBoundariesDetectionPass and introduces
    a new one based on the results provided by the StackAnalysis. A very
    similar pass, the ABIDetectionPass, is now available to offer the
    results of the ABI analysis too.
    
    These two new passes are a thin shim depending on the appropriate
    version of the StackAnalysis (with or withour ABI anlysis) and simply
    call `serializeMetadata`, which decorates the LLVM IR with the requested
    information.
    
    In addition to drop the old analysis, this commit also isolates the
    function boundaries detection pass from `revamb` making it available as
    a library only.
  5. Drop `revamb-dump` in favor of plain passes

    aleclearmind committed Jan 17, 2019
    This commit does the following:
    
    * It drops `revamb-dump` and transforms all the passes it featured in
      passes that can be used directly from `opt`.
    * It rename `revamb` to `revng-lift`.
    * It introduces a script called `revng` which acts as a driver for the
      whole rev.ng project. It replaces `translate`, `revcc`,
      `csv-to-ld-options` and `revamb-dump`, since it offers an `opt`
      subcommand which allows to easily invoke all the analysis passes.
    * It makes the project a CMake package that can be easily used
      externally.
    * It allows to easily create libraries of analysis to use through
      `revng-opt`.
  6. Use stack analysis in RDA

    aleclearmind committed Dec 4, 2018
    This commit lets the reaching definitions analysis employ results from
    the stack analysis to propagate definitions across functions
    calls. Specifically, the stack analysis provides a list of registers
    that might be clobbered by the callee: definitions concerning those are
    not propagated, all the others are propagated.
    
    This change is key to detect jump tables whose address has been
    materialized *before* a function call. A test for such situation has
    been introduced.
    
    To make this work, the RDA now works over the CFG provided by the
    function identification analysis.
  7. FCI: provide a custom CFG

    aleclearmind committed Dec 4, 2018
    The `FunctionCallIdentification` analysis now provides a custom view on
    the CFG where 1) dispatcher-related basic blocks are absent, 2) nodes
    performing functions calls have an edge to their return address and 3)
    nodes ending with a return instruction have no successor.
    
    This CFG is now employed by the reaching definitions analysis and OSRA.
    
    Additionally, the implementation of the `visitSuccessors` and
    `visitPredecessors` method has been reviewed. It now consists in a class
    that needs to be inherited and for which two methods should be
    implemented, one to perform the visit of a block and another one to
    enumerate the successors.
    
    In addition, all the users of `visitSuccessors`/`visitPredecessors` have
    been updated, a simple set of tests has been introduced and
    `GeneratedCodeBasicInfo::visitPredecessors` has been dropped.
  8. Disallow `#if [01]`

    aleclearmind committed Jan 17, 2019
    Sometimes code is commented using preprocessor directives. This is fine
    for temporary testing stuffs, but it should never end up in a commit.
Commits on Jan 9, 2019
  1. `monotone-framework.py`: restore Python 3 compat

    aleclearmind committed Jan 9, 2019
    Due to a minor error, `monotone-framework.py` loss its Python 3
    compatibility. This commit fixes the situation.
Commits on Dec 17, 2018
  1. Collect simple literals (return addresses) as JTs

    aleclearmind committed Dec 13, 2018
    This commit fixes a problem that led to use SET to discover very very
    simple jump targets: the return addresses of functions call.
    
    Since in this situation, for each call, we needed to run SET, this
    commit leads to a *huge* improvements in terms of translation
    performance.
    
    This commit also enforces renaming of the translated basic blocks after
    they get split and update the ground truth for several analysis tests.
  2. Improve Reaching Definitions Analysis

    aleclearmind committed Dec 11, 2018
    The Reaching Definitions Analysis used to ignore all the memory access
    that were not relative to a CSV or an `alloca`. In certain situations,
    in particular in x86 which makes heavy use of the stack, this led to
    miss certain links that were vital for a correct identification of
    certain jump targets.
    
    As an example consider the following example:
    
        cmp    DWORD PTR [rbx+0x8],0x5
        ja     4bc5c8 <uw_update_context_1+0x148>
        mov    eax,DWORD PTR [rbx+0x8]
        movsxd rax,DWORD PTR [r12+rax*4]
        add    rax,r12
        jmp    rax
    
    The constaint on `rbx+0x8` is not propagated to the use after the jump,
    due to a missing link.
    
    This commit fixes this by tracking all the memory accesses within the
    expressive power of the `MemoryAccess` class, in particular those
    expressed as register plus offset.
    
    Additionally, this commit also makes RDA consider as reaching
    definitions for a `load` only those definitions that match exactly the
    load address, while previously we were considering all the `mayAlias`
    definitions. This situation, in combination with the previous change,
    led to have paths with multiple reaching definitions, which was
    problematic for the path sensitive merge.
    
    Finally, we consider a definition to be clobbered only if there's an
    exact store to the esame address, instead of a store on an aliasing
    address.
Commits on Dec 15, 2018
  1. Handle codeless programs

    aleclearmind committed Dec 13, 2018
    Programs without code (e.g., no executable segment) led to miss the
    `env` variable, making the `CpuLoopExitPass` fail. This commit, fixes
    the problem by simply populating the `cpu_loop_exit` function with a
    `ret`.
  2. Reduce exceptions thrown (e.g., due to tail calls)

    aleclearmind committed Dec 11, 2018
    In function isolation, every time we met a jump to an unexpected basic
    block (i.e., a basic block that is not part of the current function), we
    used to throw an exception. However this is unnecessary since oftentimes
    it is sufficient to call the `function_dispatcher` or even perform a
    regular function call.
    
    The most obvious example is the case of a direct tail call. In this
    situation performing a function call to the corresponding isolated
    function is the most appopriate thing to do.
Commits on Dec 13, 2018
  1. Being a callee is more important than being read

    aleclearmind committed Nov 27, 2018
    We used to black list memory portions target of memory read, so that
    they couldn't become function entry points. However, this led to false
    positives, in particular with functions that are explicitly called.
    
    This commit ensures that we black list those addresses only if they are
    not targets of function calls.
  2. Optimize `support.c`

    aleclearmind committed Dec 13, 2018
    We now optimize `support.c`. We didn't do that since we were optimizing
    everything after linking anyway, however, without `-O2`, functions in
    `support.c` were getting an `optnone` attribute which inhibited any
    optimization. In particular `newpc` and analogous functions were not
    inlined. Resolving this issue led to a gigantic improvement in terms of
    performance of the output program.
  3. Import `revcc`

    aleclearmind committed Aug 1, 2018
    `revcc` is a simple script that forwards its arguments to a specified
    compiler, except in the case in which the compiler is asked to link the
    final program. In such case, the compiler is invoked as appropriate, but
    the resulting binary is then translated using rev.ng and replaced by the
    translated version.
  4. Fix include paths order

    aleclearmind committed Dec 13, 2018
    We used to include `.` and `include/`, but the former is no longer
    necessary and the latter has to have the highest priority to avoid that
    installed headers take higher precedence, leading to a build employing
    outdated headers.
Older
You can’t perform that action at this time.