Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3541166pxj; Mon, 24 May 2021 09:00:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBFkalx4CRJiY6JRTNqpJPdGNycPSQzhjm9c3hjpq9nK6MCiKZVnvKTR7l542qhBKKCCO9 X-Received: by 2002:a05:6602:2407:: with SMTP id s7mr17008952ioa.170.1621872038830; Mon, 24 May 2021 09:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872038; cv=none; d=google.com; s=arc-20160816; b=F26uvnO46xl62uLR4dyZUVsA7vwJpgRMWc+pOyKwNpABJFhAenr08T40hTUIsI2Rsh xMsRu0IilX0R+npBAfVK0Yyy0fh8eI9K1OBXxnY7pB6mQl9X9XYXJK6lOpAWq8PTPkKT b9r/+jqxeYuZo8GePbH1Sexpx0sQNQY6Z36aaDtya7TP+VxUREm+C5kdwoyIQJ/gpHP0 RwOUMDI0f8SbnT26gl0QF+6wT1J7PZwxAgY8y7dkbPwR5ZLS8xpj7Pd1mViT7C87mBNZ 07fFwuV0X44TuDS8Q+tBW1sKea3NFX+VZoOcStOTbkZmMsFMqvfU2VHe8Zh4iNpZgcjR syyg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2c7D2TACDDgywTBqugrapMJuXgONc4VpjH9/QLxEe24=; b=pNpLsYjslAWdt4jFVXmRdhW+uB/66SZM6s5kwYZVFPa6yxSAeTguLU/jwBg/LehB25 IKS5dqR+ltXJ8lYsy9EpZezzdB0q1cHFSyfammJP7ZWE8zLpz9e3GnWtDEGPHSP+CFDt ZcOCIsl29sC61aU1Dir0lXBrngQ8N/7pwSeLQ/dQ9UFAhPLYVMeC523+dbEvL8a503fV UCE3Lbluoq25r2woJZY993d8VXFgMu9/P9qXtXeO4ne7sndhggSriLlksGSrUauLoKs7 QMzOqHECRId6yimLz5wx8aQ8EbfE5i1ClmDUs8Nuhauzkh0dU8MB53h8ANofZKMvU7Bc fMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yej8P0xH; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si15153523jas.16.2021.05.24.09.00.25; Mon, 24 May 2021 09:00:38 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=Yej8P0xH; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235823AbhEXQAO (ORCPT + 99 others); Mon, 24 May 2021 12:00:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:39020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234916AbhEXPyx (ORCPT ); Mon, 24 May 2021 11:54:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26C656162F; Mon, 24 May 2021 15:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870801; bh=xOEGtQeJhtNmNQm5H4zbZfcB6iaCDO89XW8LkWe25LE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yej8P0xH7GgKpf0dDK3pT8lKw4fapXmkRmsIJBQFbWiL1SwLXdHw1Y5aJgLH0hV6c ubB0wp07odLxzT14fOd/vD437thQ1KRyQxXYtUYoFA0zTBYpOa4HbMlMz22Sc2M771 QgyfLPw/cRF+qoR3iQzcvNPHkw2E9hYx3uZXIlSM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Yingliang , Chris Kennelly , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 023/104] tools/testing/selftests/exec: fix link error Date: Mon, 24 May 2021 17:25:18 +0200 Message-Id: <20210524152333.592398450@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit 4d1cd3b2c5c1c32826454de3a18c6183238d47ed ] Fix the link error by adding '-static': gcc -Wall -Wl,-z,max-page-size=0x1000 -pie load_address.c -o /home/yang/linux/tools/testing/selftests/exec/load_address_4096 /usr/bin/ld: /tmp/ccopEGun.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `stderr@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /tmp/ccopEGun.o(.text+0x158): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `stderr@@GLIBC_2.17' /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make: *** [Makefile:25: tools/testing/selftests/exec/load_address_4096] Error 1 Link: https://lkml.kernel.org/r/20210514092422.2367367-1-yangyingliang@huawei.com Fixes: 206e22f01941 ("tools/testing/selftests: add self-test for verifying load alignment") Signed-off-by: Yang Yingliang Cc: Chris Kennelly Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- tools/testing/selftests/exec/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index cf69b2fcce59..dd61118df66e 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -28,8 +28,8 @@ $(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat cp $< $@ chmod -x $@ $(OUTPUT)/load_address_4096: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000 -pie $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000 -pie -static $< -o $@ $(OUTPUT)/load_address_2097152: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x200000 -pie $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x200000 -pie -static $< -o $@ $(OUTPUT)/load_address_16777216: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000000 -pie $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000000 -pie -static $< -o $@ -- 2.30.2