From owner-freebsd-ppc@freebsd.org Sat Dec 30 00:19:03 2017 Return-Path: Delivered-To: freebsd-ppc@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 5D94EE8511F for ; Sat, 30 Dec 2017 00:19:03 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-112.reflexion.net [208.70.210.112]) (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 055363FD8 for ; Sat, 30 Dec 2017 00:19:02 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1110 invoked from network); 30 Dec 2017 00:18:56 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 30 Dec 2017 00:18:56 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Fri, 29 Dec 2017 19:18:56 -0500 (EST) Received: (qmail 20260 invoked from network); 30 Dec 2017 00:18:55 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 30 Dec 2017 00:18:55 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id E19BCEC9398; Fri, 29 Dec 2017 16:18:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Is the clang 5.0.1 use of .rela.plt and R_PPC64_JMP_SLOT for kernel modules a llvm issue? Just a FreeBSD one? From: Mark Millard In-Reply-To: Date: Fri, 29 Dec 2017 16:18:54 -0800 Cc: FreeBSD PowerPC ML , FreeBSD Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <2BD5FD21-95E7-4661-B8B9-2FDCDB986149@dsl-only.net> References: <39C042C5-9800-464C-84AC-677DB45DA1C1@dsl-only.net> <244D5C85-E1E7-4349-A46A-1D275D54833F@dsl-only.net> <55A9388E-2C04-4388-A4E9-F25574FAF129@dsl-only.net> <68EA105F-3ADF-4CBB-BD59-7A9F18E52DB3@dsl-only.net> <313C2310-ABEF-4BEE-A853-A9965680C3AC@dsl-only.net> To: Ed Maste , Dimitry Andric , Justin Hibbits , Nathan Whitehorn X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:19:03 -0000 I've not been able to figure out if I should submit something into llvm's bugzilla for the powerpc64 switching to .rela.plt and R_PPC64_JMP_SLOT for kernel modules from the earlier .rela.dyn and R/PPC64_RELATIVE and R_PPC64_ADDR64 for kernel modules. (I do not know if powerpc would also have the issue since other things have been stopping that build for a long time.) Do one or more of you have a clue? Reminder: I have submitted FreeBSD bugzilla 224561 for the issue. The difference in the likes of filemon.ko produced by system clang 5.0.1 vs. devel/powerpc64-xtoolchain-gcc is. . . clang 5.0.1: Relocation section with addend (.rela.plt): r_offset r_info r_type st_value st_name + = r_addend 000000014480 000300000015 R_PPC64_JMP_SLOT 0000000000000000 copyinstr = + 0 000000014488 000400000015 R_PPC64_JMP_SLOT 0000000000000000 = devfs_set_cdevpriv + 0 . . . vs. devel/powerpc64-xtoolchain-gcc: Relocation section with addend (.rela.dyn): r_offset r_info r_type st_value st_name + = r_addend 0000000145c0 000000000016 R_PPC64_RELATIVE 0000000000000000 + 40d0 0000000145e0 000000000016 R_PPC64_RELATIVE 0000000000000000 + 145b0 . . . 000000014408 000600000026 R_PPC64_ADDR64 0000000000000000 sysent + = 0 000000014410 001100000026 R_PPC64_ADDR64 0000000000000000 = freebsd32_sysent + 0 Apparently R_PPC64_JMP_SLOT is mishandled and does not explicitly lead to rejection of the attempted dynamic load. It might be an issue if .rela.plt and R_PPC64_JMP_SLOT should even be generated instead of .rela.dyn and R_PPC64_RELATIVE and R_PPC64_ADDR64. =3D=3D=3D Mark Millard markmi at dsl-only.net