ld testsuite: Associate C identifiers with linker symbols target-independently.
Patch applied to ld testsuite to associate C identifiers with linker symbols in a target-independent way.
Jan Dubiec’s patch, which addresses issues with leading underscores in C symbol names across different targets, has been applied to the binutils ld testsuite. The change aims to correctly link C identifiers with their corresponding assembler or linker symbols in a manner that is independent of the target architecture’s conventions.
- maintainer
Applied the patch, acknowledging its usefulness for handling target-specific symbol naming conventions in the testsuite.
- proposer
Proposed a patch to use the `asm` keyword to associate C identifiers with assembler/linker symbol names regardless of target-specific underscore prefixes.
“Some targets prepend an underscore to C symbol names, while others do not (e.g. H8 vs. ARM). This can cause problems in two situations, as shown in the log below: 1. when linking C and assembly code; 2. when a symbol name is specified on the linker's command line. This patch resolves both issues by using the asm keyword to associate C identifiers with the corresponding assembler/linker symbol nam…”
In Details
Alan Modra has accepted Jan Dubiec's patch into the ld testsuite. The change addresses inconsistencies in how the linker handles C symbol names that may or may not be prefixed with an underscore, depending on the target architecture. This ensures test cases accurately reflect symbol recognition across different targets.
- ld
- The GNU linker, a program that combines various object files and libraries into a single executable or library.
- Testsuite
- A collection of tests designed to verify the correctness of a software program.
- Symbol name
- An identifier used in object files and executables to refer to functions, variables, or other program elements. Some architectures prepend an underscore to C symbol names.
- Target-independent
- Software design that does not rely on specific characteristics of a particular hardware architecture or operating system.