]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
[PPC64] Backport fix for missing IRELATIVE relocations
authorluporl <luporl@FreeBSD.org>
Wed, 31 Jul 2019 16:22:05 +0000 (16:22 +0000)
committerluporl <luporl@FreeBSD.org>
Wed, 31 Jul 2019 16:22:05 +0000 (16:22 +0000)
commitdbdc8f667e9011a367b321102f54d3acba7416aa
tree450369b8cd09d014ba322db311ff195a5ccabdda
parentfb8c9ef8339d80750d77ecc6f6a5d84ea9d129b2
[PPC64] Backport fix for missing IRELATIVE relocations

This is a backport of LLVM commit 8331f61a51a7a0a1efbf5ed398e181593023d151,
llvm-svn: 353981:

ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an
IRELATIVE where possible.

This is needed in order to make ifuncs work correctly on PPC64.

It fixes an issue with lld, in which it would skip emitting necessary IRELATIVE
relocations.  Without this change, indirect calls to ifuncs would result in a
segmentation fault, in static binaries or when defined in the main binary
(outside shared libraries).

This change also reverts the local
"Preserve relocations against ifuncs when -zifunc-noplt" commit and
replaces it by its upstream version, as part of the merge.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D21102
contrib/llvm/tools/lld/ELF/Config.h
contrib/llvm/tools/lld/ELF/Driver.cpp
contrib/llvm/tools/lld/ELF/InputSection.cpp
contrib/llvm/tools/lld/ELF/Relocations.cpp
contrib/llvm/tools/lld/ELF/Relocations.h
contrib/llvm/tools/lld/ELF/Symbols.cpp
contrib/llvm/tools/lld/ELF/Symbols.h
contrib/llvm/tools/lld/ELF/SyntheticSections.cpp
contrib/llvm/tools/lld/ELF/Writer.cpp