-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aseitz/arm-invalid-size' into 'main'
Fix false invalid Thumb stm instruction See merge request rewriting/ddisasm!1184
- Loading branch information
Showing
5 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.PHONY: clean check | ||
out.txt: ex | ||
@qemu-arm -L /usr/arm-linux-gnueabihf $^ > $@ | ||
ex: ex_original.s | ||
arm-linux-gnueabihf-gcc -o $@ $^ | ||
clean: | ||
rm -f ex out.txt | ||
check: ex | ||
qemu-arm -L /usr/arm-linux-gnueabihf $^ > /tmp/res.txt | ||
@ diff out.txt /tmp/res.txt && echo TEST OK |
28 changes: 28 additions & 0 deletions
28
examples/arm_asm_examples/ex_stm_reglist_invalid/ex_original.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Regression test: `stm r0!, {r0, r1}` is not considered an invalid instruction. | ||
# `stm r1!, {r0, r1, r2}` causes a warning but compiles and it has been | ||
# seen in real binaries | ||
|
||
.syntax unified | ||
.section .text | ||
|
||
.global main | ||
.type main, %function | ||
.thumb | ||
.align 4 | ||
main: | ||
push { lr } | ||
|
||
ldr r0, =data | ||
stm r0!, {r0, r1} | ||
ldr r1, =data | ||
# this causes a warning "Warning: value stored for r1 is UNKNOWN", but compiles | ||
# if r1 is later not used it is acceptable | ||
stm r1!, {r0, r1, r2} | ||
mov r0, 0 | ||
pop { pc } | ||
|
||
.section .data | ||
data: | ||
.long 0 | ||
.long 1 | ||
.long 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters