ports/devel/llvm70/files/lld/patch-head-r338682.diff
Brooks Davis d38df13120 Add all patches from base llvm/clang/lld/lldb 7.0 to devel/llvm70
This adds all the patches that were applied in the past to the
clang700-import branch, under contrib/llvm. After these, there only
minimal diffs left between the port sources and the base sources.

Most of these remaining diffs are due to #ifdef shortcuts in the base
sources, because we don't compile certain features in. Other diffs are
because the port has applied a few changes that we don't have in base.

Also switch to the common LICENSE defintion in devel/llvm-devel and
chase new USE_GNOME requirements (for libxml2).

PR:	212343, 230604
Submitted by:	dim
MFH:		2018Q4
Differential Revision:	https://reviews.freebsd.org/D17709
2018-11-01 17:47:32 +00:00

65 lines
2.5 KiB
Diff

r338682 | emaste | 2018-09-14 17:15:16 +0200 (Fri, 14 Sep 2018) | 16 lines
lld: add -z interpose support
-z interpose sets the DF_1_INTERPOSE flag, marking the object as an
interposer.
Committed upstream as LLVM r342239.
PR: 230604
Reported by: jbeich
Reviewed by: markj
Approved by: re (kib)
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17172
Index: tools/lld/ELF/Config.h
===================================================================
--- tools/lld/ELF/Config.h (revision 338681)
+++ tools/lld/ELF/Config.h (revision 338682)
@@ -183,6 +183,7 @@ struct Configuration {
bool ZHazardplt;
bool ZIfuncnoplt;
bool ZInitfirst;
+ bool ZInterpose;
bool ZKeepTextSectionPrefix;
bool ZNodelete;
bool ZNodlopen;
Index: tools/lld/ELF/Driver.cpp
===================================================================
--- tools/lld/ELF/Driver.cpp (revision 338681)
+++ tools/lld/ELF/Driver.cpp (revision 338682)
@@ -339,7 +339,7 @@ static bool getZFlag(opt::InputArgList &Args, StringRe
static bool isKnown(StringRef S) {
return S == "combreloc" || S == "copyreloc" || S == "defs" ||
S == "execstack" || S == "hazardplt" || S == "ifunc-noplt" ||
- S == "initfirst" ||
+ S == "initfirst" || S == "interpose" ||
S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
S == "nodlopen" || S == "noexecstack" ||
@@ -846,6 +846,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
Config->ZHazardplt = hasZOption(Args, "hazardplt");
Config->ZIfuncnoplt = hasZOption(Args, "ifunc-noplt");
Config->ZInitfirst = hasZOption(Args, "initfirst");
+ Config->ZInterpose = hasZOption(Args, "interpose");
Config->ZKeepTextSectionPrefix = getZFlag(
Args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
Config->ZNodelete = hasZOption(Args, "nodelete");
Index: tools/lld/ELF/SyntheticSections.cpp
===================================================================
--- tools/lld/ELF/SyntheticSections.cpp (revision 338681)
+++ tools/lld/ELF/SyntheticSections.cpp (revision 338682)
@@ -1266,6 +1266,8 @@ template <class ELFT> void DynamicSection<ELFT>::final
DtFlags |= DF_SYMBOLIC;
if (Config->ZInitfirst)
DtFlags1 |= DF_1_INITFIRST;
+ if (Config->ZInterpose)
+ DtFlags1 |= DF_1_INTERPOSE;
if (Config->ZNodelete)
DtFlags1 |= DF_1_NODELETE;
if (Config->ZNodlopen)