binutils Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ld

init-mixed.c count

Renames 'count' to 'order' in ld's init-mixed.c test, using smaller values to prevent overflow on 16-bit targets.

The ld testsuite file init-mixed.c has been updated to rename a variable from count to order. This change clarifies the variable’s purpose, as it tracks the initialization order rather than an arbitrary count. Additionally, the test now uses small integer values (0-6) to verify this order, preventing potential integer overflows on targets with limited 16-bit integer support, as introduced by a previous commit.

In Details

In ld/testsuite/ld-elf/init-mixed.c, the variable count has been renamed to order to better reflect its purpose in validating the initialization and finalization function order. The test values have been reduced from potentially large numbers to a small range (0-6) to accommodate targets where int might be 16 bits, preventing overflows that could occur since commit 2e806738bd. This ensures the test suite remains robust across different target architectures.

For Context
linker script
A file used by the linker to control how sections from object files are placed into the final executable, defining memory layouts and symbol placement.
init_array
A section in ELF executables that contains pointers to functions to be executed before the main program starts (initialization functions).
fini_array
A section in ELF executables that contains pointers to functions to be executed after the main program exits (finalization functions).
ctors
Constructor functions; similar to initialization functions, these are executed before main().
dtors
Destructor functions; similar to finalization functions, these are executed after main() exits.
Filed Under: linkertestsuitebugfix