Commit Graph

37 Commits

Author SHA1 Message Date
Alessandro Di Federico 27b58695a1 Let FunctionIsolation and EnforceABI use the Model 2021-02-19 09:39:49 +01:00
Alessandro Di Federico 3f0e715b98 Decrease verbosity of tests 2021-02-19 09:39:49 +01:00
Alessandro Di Federico a655507a0c Use relative paths during builds 2021-01-27 19:46:53 +01:00
Alessandro Di Federico 28432e30c1 Disable HARD_FLAGS_* when invoking linker
This commit is necessary in order to avoid using the compiler wrapper
provided by orchestra when developing.
2021-01-06 14:40:27 +01:00
Alessandro Di Federico 56b6797f8c scripts/revng: backport shlex.join 2020-11-12 16:21:32 +01:00
Alessandro Di Federico 864bcdc471 scripts/revng: add --lldb 2020-11-12 14:55:57 +01:00
Alessandro Di Federico c7e0361acf scripts/revng: handle empty ASAN_OPTIONS 2020-11-12 14:55:57 +01:00
Alessandro Di Federico 0b15c965ce scripts/revng: use subprocess.Popen directly
We used to use `subprocess.run`, but it's not supported in Pytnon 3.2
(Debian 7).
2020-11-10 10:04:31 +01:00
Alessandro Di Federico ea832c5063 script/revng: print command upon failure 2020-11-02 09:05:03 +01:00
Alessandro Di Federico a08d5a14e0 scripts/revng: fix matching libraries to link 2020-10-23 17:40:13 +02:00
Alessandro Di Federico 3a78fae441 Polyfill for shutil.which 2020-10-21 10:34:35 +02:00
Alessandro Di Federico 0e4c4aad59 Make --use-debug-symbols the default 2020-10-21 10:34:34 +02:00
Alessandro Di Federico 94b28d0514 bin/revng: more robust diff of opt --help output 2020-10-06 16:04:55 +02:00
Alessandro Di Federico 1c2d3e0613 bin/revng: introduce $REAL_ARGV0 2020-10-06 16:04:32 +02:00
Alain Carlucci 9034fcb235 scripts/revng: s/log/log_error/ 2020-10-01 18:17:53 +02:00
Andrea Gussoni a590159993 Use c++ compiler for linking the translated module
We now make use of the `__gxx_personality_v0` personality function to
handle the exception behavior.

For this reason, we now need to use a c++ compiler for linking the final
module after the translation process of a binary.
2020-08-03 22:11:18 +02:00
Alessandro Di Federico e51d6e5458 Make the revng script compatible with clang's ASan 2020-05-14 11:59:05 +02:00
Pietro Fezzardi a0102592b5 Lifting non-x86 dynamic ELFs: fix error message 2020-02-27 11:55:09 +01:00
Alessandro Di Federico 525325d1c6 Add revng translate --output 2020-02-19 12:19:59 +01:00
Alessandro Di Federico 0a79b3d0f2 scripts/revng: fix order of post -- arguments 2020-02-19 12:19:31 +01:00
Alessandro Di Federico d247745df8 revng: informative error message on missing file 2019-09-04 11:52:07 +02:00
Alessandro Di Federico 981389d80a revng: handle different version of pyelftools
The contents of ELF dynamic tags is return either as a `str` or a
`bytes` depending on the versions of `pyelftools`.

This commit forces it to be a string to ensure compatibility with both
options.
2019-06-06 17:39:42 +02:00
AndreaJegher 8492c56333 Enable AArch64 support (no tests)
This commit enables AArch64 as an input architecture. However, tests are
not enabled yet due to some known bugs.
2019-05-27 19:36:12 +02:00
Alessandro Di Federico 706b1d8e71 revng script: use sh instead of env
`env` sometimes is not a real executable but a shebang script spawning
/usr/bin/coreutils, which makes gdb unhappy.
2019-05-27 19:36:12 +02:00
Alessandro Di Federico 19f6f84d73 Various improvements to the revng script
* Handle SIGINT in children gracefully (`run` function).
* `run_translate`: return 0 on success.
* Move useful information about the `revng` installation from
  `--version` to `--help`.
* Do not `execv` on external commands, otherwise the script will not
  proceed.
* Print current directory-relative paths with `--verbose`.
2019-05-22 18:42:32 +02:00
Alessandro Di Federico d411978af7 revng translate: invoke revng-lift directly 2019-04-22 05:40:27 +02:00
Alessandro Di Federico 4d5493fe7f Warning on translation of non-x86-64 dynamic ELF
We can currently successfully translate only dynamic binaries for
x86-64. Warn the user about this early on instead of failing in
`revng-merge-dynamic`.
2019-04-21 10:17:08 +02:00
Alessandro Di Federico 39a5a217c4 revng script: detect AArch64 2019-04-21 10:16:51 +02:00
Alessandro Di Federico 2f2b1f6ffe revng script: wrap executables 2019-04-12 19:17:23 +02:00
Alessandro Di Federico 9f4711b770 Improve revng help and ASAN support
This commit improves the output of `--help` and reduces the output of
`--version`.  This commit, when calling `opt`, injects a `LD_PRELOAD`
for `libasan.so` in case a `librevng*.so` library uses it.
2019-04-11 18:16:53 +02:00
Alessandro Di Federico 4076fbc8cd revng script: use -load and debugging options
Due to `opt` loading multiple times the same library, we had to switch
to `LD_PRELOAD`. However, this is suboptimal. This commit goes back to
use the `-load` flag but excludes the libraries that are dependencies of
other libraries. This requires parsing the ELF but it's a more neat
solution.

In addition, several shortcuts for popular debugging tools (namely,
`gdb`, `valgrind`, `callgrind`, `heaptrack` and `perf`) have been added
to the root command.
2019-03-06 10:31:23 +01:00
Alessandro Di Federico 94a99fe57c Force linking of all the original libraries
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`.
2019-02-19 18:23:29 +01:00
Alessandro Di Federico 00b9ade51f Handle libraries not ending with .so
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`).
2019-02-19 17:57:28 +01:00
Alessandro Di Federico 2b99f8e811 Use LD_PRELOAD instead of opt -load
In `opt -load`, the order in which the libraries are provided
matters. Using `LD_PRELOAD` circumvents this issue.
2019-02-12 18:40:30 +01:00
Alessandro Di Federico 53db84f7d6 s/revamb/revng/g 2019-02-11 16:09:23 +01:00
Alessandro Di Federico ee1c8cae15 Add opt options to moderate runtime
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.
2019-01-18 15:18:47 +01:00
Alessandro Di Federico 7a045d0c0d Drop revamb-dump in favor of plain passes
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`.
2019-01-18 15:18:47 +01:00