Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4131912ybb; Tue, 7 Apr 2020 01:07:57 -0700 (PDT) X-Google-Smtp-Source: APiQypI7+bP+NEPPwie1aHLV0kNK91KfImV4LaVdbaK5cHrGYcS3oBDjgj7Ecal8a2CP29LdH/lC X-Received: by 2002:a9d:3a62:: with SMTP id j89mr539711otc.45.1586246877664; Tue, 07 Apr 2020 01:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586246877; cv=none; d=google.com; s=arc-20160816; b=gQr5Itlhk0AJHdwn4D20SiDcEqUILVXYqYJd5JUy7ZLCgCh8Lc1pfgzgT7KpayoJaI jtynHLf3/FxslAyXG2W0OpzAT7RkBYBl22qf8JNXyAgtVMtE4wZTmVb4KryQLMeqTKFI hYGzF7iDaXgRYvgN9z5HYju7jau6ZoDPlxUwSMEIPIfsYKw3f3CjSouZpFiWHKhh7eOb +xGO05NHhVGIPR4MD6Y6ddhl2O4JnnSsOvxA2cTtriiGi4UXFOkI0TvQiMQiyZblu8uA V3UGqG4oDdv5SWxDmORKTrBVZGIUWryR9MhQYuzBFHb7MjlUxz/maMI/M2yVlbPb2+92 cXbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=Qy5YaNnd6/cM8OXgjkd0XMTuk5DgHT3HQpv5IO5a37w=; b=Gwe9906yR65DiQLu4l0oonBhPrn3JwQFBvr4ObLXCLfnacGOL9oX1AjsPVC2kxT6nw okzNZWdorz0tCKoldMIi96NYhqwhNZpveajz9FKlpN1iflU8AOOhdRuCKOVowenk44TP kGPprloPqbOmxkh3447ezgSOS6vYaARE2UzEwChNfmGGsB9bdEteKcdE4PFQAOEIUGkq qdD6InktDP5s7TXInWftK0536c/efJwOTTgACdAd8bNFvCAHkdc2dfPJe/G/+VK96353 nbPJr3NOYG72rRVT2nHYbXIRkkptVUCEwfyhQO2kQorUCEq0BTtlbB+ZfwPvGladLPV5 vnnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=YCkSRHAH; 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=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si818887ooa.65.2020.04.07.01.07.44; Tue, 07 Apr 2020 01:07:57 -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=@flygoat.com header.s=mail header.b=YCkSRHAH; 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=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbgDGIHO (ORCPT + 99 others); Tue, 7 Apr 2020 04:07:14 -0400 Received: from sender3-op-o12.zoho.com.cn ([124.251.121.243]:17894 "EHLO sender3-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbgDGIHN (ORCPT ); Tue, 7 Apr 2020 04:07:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1586246790; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=Qy5YaNnd6/cM8OXgjkd0XMTuk5DgHT3HQpv5IO5a37w=; b=YCkSRHAHqMkUUFftDERDmv4vI7EHg8/yzLmPN1DHa7HN+LVIWuVazA7x1C4gSP8x q391Xo+iV8OWzWRBGif14vG92yqdG7okaQZ5S5EG1woRPVXUJt4ucjivHWdoFfK34uI zEo0E7kkBKuS/CXdxfYCt3R1QIm6fjR6mY8n2iEI= Received: from localhost.localdomain (39.155.141.144 [39.155.141.144]) by mx.zoho.com.cn with SMTPS id 1586246787690535.912988010464; Tue, 7 Apr 2020 16:06:27 +0800 (CST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , clang-built-linux@googlegroups.com, Fangrui Song , Nathan Chancellor , Thomas Bogendoerfer , linux-kernel@vger.kernel.org Message-ID: <20200407080611.859256-1-jiaxun.yang@flygoat.com> Subject: [PATCH v2] MIPS: Truncate load-y into 32bit for 32bit kernel Date: Tue, 7 Apr 2020 16:06:11 +0800 X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200405082451.694910-1-jiaxun.yang@flygoat.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. --- 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 +=09# Truncate address into 32-bit +=09load-y :=3D 0x$(shell echo "$(load-y)" | rev | head -c 8 | rev) endif =20 KBUILD_AFLAGS=09+=3D $(cflags-y) --=20 2.26.0.rc2