From 3ba6ee3d164d8d82ff306873bc13b8a7951a28ee Mon Sep 17 00:00:00 2001 From: Daniel Matichuk Date: Mon, 17 Jul 2023 17:00:28 -0700 Subject: [PATCH] macaw-aarch32: add test for binary containing empty section --- macaw-aarch32/tests/arm/Makefile | 4 ++++ .../tests/arm/test-empty-section-a32.exe | Bin 0 -> 1256 bytes .../arm/test-empty-section-a32.mcw.expected | 5 +++++ macaw-aarch32/tests/arm/test-empty-section.c | 14 ++++++++++++++ 4 files changed, 23 insertions(+) create mode 100755 macaw-aarch32/tests/arm/test-empty-section-a32.exe create mode 100644 macaw-aarch32/tests/arm/test-empty-section-a32.mcw.expected create mode 100644 macaw-aarch32/tests/arm/test-empty-section.c diff --git a/macaw-aarch32/tests/arm/Makefile b/macaw-aarch32/tests/arm/Makefile index 1848c373..20a52f7f 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 witn arm-none-eabi +test-empty-section.exe: test-empty-section.c + arm-linux-gnueabi-objdump -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 0000000000000000000000000000000000000000..a0dce4b1e0944ce276f758711960f2fa059c12ea GIT binary patch literal 1256 zcma)5Jx>%-6uobDSC&Yz5adG*Zm|VlGY+~&F`9s=#KcdO!dR>`%mmlCvt;LO0*#Vb z+S|Iltu38}jXkX)BoHfq0iH864<~5hP0l;-+)`DI z8cRxbsY(&CekmvMG@qGD20%n9ajGO($9szZ>apb>68vu07XH)ZE)kuH)97xvA7I zi&I$J3q8Ln>H@l@E6?Oqp{)AVP;pqDQKN-1HLlKD6BdI1GVYsJ$e8Dy>U0F_Ni}!* z#|p{r^SYFcOnpW9bu@zR!Liqpap>~#9b3YoYcl_3wdMZ!ObL!TI%GKRSleN1LvPt}xTc%! z$XSz`C$&H}rP1)?xDjiwqZ^G(g;8+aPa@Ltno%+jGCKj%vXn6Jv?o*|PQ2C9o)6ZY zlwX-%)YhT19(5hR+k6w)%|IL-ZfbF`wm56;Rx6C47FQlPp4OeF-$l*X#(WcC4k z6?{AVKRhpE#jN9i`I7ioc*eV6{$pb%k3QZnUsw81Q*H7Xqs;@H&!vFzpU + +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