h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts
Linker script generation for h8300-elf now correctly uses USER_LABEL_PREFIX.
The h8300-elf linker script generation was updated to use USER_LABEL_PREFIX. This change ensures consistency with the GCC compiler’s handling of symbols, which use a leading underscore. Previously, differences in prefix handling could lead to subtle bugs, particularly with weak symbols, and complicated cross-platform development. Test cases for the linker and H8/300 simulator have been updated to reflect this.
In Details
The h8300-elf toolchain previously lacked synchronization on USER_LABEL_PREFIX between GCC and binutils. GCC uses it to prepend underscores to symbols, while ld did not. This commit aligns ld with GCC's behavior for h8300-elf, resolving potential issues with weak symbols and improving portability. The change affects linker script generation and is backported from a similar newlib fix.