binutils Newspaper
OCTOBER 6, 2026
avr — Committed

AVR: Tidy bfd/elf32-avr.c

Code cleanup in bfd/elf32-avr.c with no functional changes.

Georg-Johann Lay submitted a patch to clean up bfd/elf32-avr.c, specifically the elf32_avr_relax_section function. The changes refactor the code using new helper functions and C99 features, improving readability without altering functionality. This is a no-op in terms of behavior and testing.

In the Thread 1 participant
  1. Georg-Johann Lay <avr@gjlay.de> proposer

    Submitted a code cleanup patch for bfd/elf32-avr.c, refactoring complex sections with helper functions and C99 features. States it's a no-op with no testsuite regressions.

    “This patch is a code cleanup for bfd/elf32-avr.c, in particular the code in elf32_avr_relax_section which was long spaghetti with indentation levels of 8 and more, which made the code harder to grasp than necessary. Now it uses new helper functions like avr_local_label_at and avr_is_RCALL. It also uses more C99 features like bool and for loop variables. It uses ARRAY_SIZE if applicable, and use…”

In Details

This change tidies up the AVR backend's BFD object file handling, specifically within bfd/elf32-avr.c. It refactors the section relaxation logic by extracting complex code into helper functions and adopts modern C practices like bool and explicit type definitions (e.g., avr_reloc_map_t instead of struct avr_reloc_map). The goal is improved maintainability without functional impact.

Filed Under: avrbfdcleanupc99