Skip to content

Commit 5cf9e61

Browse files
wdfk-progtrini
authored andcommitted
examples: fix building on arm32
Refer to the commit a3c101a ("examples: fix building on arm64") fix for arm32. crt0.S does not even build with: operating system and architecture: 5.15.0-130-generic x86_64 installed version of gcc and binutils: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.3) GNU ld (GNU Binutils for Ubuntu) 2.34 used defconfig: stm32h750-art-pi_defconfig used commands for building: export CROSS_COMPILE=arm-none-eabi- ARCH=arm make stm32h750-art-pi_defconfig make menuconfig # to add make examples/api/crt0.S: Assembler messages: examples/api/crt0.S:32: Error: lo register required -- `ldr ip,=search_hint' examples/api/crt0.S:33: Error: lo register required -- `str sp,[ip]' examples/api/crt0.S:39: Error: lo register required -- `ldr ip,=syscall_ptr' examples/api/crt0.S:40: Error: lo register required -- `ldr pc,[ip]' make[2]: *** [scripts/Makefile.build:292:examples/api/crt0.o] Error 1 Use valid register names and instructions. Signed-off-by: Liya Huang <[email protected]>
1 parent adeea85 commit 5cf9e61

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/api/crt0.S

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ syscall:
2929
.text
3030
.globl _start
3131
_start:
32-
ldr ip, =search_hint
33-
str sp, [ip]
32+
ldr r4, =search_hint
33+
mov r5, sp
34+
str r5, [r4]
3435
b main
3536

3637

3738
.globl syscall
3839
syscall:
39-
ldr ip, =syscall_ptr
40-
ldr pc, [ip]
40+
ldr r4, =syscall_ptr
41+
ldr r4, [r4]
42+
bx r4
4143

4244
#elif defined(CONFIG_ARM64)
4345

0 commit comments

Comments
 (0)