From owner-svn-src-stable@freebsd.org Tue Oct 2 22:51:26 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EDDF10AFFF1; Tue, 2 Oct 2018 22:51:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAC958077B; Tue, 2 Oct 2018 22:51:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5CD76763; Tue, 2 Oct 2018 22:51:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w92MpPfY039765; Tue, 2 Oct 2018 22:51:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w92MpP2H039762; Tue, 2 Oct 2018 22:51:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810022251.w92MpP2H039762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Oct 2018 22:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339100 - in stable/11: contrib/llvm/tools/lld/ELF usr.bin/clang/lld X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11: contrib/llvm/tools/lld/ELF usr.bin/clang/lld X-SVN-Commit-Revision: 339100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2018 22:51:26 -0000 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 void DynamicSection::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.