[PATCH v2 1/6] Gas changes for nanoMIPS support.
Tsing
lei.wang@oss.cipunited.com
Fri Nov 20 10:43:08 GMT 2026
On Sat, 3 Oct 2026, Maciej W. Rozycki wrote:
> On Fri, 4 Sep 2026, Tsing wrote:
>
>>>> +/* Always disable ECOFF_DEBUGGING for nanoMIPS target. */
>>>> +#ifdef TC_NANOMIPS
>>>> +#define ECOFF_DEBUGGING 0
>>>> +#endif /* TC_NANOMIPS */
>>>
>>> Why would this be needed? You enable only ELF afaics.
>>
>> When compiling for the nanoMIPS target or configuring the build system,
>> ECOFF_DEBUGGING should always be disabled. This is due to format incompatibility:
>> the nanoMIPS toolchain and binary formats are typically based on the ELF standard, not the ECOFF format.
>
> The use of the ELF format does not preclude support for ECOFF debugging.
> MIPS targets support ECOFF-in-ELF debug records, the so called "mdebug"
> format, after the name of the ELF section this stuff is held in.
>
> Now the nanoMIPS psABI designers may have chosen not to support this ELF
> legacy extension, which goes back to the IRIX environment, however there
> is nothing inherently incompatible here (Alpha has similar stuff FWIW) and
> consequently the justification needs to be different.
>
> Can you actually produce a copy of a nanoMIPS psABI specification?
>
> NB this is not a proper review at this stage, I'll get to it later.
Thanks for the review. You are absolutely right that ELF does not inherently exclude
ECOFF-format debug records. Traditional MIPS ELF targets can embed ECOFF debugging records
in an .mdebug section, and Alpha has a similar legacy mechanism.
Therefore, the reason here should not be stated as a fundamental incompatibility between
ELF and ECOFF. The case of nanoMIPS is a choice at the ABI/toolchain level, not a format
limitation: nanoMIPS adopts DWARF natively, and there is no need to preserve the legacy
IRIX-era ECOFF/mdebug compatibility path. Setting ECOFF_DEBUGGING to 0 only disables this
legacy support in GAS, which eliminates redundant duplicate debug information and reduces
long-term maintenance complexity for the toolchain.
In other words, this is about not supporting the legacy MIPS ECOFF-in-ELF mechanism for nanoMIPS,
not about ELF being unable to represent it.
Documents
ABI: https://github.com/MediaTek-Labs/nanomips-docs/blob/main/MIPS_nanoMIPS_p32_ABI_Porting_Guide_01_02_DN00184.pdf
https://github.com/MediaTek-Labs/nanomips-docs/blob/main/MIPS_nanoMIPS_ABI_supplement_01_03_DN00179.pdf
Tsing
More information about the Binutils
mailing list