Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4590614ybb; Tue, 7 Apr 2020 10:23:49 -0700 (PDT) X-Google-Smtp-Source: APiQypKUt2fdBRHr3mf2g7nKrnB36tcYK9Sn1td+34x464R0qHZolE+zRZ+A4qAqRsewaMBONx06 X-Received: by 2002:a4a:d88b:: with SMTP id b11mr2822608oov.42.1586280229719; Tue, 07 Apr 2020 10:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586280229; cv=none; d=google.com; s=arc-20160816; b=e8womWty46RkAfwqZoUG7/cb3+5bpX5SCKPTBGW0ahdzA64Lh/r6Ba69HRtDhMH5vs z0+DbyOnrMwBUmE1YslKvWPysyXOvlM6vaZN1+R7dKpqTnq4vUAlixHDGqpSOBaDbSrT fvu/JS4BpZGztVduMjY01i1tWvYYFMtx/9kHU9dFap0QOv7dOwMpYWULGK5k+Bajf5lU Dkqh5gnCMa9oI7Lql5KisVxJfZTgwYFvU/V9ZK8Tj0hQbIBMY6VPT25+YfzCMZgp/EQZ VrUuS1OLbvyoNK/ojI7dwZz8FGRyIUTHOx3hdc03ntvLyo2T0PbgTytrX4IlaRBAT+Pe kK1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1WtbWNWaVQeVcZQhFvV6urZvQa34yJxf2HAD/pRyZ2g=; b=c5wfo0Pg0W8bnjArOVOe6KhfZiuvgr418ZD+Sk7PKb8ZicWu7ex74ctmNm28NVPis+ OMp9UGbYyxNxOG8aObvWyMuUYnrn4ZhfYCfSKcTuGfAedqF30tGSIX2krcVKtjGOmjJv PHLCcdu++pLw9+G77SQiU+bPSMOp/xw+dvHXDyGKK3IMy2VQT2MKzG904JtGKZs+V2VG X4qlfT3eJoU0bMxcoXR4fG0wJtmb59/+WA0/ppmM0pADc6GWM9pe9/+LA8hOJYV/8QGN 8crhZCRAB+9dghos0wyKgGeu/xnbu91HOCs+oLm/24H0k0RnoPviTz+vDgHyOB3+9n6p 7SSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="A//evzdq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185si880822oif.274.2020.04.07.10.23.34; Tue, 07 Apr 2020 10:23:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="A//evzdq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgDGRWK (ORCPT + 99 others); Tue, 7 Apr 2020 13:22:10 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43239 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbgDGRWJ (ORCPT ); Tue, 7 Apr 2020 13:22:09 -0400 Received: by mail-pf1-f194.google.com with SMTP id f206so1098104pfa.10 for ; Tue, 07 Apr 2020 10:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1WtbWNWaVQeVcZQhFvV6urZvQa34yJxf2HAD/pRyZ2g=; b=A//evzdq82feuNT1S0w8k6MnJEEgUVxfRf/ZPEKgZFogbwDEvZLLPyDFNw0npeOZE5 aRr9ZB2Ag7cqmATU1j0bo3Wsr9iuVhfezrnQhiBXKR5Qn3cayuIJw4byB9yoMTOHeK9m xmG1Lm1Str+uHFCOq12fN/67aoXI6Zue8Qz8W4KcZUHv34DKYKYFue+/y+eFMX4/QnpY VH3napxV2cFMjS4+29S9lFxw3fYj3Mqn+9ZltSjfk93fVTAIPfDgl0YX3Ig0I0pfOUcj ge/euJffA/n7846Mso1XK6t30DA3z/YmMYCscvFdHLmRYcxL8lWrHs92/hQ1YPhyw1HC OCMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1WtbWNWaVQeVcZQhFvV6urZvQa34yJxf2HAD/pRyZ2g=; b=astr3DqI8HtKTbq3DgiGwRG8bp0GgNdY/wMUweD8UTwZhNWiwWwBhn0I48S9KL/zRv BEM1/MfHdY5aOr7r9LraT2rgFU9xcfDnr2x9NXJ8aUctXIly0u6islh8P7WtlitDssh8 1Gaq+LsrSKiMMzl+CAD7ZyYFNjGUyaWryc9xP4JFI2sOklBj21XQ7C3E2bdzI3kF4GLr 3nJ5doM1nxRE3TcYTPydYV9MM8GL1OULLj08RQ+/ezZ6vZQkoHQ4lLpRlvkc/dtPpUlD yl/Uhgs8/6guOF7u6GbTGSZmy9VtPp9i5Wd4aTOYc5H+lD1acCKBauSgbHU/zNWW2UNG IIOA== X-Gm-Message-State: AGi0PuayJYu04z9yMLcyTfKG0p+FCaTKFJriyvJDSUm2TOtthfS40Kd+ W3bVX7LAlmmTOLv8YZIHXo2pUEJvBSfHPaASKU4zrA== X-Received: by 2002:a63:6604:: with SMTP id a4mr1741195pgc.381.1586280128643; Tue, 07 Apr 2020 10:22:08 -0700 (PDT) MIME-Version: 1.0 References: <20200405082451.694910-1-jiaxun.yang@flygoat.com> <20200407080611.859256-1-jiaxun.yang@flygoat.com> In-Reply-To: <20200407080611.859256-1-jiaxun.yang@flygoat.com> From: Nick Desaulniers Date: Tue, 7 Apr 2020 10:21:56 -0700 Message-ID: Subject: Re: [PATCH v2] MIPS: Truncate load-y into 32bit for 32bit kernel To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, clang-built-linux , Fangrui Song , Nathan Chancellor , Thomas Bogendoerfer , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 7, 2020 at 1:07 AM Jiaxun Yang wrote: > > LLD failed to link vmlinux with 64bit load address for 32bit ELF > while bfd will strip 64bit address into 32bit silently. > To fix LLD build, we should truncate load address provided by platform > into 32bit for 32bit kernel. > > Signed-off-by: Jiaxun Yang > Reviewed-by: Fangrui Song > Tested-by: Nathan Chancellor > > -- > V2: Take MaskRay's shell magic. V2 is way too clever, V1 was much more readable. Can this tag be added to the commit to help us track when and where it lands? Link: https://github.com/ClangBuiltLinux/linux/issues/786 > --- > arch/mips/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/mips/Makefile b/arch/mips/Makefile > index e1c44aed8156..f8fd3c39fb55 100644 > --- a/arch/mips/Makefile > +++ b/arch/mips/Makefile > @@ -286,6 +286,9 @@ ifdef CONFIG_64BIT > $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32) > endif > endif > +else > + # Truncate address into 32-bit > + load-y := 0x$(shell echo "$(load-y)" | rev | head -c 8 | rev) > endif > > KBUILD_AFLAGS += $(cflags-y) > -- -- Thanks, ~Nick Desaulniers