[PATCH PR gas/33030] gas: accept leading zeros on dollar local labels in z80 sdcc compat mode

Jan Beulich jbeulich@suse.com
Fri Jul 4 06:24:32 GMT 2025


On 04.07.2025 05:19, H.J. Lu wrote:
> On Fri, Jul 4, 2025, 11:02 AM Aaron Griffith <aargri@gmail.com> wrote:
> 
>> SDCC assembly output uses 5-digit numeric dollar sign labels, padded
>> with zeros. Commit 226749d made these invalid, and broke the Z80 SDCC
>> compatibility mode in GAS.
>>
>>
>> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b
>>
>> This restores SDCC compatibility by replacing the leading zeros with
>> spaces when inside dollar local labels and when SDCC compatibility is
>> enabled. It also restores the SDCC test case to represent actual
>> syntax emitted by SDCC.
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33030
>> ---
>> I've cc'd the author of the commit that broke this behavior
>> originally, in case they have any input on how to best fix this. I
>> think my solution is reasonable, but this is a complicated code base
>> that's new to me.
>>
>> I have an FSF copyright assignment on file for binutils.
>> ---
>>  gas/config/tc-z80.c          | 20 ++++++++++++++++++++
>>  gas/testsuite/gas/z80/sdcc.s | 36
> 
> 
> Please add a generic gas test.

But the behavior is only being restored for Z80.

Jan


More information about the Binutils mailing list