Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix overlapping section and program header error #332

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/macaw-base.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ library
exceptions,
filepath,
galois-dwarf >= 0.2.2,
IntervalMap >= 0.5,
IntervalMap >= 0.6.2.0,
lens >= 4.7,
mtl,
panic,
Expand Down
4 changes: 4 additions & 0 deletions macaw-aarch32/tests/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ all: $(patsubst %.c,%-a32.exe,$(wildcard *.c)) $(patsubst %.c,%-t32.exe,$(wildca
%-mixed.s: %-mixed.c
$(A32CC) -fno-stack-protector -S -c $< -o $@

# doesn't work with arm-none-eabi
test-empty-section-a32.exe: test-empty-section.c
arm-linux-gnueabi-gcc -nostartfiles -O2 -static $< -o $@

syscall.o: syscall.s
$(A32AS) $< -o $@

Expand Down
Binary file not shown.
5 changes: 5 additions & 0 deletions macaw-aarch32/tests/arm/test-empty-section-a32.mcw.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
R { funcs = [ (0x100d8, [(0x100d8,8), (0x100e0, 8)]),
(0x100e8, [(0x100e8,32)])
]
, ignoreBlocks = []
}
20 changes: 20 additions & 0 deletions macaw-aarch32/tests/arm/test-empty-section.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// test-empty-section.c
// test for issue #302 (https://github.com/GaloisInc/macaw/issues/302)
// results in a binary with an empty section when built as follows:
//
// arm-linux-gnueabi-gcc -nostartfiles -O2 -static test-empty-section.c -o test-empty-section-a32.exe
//
//
#include <stdint.h>

uint64_t x = 0;

int __attribute__((noinline)) test_strd() {
x = 42;
return x == 42;
}

int main() {
test_strd();
return 0;
}