From 9a836b6b4d335f064e76d288140efbc62fbacaf7 Mon Sep 17 00:00:00 2001 From: Michael Golovanov Date: Tue, 14 Oct 2025 21:17:22 +0300 Subject: [PATCH] Fix build 2-loop example on Debian 13 --- 2-loop/Makefile | 2 +- 2-loop/loop.ld | 2 +- 2-loop/loop.s | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/2-loop/Makefile b/2-loop/Makefile index 40a1115..58729fa 100644 --- a/2-loop/Makefile +++ b/2-loop/Makefile @@ -8,7 +8,7 @@ loop.elf: loop.ld loop.o arm-none-eabi-ld -T loop.ld -o loop.elf loop.o loop.o: loop.s - arm-none-eabi-as -o loop.o loop.s + arm-none-eabi-as -mcpu=cortex-m3 -mthumb -mthumb-interwork -o loop.o loop.s clean: rm -f loop.o loop.elf loop.bin diff --git a/2-loop/loop.ld b/2-loop/loop.ld index 4771d38..a32ef06 100644 --- a/2-loop/loop.ld +++ b/2-loop/loop.ld @@ -3,6 +3,6 @@ SECTIONS { LONG(0x20000000 + 20K); LONG(reset_exception_handler | 1); . = 0x130; - loop.o(code) + loop.o(.text) } } diff --git a/2-loop/loop.s b/2-loop/loop.s index ad5767e..8bde65f 100644 --- a/2-loop/loop.s +++ b/2-loop/loop.s @@ -2,10 +2,12 @@ .syntax unified .thumb + .global reset_exception_handler -.section code +.text +.thumb_func reset_exception_handler: add r0, r0, 1 bl reset_exception_handler