From owner-svn-src-head@freebsd.org Wed Mar 18 20:38:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D8E426C46A; Wed, 18 Mar 2020 20:38:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48jMLd05pyz4H1Y; Wed, 18 Mar 2020 20:38:16 +0000 (UTC) (envelope-from dim@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 846682797D; Wed, 18 Mar 2020 20:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02IKcGpK093696; Wed, 18 Mar 2020 20:38:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02IKcGue093694; Wed, 18 Mar 2020 20:38:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202003182038.02IKcGue093694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 18 Mar 2020 20:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359085 - head/contrib/llvm-project/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/lld/ELF X-SVN-Commit-Revision: 359085 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.29 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: Wed, 18 Mar 2020 20:38:18 -0000 Author: dim Date: Wed Mar 18 20:38:15 2020 New Revision: 359085 URL: https://svnweb.freebsd.org/changeset/base/359085 Log: Merge commit 315f8a55f from llvm git (by Fangrui Song): [ELF][PPC32] Don't report "relocation refers to a discarded section" for .got2 Similar to D63182 [ELF][PPC64] Don't report "relocation refers to a discarded section" for .toc Reviewed By: Bdragon28 Differential Revision: https://reviews.llvm.org/D75419 This is needed to fix compile errors when building for ppc32/lld10. Requested by: bdragon MFC after: 6 weeks X-MFC-With: 358851 Differential Revision: https://reviews.freebsd.org/D24110 Modified: head/contrib/llvm-project/lld/ELF/InputSection.cpp head/contrib/llvm-project/lld/ELF/Relocations.cpp Modified: head/contrib/llvm-project/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.cpp Wed Mar 18 20:28:26 2020 (r359084) +++ head/contrib/llvm-project/lld/ELF/InputSection.cpp Wed Mar 18 20:38:15 2020 (r359085) @@ -438,12 +438,13 @@ void InputSection::copyRelocations(uint8_t *buf, Array // hopefully creates a frame that is ignored at runtime. Also, don't warn // on .gcc_except_table and debug sections. // - // See the comment in maybeReportUndefined for PPC64 .toc . + // See the comment in maybeReportUndefined for PPC32 .got2 and PPC64 .toc auto *d = dyn_cast(&sym); if (!d) { if (!sec->name.startswith(".debug") && !sec->name.startswith(".zdebug") && sec->name != ".eh_frame" && - sec->name != ".gcc_except_table" && sec->name != ".toc") { + sec->name != ".gcc_except_table" && sec->name != ".got2" && + sec->name != ".toc") { uint32_t secIdx = cast(sym).discardedSecIdx; Elf_Shdr_Impl sec = CHECK(file->getObj().sections(), file)[secIdx]; Modified: head/contrib/llvm-project/lld/ELF/Relocations.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/Relocations.cpp Wed Mar 18 20:28:26 2020 (r359084) +++ head/contrib/llvm-project/lld/ELF/Relocations.cpp Wed Mar 18 20:38:15 2020 (r359085) @@ -926,8 +926,12 @@ static bool maybeReportUndefined(Symbol &sym, InputSec // .toc and the .rela.toc are incorrectly not placed in the comdat. The ELF // spec says references from outside the group to a STB_LOCAL symbol are not // allowed. Work around the bug. - if (config->emachine == EM_PPC64 && - cast(sym).discardedSecIdx != 0 && sec.name == ".toc") + // + // PPC32 .got2 is similar but cannot be fixed. Multiple .got2 is infeasible + // because .LC0-.LTOC is not representable if the two labels are in different + // .got2 + if (cast(sym).discardedSecIdx != 0 && + (sec.name == ".got2" || sec.name == ".toc")) return false; bool isWarning =