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

            Bug ID: 34255
           Summary: [RISC-V] GNU ld.bfd RISC-V non-default copy relocation
                    loses default alias metadata
           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: ---

Created attachment 16764
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16764&action=edit
Reduced testcase

I reduced this to the attached RISC-V testcase and can reproduce it 3/3 times.
Observed: GNU ld.bfd 2.45 links successfully but, when the copied symbol is
requested through the non-default alias `foo@VER_1`, the final executable keeps
only `foo@VER_1` in `.dynsym` and only `VER_1` in `.gnu.version_r` even though
the provider DSO also exports same-address default alias `foo@VER_3`.
Expected: Link valid RISC-V non-PIE executables against a DSO that defines a
non-default object version `foo@VER_1` and a same-address default alias
`foo@@VER_3`, while the executable requests the non-default symbol with
`.symver foo_ref, foo@VER_1` and forms a plain address reference that triggers
a linker-generated `R_RISCV_COPY`.

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

Reply via email to