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

            Bug ID: 34270
           Summary: [RISC-V] GNU ld.bfd preemptible external-function
                    PC-relative address-taking is not redirected to PLT in
                    PIE on RISC-V
           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 16779
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16779&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 already canonicalizes the non-PIE executable control:
the final executable keeps `R_RISCV_JUMP_SLOT foo`, gives undefined `foo` a
non-zero `foo@plt` value in `.dynsym`, and resolves the `%pcrel_hi/%pcrel_lo`
pair to that same PLT address.
Expected: Link a valid RISC-V main image against a separate shared object that
exports ordinary default-visible function `foo`, while the main image both
calls `foo` and materializes `&foo` with a plain `%pcrel_hi(foo)` plus
`%pcrel_lo` sequence.

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

Reply via email to