Hi Jörg,
those 8 bytes (entry in exception unwind table) are not the problem;
the problem is the exception recovery code itself.
The .text section in the STM3210ETest sample project explodes from
0x0b2c to 0x3004 bytes, that's almost 10KB!!
To be clear: I'm talking about c++ type software exceptions, not ARM
(HW) exceptions
The linker option -t shows what is included from libraries:
1 | c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: mode armelf
|
2 | ./src/main.o
|
3 | ./src/startup.o
|
4 | ./src/vectors.o
|
5 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_arm_addsubdf3.o
|
6 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_arm_truncdfsf2.o
|
7 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_arm_addsubsf3.o
|
up to here it is normal. Everything that follows is only linked in if
there is a 64-bit division:
1 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_aeabi_uldivmod.o
|
2 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)bpabi.o
|
3 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)unwind-arm.o
|
4 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)libunwind.o
|
5 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)pr-support.o
|
6 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_dvmd_tls.o
|
7 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_divdi3.o
|
8 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_udivdi3.o
|
9 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/thumb/v7m\libgcc.a)_udivsi3.o
|
10 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-abort.o
|
11 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-memcpy.o
|
12 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-reent.o
|
13 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-signal.o
|
14 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-signalr.o
|
15 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-freer.o
|
16 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-impure.o
|
17 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-mallocr.o
|
18 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-mlock.o
|
19 | (c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb/v7m\libc.a)lib_a-sbrkr.o
|
Linked in code is various unwind functions from libgcc, e.g.
20000f60 t _Unwind_SetGR
20000f7c t __gnu_unwind_pr_common
unwind = stack unwind = recovering from a exception.
These function draw in a whole bunch of os-type libc functions.
if you think you can help I can try to create a small program that
reproduces the issue, but it should be fairly simple: just add the
division function to any existing code (without exception handling)
note: the linked in code also forces you to define os-type backends such
as _exit, _getpid, _kill,_sbrk.