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

            Bug ID: 18759
           Summary: R_OR1K_*_PCREL should have pcrel_offset=TRUE
           Product: binutils
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: whitequark at whitequark dot org
  Target Milestone: ---

Created attachment 8474
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8474&action=edit
Patch

Currently, the OpenRISC1000 relocations R_OR1K_{8,16,32}_PCREL have pc_relative
set to TRUE and pcrel_offset to FALSE. This causes incorrect linking of
.eh_frame and .gcc_except_table sections, which typically contain PC-relative
data relocations when the source file is compiled with -fPIC: with
pcrel_offset=FALSE, the relocation value is the difference between the section
start and the target, and with pcrel_offset=TRUE, the value is the difference
between the relocation position and its target. DWARF specifies the latter.

This appears to be a copy-paste bug, since the target after which elf-or1k.c
was patterned, microblaze, has pcrel_offset=TRUE for *_{8,16,32}_PCREL
relocations, as do most other targets.

It has likely gone unnoticed because no one has used exceptions with OpenRISC
before.

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

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to