binutils Newspaper
NOVEMBER 30, 2026
gas — Proposed

gas: Keep the ISA bit for a local alias of a weak microMIPS function

Preserves ISA mode in weak microMIPS function aliases to prevent illegal instruction exceptions.

This patch addresses a bug in GAS where the ISA mode of a weak microMIPS function’s local alias could be lost when a relocation is reduced to a section symbol. This loss of mode information can lead to illegal instruction exceptions when calling through the alias. The fix ensures that the ISA mode is preserved, maintaining correct execution for microMIPS functions under these specific conditions.

In Details

This patch modifies gas/config/tc-mips.c to prevent the loss of ISA mode (Thumb/microMIPS) information stored in st_other for weak function aliases. Previously, when a relocation against such an alias was reduced to a section symbol, the ISA mode was lost. This change ensures that if the symbol's value doesn't inherently carry the ISA mode (i.e., the lowest bit is not used for it), the relocation must be kept to preserve the mode information from st_other. This is crucial for correct execution of microMIPS code via these aliases.

For Context
GAS
The GNU Assembler, part of the GNU Binutils project, which translates assembly language code into machine code.
ISA mode
Instruction Set Architecture mode, referring to different operational modes of a processor, such as ARM's Thumb mode for 16-bit instructions or MIPS's microMIPS mode.
Relocation
A process performed by the linker to adjust addresses in machine code or data sections to reflect the final memory layout of the program.
Section symbol
A symbol that represents an entire section of code or data within an object file.
microMIPS
A compact instruction set architecture variant of MIPS, designed for smaller embedded systems, which uses the least significant bit of addresses to distinguish between MIPS16/microMIPS and standard MIPS modes.
Filed Under: binutilsgasMIPSmicroMIPSISA mode