[PATCH] RISC-V: define elf_backend_dtrel_excludes_plt

Project / Subsystem

binutils / risc-v

Date

2026-07-24

Proposer

wangjue <juewang@linux.alibaba.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • ABI Compliance: Ensuring RISC-V's ELF object file generation adheres to expected behavior for dynamic linking and toolchain compatibility.
  • Tool Compatibility: Fixing issues that cause incorrect behavior in downstream tools that parse ELF structures independently.
  • Code Locality: Indirectly improving code locality by ensuring proper symbol resolution and section handling.

All attributes

project
binutils
subsystem
risc-v
patch_id
discussion_id
20260724012642.21997-1-juewang@linux.alibaba.com
source_type
public_inbox
title
[PATCH] RISC-V: define elf_backend_dtrel_excludes_plt
headline
RISC-V: define elf_backend_dtrel_excludes_plt
tldr
RISC-V binutils patch defines elf_backend_dtrel_excludes_plt to correctly handle DT_RELASZ, preventing double processing by tools like llvm-bolt.
proposer
wangjue <juewang@linux.alibaba.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • ABI Compliance: Ensuring RISC-V's ELF object file generation adheres to expected behavior for dynamic linking and toolchain compatibility.
  • Tool Compatibility: Fixing issues that cause incorrect behavior in downstream tools that parse ELF structures independently.
  • Code Locality: Indirectly improving code locality by ensuring proper symbol resolution and section handling.
series_id
series_role
standalone
series_parts
[]
tags
  • binutils
  • RISC-V
  • ELF
  • linker
  • relocation
bugzilla_url
date
2026-07-24T00:00:00.000Z

[PATCH] RISC-V: define elf_backend_dtrel_excludes_plt

This patch defines elf_backend_dtrel_excludes_plt for the RISC-V port in binutils, correcting how DT_RELASZ is calculated. Previously, it incorrectly included .rela.plt sections, causing aliasing issues when .rela.dyn was empty. This led to tools like llvm-bolt processing sections twice. Defining the macro ensures DT_RELASZ excludes .rela.plt, aligning with other targets and resolving the aliasing problem.