Skip to content

Consolidate constructor/destructor sections in H2 picolibc template#1424

Merged
Shankar Easwaran (quic-seaswara) merged 1 commit into
qualcomm:mainfrom
quic-k:h2-script
Jul 21, 2026
Merged

Consolidate constructor/destructor sections in H2 picolibc template#1424
Shankar Easwaran (quic-seaswara) merged 1 commit into
qualcomm:mainfrom
quic-k:h2-script

Conversation

@quic-k

@quic-k quic-k commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Merge .preinit_array, .ctors, and .init_array into a single .init_array output section, and .dtors and .fini_array into a single .fini_array output section in the static-executable-h2-picolibc linker script template.

This prevents the linker from placing orphan sections between the entries within the [__bothinit_array_start, __bothinit_array_end) window. An orphan landing inside that window would be walked by __libc_init_array() and called as a bogus constructor function pointer, causing a fault at startup.

Merge .preinit_array, .ctors, and .init_array into a single .init_array
output section, and .dtors and .fini_array into a single .fini_array
output section in the static-executable-h2-picolibc linker script template.

This prevents the linker from placing orphan sections between the entries
within the [__bothinit_array_start, __bothinit_array_end) window. An orphan
landing inside that window would be walked by __libc_init_array() and called
as a bogus constructor function pointer, causing a fault at startup.

Signed-off-by: Kushal Pal <kushpal@qti.qualcomm.com>
@quic-seaswara
Shankar Easwaran (quic-seaswara) merged commit 4e7fe70 into qualcomm:main Jul 21, 2026
12 checks passed
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.

3 participants