HexHive / HexHive/retrowrite

[BUG] Cannot re-compile hello world aarch64 binary

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
analysis-needed bug
Dominant language
Python
Stars
750
Forks
87
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When I run the instrumentation pass, the link step fails with undefined references to the AFL runtime symbols:

```
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /tmp/ccEu0nM0.o: in function `myarea':
(.afl_sec+0x3): undefined reference to `__afl_area_ptr'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /tmp/ccEu0nM0.o: in function `myprev_loc':
(.afl_sec+0xb): undefined reference to `__afl_prev_loc'
collect2: error: ld returned 1 exit status

```

**Describe how to reproduce the bug**

1. Platform: ARM64 (aarch64)
2. Compiler: aarch64-linux-gnu-g++ (GCC 11), targeting aarch64 Android coverage.
3. Code: a minimal test binary (test_bin)
4. OS / Environment: Ubuntu 20.04 x64

## Recompilation
```
# 1) generate an Android-coverage-instrumented .s
./retrowrite -m android_coverage test_bin test_bin.s # succeeds

# 2) apply the analysis pass
./retrowrite -a test_bin.s test_bin_inst # fails with undefined reference errors
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the listed aarch64-linux-gnu-g++ command, then trace the android_coverage instrumentation and the analysis pass from test_bin.s to test_bin_inst. Check how the AFL runtime symbols are supplied during the link step; done means the instrumented AArch64 binary recompiles without undefined __afl_area_ptr or __afl_prev_loc references.

Written by the indexing model from the issue text.

Assessment

Domain
reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.