From owner-svn-src-head@freebsd.org Thu Oct 11 13:19:18 2018 Return-Path: Delivered-To: svn-src-head@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 3274510BAA38; Thu, 11 Oct 2018 13:19:18 +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 D731D97B71; Thu, 11 Oct 2018 13:19:17 +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 C3BC210E9F; Thu, 11 Oct 2018 13:19:17 +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 w9BDJHmT080252; Thu, 11 Oct 2018 13:19:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9BDJH3Q080250; Thu, 11 Oct 2018 13:19:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810111319.w9BDJH3Q080250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Oct 2018 13:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339304 - in head: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/llvm/tools/lld/ELF lib/clang/include/lld/Common X-SVN-Commit-Revision: 339304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2018 13:19:18 -0000 Author: emaste Date: Thu Oct 11 13:19:17 2018 New Revision: 339304 URL: https://svnweb.freebsd.org/changeset/base/339304 Log: lld: set sh_link and sh_info for .rela.plt sections ELF spec says that for SHT_REL and SHT_RELA sh_link should reference the associated string table and sh_info should reference the "section to which the relocation applies." ELF Tool Chain's elfcopy / strip use this (in part) to control whether or not the relocation entry is copied to the output. LLVM PR 37538 https://bugs.llvm.org/show_bug.cgi?id=37538 Approved by: re (kib) Obtained from: llvm r344226 (backported for 6.0) Modified: head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp head/lib/clang/include/lld/Common/Version.inc Modified: head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Oct 11 08:14:31 2018 (r339303) +++ head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Oct 11 13:19:17 2018 (r339304) @@ -1213,11 +1213,13 @@ void RelocationBaseSection::addReloc(const DynamicRelo void RelocationBaseSection::finalizeContents() { // If all relocations are R_*_RELATIVE they don't refer to any // dynamic symbol and we don't need a dynamic symbol table. If that - // is the case, just use 0 as the link. - Link = InX::DynSymTab ? InX::DynSymTab->getParent()->SectionIndex : 0; + // is the case, just use the index of the regular symbol table section. + getParent()->Link = InX::DynSymTab ? + InX::DynSymTab->getParent()->SectionIndex : + InX::SymTab->getParent()->SectionIndex; - // Set required output section properties. - getParent()->Link = Link; + if (InX::RelaIplt == this || InX::RelaPlt == this) + getParent()->Info = InX::GotPlt->getParent()->SectionIndex; } template Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Thu Oct 11 08:14:31 2018 (r339303) +++ head/lib/clang/include/lld/Common/Version.inc Thu Oct 11 13:19:17 2018 (r339304) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "335540-1200004" +#define LLD_REVISION_STRING "335540-1200005"