[PATCH] h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts.

Jan Dubiec jdx@o2.pl
Fri Aug 21 10:41:29 GMT 2026


On 21.08.2026 12:20, Jan Beulich wrote:
> On 21.08.2026 12:06, Jan Dubiec wrote:
>> On 21.08.2026 11:18, Jan Beulich wrote:
>> [...]
>>> Aiui also setting ENTRY is to not alter the default entry point name. However,
>>> with USER_LABEL_PREFIX being underscore, can the entry point sensibly have just
>>> a single underscore?
>>
>> In the case of the H8 family, this is possible because the _start symbol
>> is defined in assembly, specifically in newlib/libc/sys/h8300hms/crt0.S
>> in the newlib sources.
>>
>> That said, I have an implementation using the default entry symbol (i.e.
>> __start) stashed in my Git repository. It requires changes to 17 files
>> in ld/testsuite/ld-h8300, as well as a change to crt0.S in newlib.
>>
>> I decided to take the shorter and simpler approach, but I'm open to
>> suggestions, as the other approach seems somewhat more elegant (although
>> that doesn't necessarily mean it's better).
> 
> It's not just more elegant, it's also the correct one. As it stands, user
> code defining a non-static C function start() will collide with the (global)
> entry point symbol.
OK, I get it. However, a user could also define _start(). :-)

Anyway, I'll post the other version later this evening.

/J.D.


More information about the Binutils mailing list