Re: [patch] AVR: Sort .text.* input sections by their name.

Project / Subsystem

binutils / avr

Date

2026-07-22

Proposer

Alan Modra <amodra@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Code Locality: Balancing the potential benefits of sorting sections by name against the risk of degrading cache performance.
  • Linker Script Flexibility vs. Patch Simplicity: Offering a more powerful but complex solution (linker scripts) versus a simpler patch.
  • Target-Specific Optimization: Tailoring optimization strategies like section ordering for specific architectures (AVR) where it might be beneficial.

All attributes

project
binutils
subsystem
avr
patch_id
discussion_id
amCvYm3-7Yb1BxS3@squeak.grove.modra.org
source_type
public_inbox
title
Re: [patch] AVR: Sort .text.* input sections by their name.
headline
AVR: Sort .text.* input sections by their name.
tldr
Discussion on sorting .text sections in AVR binutils: maintainer suggests a better approach than originally proposed patch.
proposer
Alan Modra <amodra@gmail.com>
consensus
Proposed
outcome
needs_revision
sentiment_score
technical_tradeoffs
  • Code Locality: Balancing the potential benefits of sorting sections by name against the risk of degrading cache performance.
  • Linker Script Flexibility vs. Patch Simplicity: Offering a more powerful but complex solution (linker scripts) versus a simpler patch.
  • Target-Specific Optimization: Tailoring optimization strategies like section ordering for specific architectures (AVR) where it might be beneficial.
series_id
series_role
standalone
series_parts
[]
tags
  • binutils
  • AVR
  • linker
  • code locality
  • optimization
bugzilla_url
date
2026-07-22T00:00:00.000Z

Re: [patch] AVR: Sort .text.* input sections by their name.

Alan Modra reviews a patch that sorts .text.* input sections by name for the AVR target in binutils, aiming to improve code locality. Modra expresses skepticism, believing this could worsen locality in general cases, especially with -ffunction-sections. He suggests an alternative approach using linker script directives like *(EXCLUDE_FILE(...)) and SORT(.text.*) combined with file exclusions to achieve better control over section placement and code locality.