[PATCH PR gas/33030] gas: accept leading zeros on dollar local labels in z80 sdcc compat mode
Aaron Griffith
aargri@gmail.com
Fri Jul 4 21:04:55 GMT 2025
On Fri, Jul 4, 2025 at 2:45 AM Jan Beulich <jbeulich@suse.com> wrote:
> I'm sorry for my unawareness of this special mode.
No worries -- it went unreported for more than a year. It's a niche feature
of a niche target.
> Don't you need to allow for a blank between '$' and ':'?
No: SDCC's assembler doesn't accept this, so it's safe to ignore. I'll add
a comment.
> Hmm, altering the input isn't very nice, but the alternative of moving
> input_line_pointer forward looks to come with its own problems. One
> side effect of you doing so is that listings may not correctly report
> original code in certain cases.
Yes, I'm also not too happy about this. However, this is consistent with
the solution used elsewhere in SDCC mode, for example replacing '::' with
': ' on label definitions. Since the primary use of SDCC mode is compiling
code generated by SDCC, I'm ok with the listings being slightly off.
> Also I hope it is indeed sufficient to do so just for the first label
> on a line / in a statement? (This limitation may want mentioning in a
> comment.)
Yes, I think so. SDCC always emits one label definition per line.
Their assembler *does* accept multiple labels per line. Accepting this here
would make the patch much more complicated, and I don't think it's worth
it: hand-written assembly probably won't use 0-padded dollar local labels,
let alone many on one line. But I'm willing to make that change if you
think it's necessary.
Either way, I'll at least add a comment.
> Jan
Thanks for the review, I'll spin up another patch in a few days.
-Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20250704/513da0f2/attachment.htm>
More information about the Binutils
mailing list