Skip to content

Handle GOT sections gracefully#3065

Open
Prabhuk wants to merge 4 commits into
raspberrypi:developfrom
Prabhuk:got_section_handling
Open

Handle GOT sections gracefully#3065
Prabhuk wants to merge 4 commits into
raspberrypi:developfrom
Prabhuk:got_section_handling

Conversation

@Prabhuk

@Prabhuk Prabhuk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

If any of the libraries linked against is built as position independent code, weak undefined symbols and comdat symbols may have GOT relocations. We observed this in the LLVM runtime libraries (libc.a/libm.a) but this behavior is not specific to Clang/LLVM toolchains. Including the GOT sections into the data section to handle them gracefully.

Fixes #3064

If any of the libraries linked against is built as position independent
code, weak undefined symbols and comdat symbols may have GOT
relocations. We observed this in the LLVM runtime libraries
(libc.a/libm.a) but this behavior is not specific to Clang/LLVM
toolchains. Including the GOT sections into the data section to handle
them gracefully.
@Prabhuk

Prabhuk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

CC: @petrhosek

…st clang toolchain (current and upcoming) in pico2 ARM core.
@Prabhuk Prabhuk marked this pull request as ready for review July 8, 2026 23:23
@Prabhuk

Prabhuk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Also tested the gcc build on device. These were the tests I built and ran. Posting the build command for reference

cmake --build build-gcc --target fixed_bitset_test hardware_irq_test hardware_pwm_test hardware_sync_spin_lock_test pico_async_context_test pico_divider_test pico_float_test pico_double_test pico_sem_test pico_sha256_test pico_stdlib_test pico_sync_test_sw pico_thread_local_test pico_time_test pico_stdio_test_uart cmsis_test --parallel

Comment thread src/rp2_common/pico_standard_link/script_include/section_default_data.incl Outdated
…lt_data.incl

Co-authored-by: Petr Hosek <phosek@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants