ld: Fix test cases in ld-unique/unique.exp
Patch to fix failing test cases in ld-unique/unique.exp on the H8 target due to assembler diagnostics and undefined references.
Jan Dubiec submits a patch to fix failing test cases in ld-unique/unique.exp on the H8 architecture. The failures are attributed to unexpected assembler diagnostics and an undefined reference to main where _main was expected by the C startup code. The patch aims to resolve these issues for the H8 target.
- proposer
Submits a patch to fix failing test cases in ld-unique/unique.exp on the H8 target.
“These tests fail on H8, as shown in the log below, for two reasons: 1. Unexpected assembler diagnostics (see also https://sourceware.org/pipermail/binutils/2026-August/150723.html). 2. An undefined reference to main: unique.s defines main, whereas the C startup code expects _main. This patch fixes both issues.”
In Details
This patch addresses failing test cases in the ld-unique/unique.exp test suite, specifically on the H8 architecture. The failures stem from two issues: incorrect assembler diagnostics and a mismatch in the entry point symbol (main vs. _main) between the assembly code and the C startup routines. The patch modifies the test setup or the assembly code to align with the expected behavior for the H8 target.
- ld
- The GNU linker, responsible for combining object files and libraries into an executable or another object file.
- testsuite
- A collection of tests designed to verify the correctness of software, often run automatically after code changes.
- H8
- A family of microcontrollers from Renesas (formerly Hitachi).
- Assembler diagnostics
- Warnings or errors generated by the assembler when it encounters syntax errors or non-standard constructs in assembly code.
- Undefined reference
- An error produced by the linker when it cannot find the definition of a symbol that was referenced in the code.
- main
- The conventional entry point function for C/C++ programs.
- _main
- A symbol often used internally by startup code as the actual entry point, which then calls the user-defined
mainfunction.