From owner-freebsd-toolchain@freebsd.org Sat Jul 22 22:21:17 2017 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 548E0DAE9CC for ; Sat, 22 Jul 2017 22:21:17 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-38.reflexion.net [208.70.210.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C4AD673FE for ; Sat, 22 Jul 2017 22:21:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 11916 invoked from network); 22 Jul 2017 22:14:35 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 22 Jul 2017 22:14:35 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Sat, 22 Jul 2017 18:14:35 -0400 (EDT) Received: (qmail 7241 invoked from network); 22 Jul 2017 22:14:35 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 22 Jul 2017 22:14:35 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 72AF1EC8173; Sat, 22 Jul 2017 15:14:34 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: A powerpc64 clang 4 vs. clang 5 patch difference for PltRel and GotRel for ELF Message-Id: Date: Sat, 22 Jul 2017 15:14:33 -0700 To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 22:21:17 -0000 I have been using the following personal patch for the clang 4 environment: # svnlite diff contrib/llvm/tools/lld/ELF/Target.cpp Index: contrib/llvm/tools/lld/ELF/Target.cpp =================================================================== --- contrib/llvm/tools/lld/ELF/Target.cpp (revision 321109) +++ contrib/llvm/tools/lld/ELF/Target.cpp (working copy) @@ -1070,7 +1070,8 @@ } PPC64TargetInfo::PPC64TargetInfo() { - PltRel = GotRel = R_PPC64_GLOB_DAT; + GotRel = R_PPC64_GLOB_DAT; + PltRel = R_PPC64_JMP_SLOT; RelativeRel = R_PPC64_RELATIVE; GotEntrySize = 8; GotPltEntrySize = 8; (This was not sufficient for lld to work overall but was definitely required --possibly it should have some sort conditional status making the change FreeBSD specific.) In clang 5 the code has moved: # svnlite diff /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp Index: /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp =================================================================== --- /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp (revision 321371) +++ /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp (working copy) @@ -60,7 +60,8 @@ static uint16_t applyPPCHighesta(uint64_t V) { return (V + 0x8000) >> 48; } PPC64::PPC64() { - PltRel = GotRel = R_PPC64_GLOB_DAT; + GotRel = R_PPC64_GLOB_DAT; + PltRel = R_PPC64_JMP_SLOT; RelativeRel = R_PPC64_RELATIVE; GotEntrySize = 8; GotPltEntrySize = 8; (So far I'm just guessing that the patch would still be required. I've barely started rebuilds.) === Mark Millard markmi at dsl-only.net