Author: emaste
Date: Tue Oct  2 22:51:24 2018
New Revision: 339100
URL: https://svnweb.freebsd.org/changeset/base/339100

Log:
  MFC r338682: lld: add -z interpose support
  
  -z interpose sets the DF_1_INTERPOSE flag, marking the object as an
  interposer.
  
  PR:           230604
  Relnotes:     Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/contrib/llvm/tools/lld/ELF/Config.h
  stable/11/contrib/llvm/tools/lld/ELF/Driver.cpp
  stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp
  stable/11/usr.bin/clang/lld/ld.lld.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/llvm/tools/lld/ELF/Config.h
==============================================================================
--- stable/11/contrib/llvm/tools/lld/ELF/Config.h       Tue Oct  2 21:40:57 
2018        (r339099)
+++ stable/11/contrib/llvm/tools/lld/ELF/Config.h       Tue Oct  2 22:51:24 
2018        (r339100)
@@ -153,6 +153,7 @@ struct Configuration {
   bool ZExecstack;
   bool ZHazardplt;
   bool ZIfuncnoplt;
+  bool ZInterpose;
   bool ZNocopyreloc;
   bool ZNodelete;
   bool ZNodlopen;

Modified: stable/11/contrib/llvm/tools/lld/ELF/Driver.cpp
==============================================================================
--- stable/11/contrib/llvm/tools/lld/ELF/Driver.cpp     Tue Oct  2 21:40:57 
2018        (r339099)
+++ stable/11/contrib/llvm/tools/lld/ELF/Driver.cpp     Tue Oct  2 22:51:24 
2018        (r339100)
@@ -670,6 +670,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
   Config->ZExecstack = hasZOption(Args, "execstack");
   Config->ZHazardplt = hasZOption(Args, "hazardplt");
   Config->ZIfuncnoplt = hasZOption(Args, "ifunc-noplt");
+  Config->ZInterpose = hasZOption(Args, "interpose");
   Config->ZNocopyreloc = hasZOption(Args, "nocopyreloc");
   Config->ZNodelete = hasZOption(Args, "nodelete");
   Config->ZNodlopen = hasZOption(Args, "nodlopen");

Modified: stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp
==============================================================================
--- stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp  Tue Oct  2 
21:40:57 2018        (r339099)
+++ stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp  Tue Oct  2 
22:51:24 2018        (r339100)
@@ -1034,6 +1034,8 @@ template <class ELFT> void DynamicSection<ELFT>::final
   uint32_t DtFlags1 = 0;
   if (Config->Bsymbolic)
     DtFlags |= DF_SYMBOLIC;
+  if (Config->ZInterpose)
+    DtFlags1 |= DF_1_INTERPOSE;
   if (Config->ZNodelete)
     DtFlags1 |= DF_1_NODELETE;
   if (Config->ZNodlopen)

Modified: stable/11/usr.bin/clang/lld/ld.lld.1
==============================================================================
--- stable/11/usr.bin/clang/lld/ld.lld.1        Tue Oct  2 21:40:57 2018        
(r339099)
+++ stable/11/usr.bin/clang/lld/ld.lld.1        Tue Oct  2 22:51:24 2018        
(r339100)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 22, 2018
+.Dd September 14, 2018
 .Dt LD.LLD 1
 .Os
 .Sh NAME
@@ -450,6 +450,12 @@ be applied by a run-time loader.
 Note that this feature requires special loader support and will
 generally result in application crashes when used outside of freestanding
 environments.
+.It Cm interpose
+Set the
+.Dv DF_1_INTERPOSE
+flag to indicate that the object is an interposer.
+Runtime linkers perform symbol resolution by first searching the application,
+followed by interposers, and then any other dependencies.
 .It Cm muldefs
 Do not error if a symbol is defined multiple times.
 The first definition will be used.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to