Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp238315pxb; Wed, 13 Jan 2021 02:20:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3qE5sVdGBgdMZokHwoh+IkGsdr/cdYnfrECg7aRSrw9+y13F63afnDN5s41WZ7G/4ITRH X-Received: by 2002:a17:906:1288:: with SMTP id k8mr1040396ejb.206.1610533206089; Wed, 13 Jan 2021 02:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610533206; cv=none; d=google.com; s=arc-20160816; b=RUPkin7gjkR1TgsfsGuTOQW0/XVc1mbwKcKWVyFT6lll2h9bSVRqsF5fgM7OUxmQI1 pX3S2hdVr6UIvuX0aY1gzTh4Z3kY0htM/t2Mh9Dl6R8zx+Ony24LZRos/lvWhfXjQ7VX wOceQjVwrNWED+9DyHJz2XycOkw43xiPG2xKzc0+FQe97Ae+Wjkq65yhkY03y/1lcdX+ vrFYLh+cxqwmy6ntShT/HrzlzCXgaKUGZDz9xMLVH3g4YKe0LgwkGXJkaKEhDTZsy2IA erqY13HRrc7MOwJdFlW7IYHNJ3qYZIoRIvQrBWJZ9pZWnqSHaCjxCUXDecUqcPqqeVvI hh5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=sagEb4FSciHpuF7KnzebH5pdU2XwaUc8mW9H7JIBct0=; b=T0C1xPqGb1ACbG9kmG/gAy5WRBBjxe2WooYhReTCh3G2C0rEnvNOaLBpQsd47rdf0I eIOK8IkOn1wJ5unLHzUraVVhJAf/AmCo1CPTJhyEwLiZJF/sZBmZK/J+xwptUUDqggf+ bN+c2yczN/e2AF5niGAgaR6QaxPSKqivNjC+11B/ty8gJybpZ0wisSI9wG29Gnt8TXQk ymmsNqqElYr66dJm+DKd94lv9DQTCEe+1HnYWt9wmlnfEm2p7mlT9zddtWaVRrDoDnOv +YEQPqY/6KP5bd7HT2KG2RCZAubebGQ82O/jA0e22dJAE3b6aX/pv3WIo1ikbY+hKPlb RQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=EOEo6r1P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z40si964842ede.39.2021.01.13.02.19.42; Wed, 13 Jan 2021 02:20:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=EOEo6r1P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbhAMKRZ (ORCPT + 99 others); Wed, 13 Jan 2021 05:17:25 -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 X-Spam-Status: No, score=0.8 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LOTS_OF_MONEY,MONEY_NOHTML shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch 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