rust-embedded / rust-embedded/aarch32

GDB and addr2line report very weird functions for certain symbols

Open
#215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
66
Forks
25
Avg merge
4d 6h
Merged PRs (30d)
4

Description

$ arm-none-eabi-objdump -t target/thumbv4t-none-eabi/debug/hello | grep _asm
00003038 l     F .text	00000030 _RNvNtCsajHdCz4aHut_11aarch32_cpu6stacks22stack_unused_bytes_asm
0001a15c g     F .text	0000005c _asm_default_svc_handler
0001a094 g     F .text	00000044 _asm_default_irq_handler
0001a1b8 g     F .text	00000048 _asm_default_undefined_handler
0001a0d8 g     F .text	00000040 _asm_default_data_abort_handler
0001a118 g     F .text	00000040 _asm_default_prefetch_abort_handler
000029fe g     F .text	00000054 _asm_core_start
00002a54 g     F .text	00000080 _asm_stack_setup_preallocated
00002b04 g     F .text	0000005c _asm_init_segments
00002b7c g     F .text	00000004 _asm_default_fiq_handler
0001a1b8 g     F .text	00000000 _asm_undefined_handler
0001a15c g     F .text	00000000 _asm_svc_handler
0001a118 g     F .text	00000000 _asm_prefetch_abort_handler
0001a0d8 g     F .text	00000000 _asm_data_abort_handler
0001a158 g     F .text	00000000 _asm_hvc_handler
0001a094 g     F .text	00000000 _asm_irq_handler
00002b7c g     F .text	00000000 _asm_fiq_handler
0001a158 g     F .text	00000004 _asm_default_hvc_handler
$ arm-none-eabi-addr2line -e target/thumbv4t-none-eabi/debug/hello 0001a15c
??:?
# weird - that should be `_asm_svc_handler`
$ arm-none-eabi-addr2line -e target/thumbv4t-none-eabi/debug/hello 000029fe
/Users/jonathan/.rustup/toolchains/nightly-2026-06-04-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/fmt/num.rs:403
# that's very wrong, that should be `_asm_core_start`
$ arm-none-eabi-addr2line -e target/thumbv4t-none-eabi/debug/hello 00002b94
/Users/jonathan/Documents/open-source/rust-embedded/aarch32/aarch32-rt/src/lib.rs:854
# That seems right?
$ arm-none-eabi-objdump -t target/thumbv4t-none-eabi/debug/hello | grep kmain
0001a20c l     F .text	0000000c __ARMv4ABSLongBXThunk_kmain
0001a218 l     F .text	0000000c __ARMv4ABSLongBXThunk_kmain_secondary
000000c0 g     F .text	000000a0 kmain
00002b94 g     F .text	00000008 _default_kmain_secondary
00002b94 g     F .text	00000000 kmain_secondary
$ arm-none-eabi-addr2line -e target/thumbv4t-none-eabi/debug/hello 000000c0
/Users/jonathan/Documents/open-source/rust-embedded/aarch32/examples/versatileab/src/bin/hello.rs:13
# Looks OK
$ arm-none-eabi-addr2line -e target/thumbv4t-none-eabi/debug/hello 00002b94
/Users/jonathan/Documents/open-source/rust-embedded/aarch32/aarch32-rt/src/lib.rs:854
# Looks OK

The Rust functions seem to resolve in addr2line correctly, but the assembly ones don't. This makes it very hard to use GDB.

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported commands against target/thumbv4t-none-eabi/debug/hello, comparing objdump symbols with addr2line results. Inspect the assembly-related entry points in aarch32-rt/src/lib.rs and the example at examples/versatileab/src/bin/hello.rs; done when the listed assembly handlers resolve to their correct symbols in addr2line and GDB.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.