From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,LOTS_OF_MONEY, MAILING_LIST_MULTI,MONEY_NOHTML,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D13C433DB for ; Wed, 13 Jan 2021 10:17:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F349206EC for ; Wed, 13 Jan 2021 10:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbhAMKR0 (ORCPT ); Wed, 13 Jan 2021 05:17:26 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:56107 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbhAMKRZ (ORCPT ); Wed, 13 Jan 2021 05:17:25 -0500 Date: Wed, 13 Jan 2021 10:16:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610533002; bh=sagEb4FSciHpuF7KnzebH5pdU2XwaUc8mW9H7JIBct0=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=EOEo6r1PznGwaYYnKKtdkqlbesj8l4RIr0S/RiZTV3I+mraabFQHiotI0xL2vhVBt hmDpg1ZNLu3aErLdgfYXS1Ri3LyuGVpsb5oLErdzLq4oyxdUfvVRgDUW0N03vgkjz6 d6SqCvQRjnihmhDN6HAFAZDm4y4fZfk8cL/JrrQKBOCP0m4A+bBAdcR0bX7pfET5Mq pUbx1sG07z62IXPnaJGodXCAICEqF124qQ2YwGxtcClefOFs36HEhRyJhSsakpYngb iu8Kff07VfNLlWqq2AuGtkqyTcty82QHq6DFoWEhk5jL1plylCCPiSaw1Gd/ChCm4t yvjemgqdVDldw== To: Nick Desaulniers From: Alexander Lobakin Cc: Alexander Lobakin , Fangrui Song , clang-built-linux , linux-mips@vger.kernel.org, Thomas Bogendoerfer , Ralf Baechle , LKML , linux-arch Reply-To: Alexander Lobakin Subject: Re: [BUG mips llvm] MIPS: malformed R_MIPS_{HI16,LO16} with LLVM Message-ID: <20210113101623.3020-1-alobakin@pm.me> In-Reply-To: References: <20210109171058.497636-1-alobakin@pm.me> <20210109191457.786517-1-alobakin@pm.me> <20210111204936.17905-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Desaulniers Date: Tue, 12 Jan 2021 14:14:58 -0800 > On Mon, Jan 11, 2021 at 12:50 PM Alexander Lobakin wrote= : >> >>> The disassembly for me produces: >>> 399c: 3c 03 00 00 lui $3, 0 >>> 0000399c: R_MIPS_HI16 .text >>> ... >>> 39a8: 24 63 3a 5c addiu $3, $3, 14940 >>> 000039a8: R_MIPS_LO16 .text >> >> So, in your case the values of the instructions that relocs refer are: >> >> 0x3c030000 R_MIPS_HI16 >> 0x24633a5c R_MIPS_LO16 >> >> Mine were: >> >> 0x3c010000 >> 0x24339444 >> >> Your second one doesn't have bit 15 set, so I think this pair won't >> break the code. >> Try to hunt for R_MIPS_LO16 that have this bit set, i.e. they have >> '8', '9', 'a', 'b', 'c', 'd' or 'e' as their [15:12]. > > I don't think any of my R_MIPS_LO16 in that file have that bit set. > See attached. Well, seems like you got lucky here. You can try to check for other modules if any of them have R_MIPS_LO16 with bit 15 set. Also, you can try to enable: CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=3Dy CONFIG_TRIM_UNUSED_KSYMS=3Dy to alter the build process. These options didn't change anything in terms of relocs for me though. > -- > Thanks, > ~Nick Desaulniers Thanks, Al