Pietro Fezzardi c940b116a7 Use getTypeAllocSize() instead of getTypeSizeInBits()
The function `getTypeSizeInBits()` was wrongly used in many places when
reasoning about memory allocation, memory accesses, and memory offsets,
The result was often divided by 8 (possibly losing spare bits) or even
multiplied by 8, which makes no sense.
These uses were error prone, even if they didn't cause problems yet.
The `getTypeAllocSize()` is better suited for these uses, because it
returns the number of bytes necessary to allocate an object of the given
Type.
2018-05-30 12:45:45 +02:00
2015-09-26 15:17:32 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2016-12-04 00:26:10 +01:00
2016-12-04 00:26:10 +01:00
2016-12-04 00:26:10 +01:00
2017-08-12 16:56:23 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2017-08-12 16:56:22 +02:00
2016-09-21 01:45:26 +02:00
2016-09-21 01:45:26 +02:00
2017-01-11 16:02:19 +01:00
2018-05-30 12:45:45 +02:00
2016-09-21 01:45:26 +02:00
2018-05-30 12:45:45 +02:00
2017-08-12 16:56:23 +02:00
2018-05-30 12:45:45 +02:00
2018-05-30 12:45:45 +02:00
2017-03-31 10:10:16 +02:00
2017-04-03 15:57:50 +02:00

*******
Purpose
*******

`revamb` is a static binary translator. Given a input ELF binary for one of the
supported architectures (currently MIPS, ARM and x86-64) it will analyze it and
emit an equivalent LLVM IR. To do so, `revamb` employs the QEMU intermediate
representation (a series of TCG instructions) and then translates them to LLVM
IR.

************
How to build
************

`revamb` employs CMake as a build system. The build system will try to
automatically detect the QEMU installation and the GCC toolchains require to
build the test binaries.

If everything is in standard locations, you can just run::

    mkdir build/
    cd build/
    cmake ..
    make -j$(nproc)
    make install

For further build options and more advanced configurations see
docs/BuildSystem.rst (TODO: reference).

To run the test suite simply run::

    make test

***********
Example run
***********

The simplest possible example consists in the following::

    cd build
    cat > hello.c <<EOF
    #include <stdio.h>

    int main(int argc, char *argv[]) {
      printf("Hello, world!\n");
    }
    EOF
    armv7a-hardfloat-linux-uclibceabi-gcc -static hello.c -o hello.arm
    ./translate hello.arm
    # ...
    ./hello.arm.translated
    Hello, world!
S
Description
Automated archival mirror of github.com/revng/revng
Readme GPL-2.0 24 MiB
Languages
C++ 77.1%
Python 12.6%
MLIR 4.4%
CMake 1.9%
LLVM 1.4%
Other 2.5%