bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/27203] New: ld ppc: Emit R_PPC64_IRELATIVE instead of R_PPC64_JM


From: i at maskray dot me
Subject: [Bug ld/27203] New: ld ppc: Emit R_PPC64_IRELATIVE instead of R_PPC64_JMP_SLOT for non-preemptible ifunc referenced by a DSO
Date: Mon, 18 Jan 2021 21:30:19 +0000

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

            Bug ID: 27203
           Summary: ld ppc: Emit R_PPC64_IRELATIVE instead of
                    R_PPC64_JMP_SLOT for non-preemptible ifunc referenced
                    by a DSO
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

cat > ./a.s <<eof
resolver:
  nop

.globl ifunc, _start
.type ifunc, @gnu_indirect_function
.set ifunc, resolver

_start:
  bl ifunc
  nop
eof
echo 'bl ifunc; nop' > ./b.s
powerpc64le-linux-gnu-as a.s -o a.o
powerpc64le-linux-gnu-gcc -shared -fpic b.s -o b.so


% ~/Dev/binutils-gdb/out/ppc64le/ld/ld-new a.o b.so -o a
% readelf -Wr a
Relocation section '.rela.plt' at offset 0x228 contains 1 entry:
    Offset             Info             Type               Symbol's Value 
Symbol's Name + Addend
0000000010020010  0000000100000015 R_PPC64_JMP_SLOT       ifunc()         
ifunc + 0


ld should use R_PPC64_IRELATIVE for a non-preemptible ifunc symbol. If I remove
b.so from the linker command line,
R_PPC64_IRELATIVE will be used.


(This just documents a case that ppc64 has not adopted
https://sourceware.org/bugzilla/show_bug.cgi?id=23169)
% readelf -W --dyn-syms a | grep ifunc
     1: 0000000010000260     0 IFUNC   GLOBAL DEFAULT    7 ifunc

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]