https://sourceware.org/bugzilla/show_bug.cgi?id=34233

            Bug ID: 34233
           Summary: [RISC-V] GNU ld.bfd Zicfiss report option ignored
           Product: binutils
           Version: 2.45
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: l784896635 at gmail dot com
  Target Milestone: ---

I ran into this while reducing a RISC-V linker testcase. The reproducer is
already quite small, and I have been seeing the same result consistently across
three reruns.

Summary
=======
Current GNU ld.bfd 2.45 links the legal shared object successfully but warns
`-z zicfiss-report=warning ignored`. ld.lld 22.1.0 accepts the same option and
emits the semantic warning that `f2.o` lacks
`GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS`.

Expected behavior
=================
Validate a legal RV64 shared-object link with `-z zicfiss-report=warning`, so
the linker must diagnose missing `CFI_SS` properties instead of treating the
option itself as unsupported.

Environment
===========
- product: binutils
- component: ld
- toolchain route: llvm-mc 22 plus current GNU ld.bfd 2.45 with ld.lld 22
control
- march: rv64i
- mabi: lp64
- first failing stage: link

Reduced testcase
================
--- f1-s.s ---
.section ".note.gnu.property", "a"
.balign 8
.4byte 4
.4byte (ndesc_end - ndesc_begin)
.4byte 0x5        // NT_GNU_PROPERTY_TYPE_0
.asciz "GNU"
ndesc_begin:
.balign 8
.4byte 0xc0000000 // GNU_PROPERTY_RISCV_FEATURE_1_AND
.4byte 4
.4byte 2          // GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS
.balign 8
ndesc_end:

.text
.globl _start
.type f1,%function
f1:
  call f2
  ret

--- f2.s ---
.text
.globl f2
.type f2,@function
f2:
  .globl f3
  .type f3, @function
  call f3
  ret

--- f3-s.s ---
.section ".note.gnu.property", "a"
.balign 8
.4byte 4
.4byte (ndesc_end - ndesc_begin)
.4byte 0x5        // NT_GNU_PROPERTY_TYPE_0
.asciz "GNU"
ndesc_begin:
.balign 8
.4byte 0xc0000000 // GNU_PROPERTY_RISCV_FEATURE_1_AND
.4byte 4
.4byte 2          // GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS
.balign 8
ndesc_end:

.text
.globl f3
.type f3,@function
f3:
  ret

Reproduction notes
==================
- This packaged root does not have a single canonical `run.ps1` wrapper.
- Use the reduced inputs under `case/` and follow the commands documented in
`case/README.md`.
- Stable witness outputs, when present, are preserved under
`verify/run1..run3/`.

What I checked
==============
- Reduced inputs are preserved under case/.
- Stable witness outputs are preserved under verify/run1..run3/.
- The strict recheck says stable normalized run signatures across three runs:
True.
- Tracker guidance link:
https://sourceware.org/binutils/docs/ld/Bug-Reporting.html
- evidence summary: 3 clean reproductions under
hunt/verify/bfd_zicfiss_report_option_ignored/run1..run3 are stable by hash. In
every run, the three assemblies succeed, `bfd.rc.txt` is 0 with the same
ignored-option `bfd.stderr.txt` hash, and `lld22.stderr.txt` is stable and
names `f2.o` plus the missing `CFI_SS` property instead of warning about the
option spelling itself.

Notes
=====
upstream/llvm-project/lld/test/ELF/riscv-feature-zicfiss.s

Root key: bfd.riscv.zicfiss_report_option_ignored
Case id: 20260528-bfd-zicfiss-report-option-ignored

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to