Re: [PATCH] h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts.
Jan Beulich <[email protected]>
| Newsgroups | gmane.comp.gnu.binutils |
|---|---|
| Message-ID | <[email protected]> |
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. Jan