Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2851719rdb; Mon, 12 Feb 2024 21:20:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9i6VMv89HoQ9wEW7/tmBFI2ux19J+d9XsWDaXARSmfuHKB8mjWMQAkfxiCfdg4xzdZ5QrpDo/dohEwfoLee3Se2q/nU666a1ns9RFCA== X-Google-Smtp-Source: AGHT+IF5bu9fkjATvkcElmGeMu9IR4ee7VVT8dhn0q6YuzN60Iy+8zsjZews7Rw/qnrovSO6l8nN X-Received: by 2002:a17:906:2a94:b0:a3c:ba16:7e35 with SMTP id l20-20020a1709062a9400b00a3cba167e35mr1349229eje.22.1707801646775; Mon, 12 Feb 2024 21:20:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707801646; cv=pass; d=google.com; s=arc-20160816; b=xHsRFie6mQAQPqwztaeS8XYNDprXHqUCWtLvRRQVwIX2Yi9ySwd/xdxu9I1dj+e/sj 1rVtiPj5kff60U98LYA1iFr6CXOygPz05P8wyG1skx4NOcVsSIiTlL68drI15pwg6akn xWQzbLOe2Hidh2QoMniWecFfZWzprcOz3C6ZaS3QoeWKNnCWU3heZBafM3Hhsdx8Ccwd iDuZJtLSGPz7TkRy5pSxw26TMqFVXDxnWtShXyOup5sthrQZTubuHQiEur67Fz4SBKlJ YtXLfOky9AXSINrBzt5QkskTuoFG1UIOKPqBp5iYHyZ8hxPhtL/24JsBXt8lAWZS3BHB I2vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=jsA6Vin23ehyR7Ij/sBXeXrDTbKj+YLFziDzOlAwThM=; fh=1ZuL6RutQtKmCS9VDDaNgMa6p8OAL1numn5D2yjGvIM=; b=L3skE9pZwIE79ZMFL7PLLFLMBHtefwoksxJHhUfmyZ29nHV+4A5AyN1F0qzd7ZakZ5 i2B6FDVTfWNCxy7lMpcFbQJ64ApNfANOGzXLGguMlvmvvd5deG3pgZXrMHeSgrf5eaXO Yw0Bze8SqrOUJ8P+4WSJFH1XWU+Z1HF/O+3LAPKiSpY1VLVjYzIpzzG6+6+uRx9cqLOd lOO0kP4NEqz8QXvuAlXshX9PaGspGLQQ1k04UAOXtaZghyV8kXQZ+NoSDabfwJ8rurTB TRq05YQxvJAEpHcGnSJ6uT7GyM/iPLaOYKdLU2ookNr9kK6B7E6HTstf6xQpMy8LlxMX +n2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MVeF1qwS; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCV85rVJSXfAE9p7+uMDsACVDjTX9LhZpEuVYwiAK5cwLleYL6uNkoFZUs1lysMgadGutUakoYLN7nOkiE2mpBNgAef4B1xOcXlh2zVTWg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gt40-20020a1709072da800b00a3cf1cb2eb8si541441ejc.869.2024.02.12.21.20.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 21:20:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MVeF1qwS; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 798481F24763 for ; Tue, 13 Feb 2024 05:20:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 290BA11C92; Tue, 13 Feb 2024 05:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MVeF1qwS" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA79F11725 for ; Tue, 13 Feb 2024 05:20:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707801638; cv=none; b=qczTCSOJLki1JZpiBg1UqIz6MevxZXMU9Ci7JdKUxm1fZy14BTsn2GIbUzVv172zAtR7blKNhHeIJKisX4uDM+TfBAcMxubYVc4juwsBY7T6oPBI0xI8rOZpd8d70njyJmZTlvz7r45+WISNBKBuYzkosOmMGQh9Ls6ExU11Mg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707801638; c=relaxed/simple; bh=6UxNgBbLmEd9k8EtkUtoBRblPssIxgoKWBIO4OHyBlw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Ys9l82n4Zod1sa+kwIpynl9xJg5B/qWRtcj+CwkfwQKen8uCHcSgw9NM6FrSS3QND0a/EIclKI2OTH0FB8gKJZqCkVYz1KftJbqWPyq9rezZOAEhNtCvVRDyqncLeTphQgd/Yimp5yJgmHnbfc7YISYAPUNQGVv6MnilwO8WH6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MVeF1qwS; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40f0218476aso23355e9.1 for ; Mon, 12 Feb 2024 21:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707801635; x=1708406435; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jsA6Vin23ehyR7Ij/sBXeXrDTbKj+YLFziDzOlAwThM=; b=MVeF1qwS9Mu2eFkSSW1/CQZo96kHekDmB0UuB0K8zVnlu3iNEi5hrBiRTkBlJy7e9q F6ADhSAAInm1SUHDiwM7QbrJ7FjYAPOUcWMqnDOHv9ooFB8euOrw8AbPthAzvoRTCti0 9OKT5tz37SjrUhvik7gjkJlaGdXYlXLVQaHVc8Jq8zFoPbeb2wtwjtgLH35AdabNNt+3 uFbo+UQb7bsg8lhfb6GrFCrxAUxm19nv4eIck0VMh/qs5PFE6K179/0R0Hu48WU6eTo8 AdnBktQlbZOo88cjMWNePMJ4QbNKoj2QxB8Sp6xpRcffsyBLRcWON6eroGtYZQZ2Bku+ Mfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707801635; x=1708406435; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jsA6Vin23ehyR7Ij/sBXeXrDTbKj+YLFziDzOlAwThM=; b=jLNDJtrWOiOGURjx1jho90dydVcYikgdC6zXW2PBaZz+3osyedgMe310+8JeVRlGBX PVaGF9pGSEFQF2RKy9bdlsuZ+0kM0WTzaejxp8LPrH9ivCk2oXMrjoSBP5G0PzFvhLxj nIEwxNCb+p6Vbqujmo4IsMI/EAN8Eg4bgJDnS9tEMyGcjFY1VPW0RvogkvABioNxJOgK y7b60HA8+cRSzZgQUzefp6JBAhgC3RR/fuojm25q7nzbhaS6HROG/BTIXD5k3KGFPevs Abp9dCCR5aI4GQrNm5twtLZwVgXSwPVNjNTMsO/EXlp2/xhfmIYkwNh9NaIWGWmnYN7z nP0Q== X-Forwarded-Encrypted: i=1; AJvYcCVXdHdJjb0wobOCmfS5yeeuyU4Qh5JugBNRoddavhfAzgAJtR0w3TotaVADIQAWZ8/AXvMQMvgsSSnmGQeOVMqOei5V7KE5FfS4FhMC X-Gm-Message-State: AOJu0Yxd0FFcOTh3NuWMAe3b6DD7Udw5EeZlKixgqzRMIdwjlqk2mnMn nfhrRKSfHheQODNt6pPMQLiqRBl3nidCrhCs0sMuA2BfKQnNMM4DlEl3S0gmlS05wX7C6bpRxez 50C7p2z9yQpnxw63fUkY/NgJdpAKtubaqgvSP X-Received: by 2002:a05:600c:1d92:b0:411:c715:667 with SMTP id p18-20020a05600c1d9200b00411c7150667mr1145wms.5.1707801634918; Mon, 12 Feb 2024 21:20:34 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240207-s390-lld-and-orphan-warn-v1-0-8a665b3346ab@kernel.org> <20240207-s390-lld-and-orphan-warn-v1-11-8a665b3346ab@kernel.org> In-Reply-To: <20240207-s390-lld-and-orphan-warn-v1-11-8a665b3346ab@kernel.org> From: Fangrui Song Date: Mon, 12 Feb 2024 21:20:21 -0800 Message-ID: Subject: Re: [PATCH 11/11] s390: Link vmlinux with '-z notext' To: Nathan Chancellor Cc: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, ndesaulniers@google.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 7, 2024 at 4:15=E2=80=AFPM Nathan Chancellor wrote: > > ld.bfd defaults to '-z notext' (although it is customizable with the > '--enable-textrel-check' configure option) but ld.lld defaults to '-z > text', which causes issues with building the kernel due to the presence > of dynamic relocations in sections that are not writable. > > ld.lld: error: relocation R_390_64 cannot be used against local symbol;= recompile with -fPIC > > Add '-z notext' to avoid these errors, as this is expected, which > matches other architectures. > > Signed-off-by: Nathan Chancellor This follows arm64/powerpc/loongarch/riscv. LGTM. Reviewed-by: Fangrui Song > --- > arch/s390/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/s390/Makefile b/arch/s390/Makefile > index 73873e451686..994f9b3d575f 100644 > --- a/arch/s390/Makefile > +++ b/arch/s390/Makefile > @@ -15,7 +15,7 @@ KBUILD_CFLAGS_MODULE +=3D -fPIC > KBUILD_AFLAGS +=3D -m64 > KBUILD_CFLAGS +=3D -m64 > KBUILD_CFLAGS +=3D -fPIE > -LDFLAGS_vmlinux :=3D -pie > +LDFLAGS_vmlinux :=3D -pie -z notext > aflags_dwarf :=3D -Wa,-gdwarf-2 > KBUILD_AFLAGS_DECOMPRESSOR :=3D $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ > ifndef CONFIG_AS_IS_LLVM > > -- > 2.43.0 > --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF