LoongArch: Add parameters to DWARF2_USE_FIXED_ADVANCE_PC macro
Patch adds FROM and TO symbol parameters to DWARF2_USE_FIXED_ADVANCE_PC macro for LoongArch for finer DWARF debug info control.
This RFC patch for binutils’ LoongArch support introduces parameters to the DWARF2_USE_FIXED_ADVANCE_PC macro. The goal is to allow finer-grained control over DWARF debug information generation, specifically by deciding whether to use the DW_LNS_fixed_advance_pc opcode or special opcodes based on the presence of linker-relaxable instructions between symbols.
In Details
This patch introduces parameters (FROM, TO) to the DWARF2_USE_FIXED_ADVANCE_PC macro in the LoongArch backend of binutils' GAS. This macro controls how DWARF line number information is generated. Currently, it's a simple on/off switch. The change allows GAS to conditionally use DW_LNS_fixed_advance_pc (for advancing the program counter in DWARF .debug_line info) only when there are linker-relaxable instructions between the FROM and TO symbols. Otherwise, it falls back to using special opcodes, potentially leading to more compact or accurate line number debug info.
- LoongArch
- A Chinese indigenous instruction set architecture.
- DWARF
- A debugging data format used by many compilers and debuggers to store information about variables, types, and code structure.
- DW_LNS_fixed_advance_pc
- A DWARF line number statement ('Line Number Statement') instruction used to advance the program counter by a fixed amount in the .debug_line section.
- GAS
- The GNU Assembler, part of the GNU Binutils package.
- linker-relaxable instructions
- Instructions whose assembly addresses might change during the linking process, typically due to relocation or optimization.