diff --git a/base/macaw-base.cabal b/base/macaw-base.cabal index 6025317d..06554f67 100644 --- a/base/macaw-base.cabal +++ b/base/macaw-base.cabal @@ -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, diff --git a/macaw-aarch32/tests/arm/Makefile b/macaw-aarch32/tests/arm/Makefile index 1848c373..cd813b9f 100644 --- a/macaw-aarch32/tests/arm/Makefile +++ b/macaw-aarch32/tests/arm/Makefile @@ -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 $@ diff --git a/macaw-aarch32/tests/arm/test-empty-section-a32.exe b/macaw-aarch32/tests/arm/test-empty-section-a32.exe new file mode 100755 index 00000000..a0dce4b1 Binary files /dev/null and b/macaw-aarch32/tests/arm/test-empty-section-a32.exe differ diff --git a/macaw-aarch32/tests/arm/test-empty-section-a32.mcw.expected b/macaw-aarch32/tests/arm/test-empty-section-a32.mcw.expected new file mode 100644 index 00000000..db7d2057 --- /dev/null +++ b/macaw-aarch32/tests/arm/test-empty-section-a32.mcw.expected @@ -0,0 +1,5 @@ +R { funcs = [ (0x100d8, [(0x100d8,8), (0x100e0, 8)]), + (0x100e8, [(0x100e8,32)]) + ] + , ignoreBlocks = [] + } diff --git a/macaw-aarch32/tests/arm/test-empty-section.c b/macaw-aarch32/tests/arm/test-empty-section.c new file mode 100644 index 00000000..c58bcee6 --- /dev/null +++ b/macaw-aarch32/tests/arm/test-empty-section.c @@ -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 + +uint64_t x = 0; + +int __attribute__((noinline)) test_strd() { + x = 42; + return x == 42; +} + +int main() { + test_strd(); + return 0; +} \ No newline at end of file