h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts
Patch reposted to add H8/300 simulator testsuite change for USER_LABEL_PREFIX.
This is a repost of a patch series for the h8300-elf target in binutils, which has been split into two logical parts. The binutils linker script modification has been accepted, and this repost focuses on the smaller, straightforward change to the H8/300 simulator testsuite. The author is seeking approval from a GDB/sim maintainer for this remaining part.
- proposer
Reposts the patch, noting that the binutils part is accepted and the remaining change to the H8/300 simulator testsuite requires GDB/sim maintainer approval.
“Gentle ping. Although this patch modifies files in both binutils and the H8/300 simulator testsuite, it constitutes a single logical change. The binutils part has already been accepted, and now only the small and straightforward change to the simulator testsuite awaits approval from a gdb/sim maintainer.”
- reviewer
Responded to the ping, indicating awareness of the need for a GDB maintainer's review.
“Regarding your recent ping for a gdb maintainer for this part of your patch: On Sun, 23 Aug 2026, Jan Dubiec wrote: > This version does not explicitly set the entry symbol; the default one > is used instead. > > The patch also changes one file in the H8/300 simulator testsuite, as it > is affected by the change to the entry symbol. The patch has therefore > also been posted to the gdb-patches…”
Technical Tradeoffs
- Ensures consistent label handling across different tools and environments.
- Requires a separate review for the testsuite modification.
In Details
This patch for the h8300-elf target in binutils' ld linker modifies how linker scripts are generated. Specifically, it introduces the use of USER_LABEL_PREFIX to ensure consistency with how labels are handled, especially concerning the entry symbol. A related change to the H8/300 simulator testsuite is pending review.
- ld
- The GNU linker, responsible for combining object files and libraries into an executable or shared library.
- linker script
- A file that controls how the linker assigns addresses to output sections and what symbols are defined. It allows customization of the output binary's memory layout.
- USER_LABEL_PREFIX
- A configuration option or macro used by the linker to prepend a specific prefix to user-defined labels, ensuring proper symbol resolution, especially in cross-compilation environments.
- H8/300
- A family of microcontrollers from Renesas (formerly Hitachi). The h8300-elf target refers to the toolchain for this architecture using the ELF object file format.
- simulator testsuite
- A collection of tests designed to verify the correct functionality of a CPU simulator, often part of a larger toolchain.