Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3546646pxj; Mon, 24 May 2021 09:06:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy14DWfjkrbIGIxacRNt1FuQtvzl8iyGAjNarYpH5ImbLbqkPbnv6o71nnfhwfZGA6S/5q+ X-Received: by 2002:a5d:9c10:: with SMTP id 16mr16683182ioe.101.1621872367728; Mon, 24 May 2021 09:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872367; cv=none; d=google.com; s=arc-20160816; b=fM7RWaas6ydE4ju8U4yGlzZVmFa4jnWFnWh+LJenpyDYoQtgYj5xn27GHLGkalGH// pxDbrWuGzvuFKxT1KRulXaTSd6jKcG/eBE2ToMaiLJJ9Ml93zeCBDq5ijl6AdNxFKZX0 eCs6z6ThWlu7yoy3e+5ZcWFA1PDqTNzSdJ4p2TuIb1ZzU0VO1jVt79zeEVw3W7h1Jc9w C8R0VBqrnz6PeH8mx2mwlLzFKUROIoFxBhH3FwulUS/q8FjK3UkZrzBYNLwFRpKS4CH7 Vv9eTxGJyTWlXXx5m/mShulN+7SXG9q8agjoJYV6JdsEwW/vKYhbWsvNZCmDG3BGHkj5 sfCA== 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=LuzH8ta1YWw1zM5plhbJaL0pEHGbHXbAjUdnmPnuTRH1U3+HqN0pqqIePZFubhfOko N5gxpAm0es/8SOHyIeLHz9p0HJ86WDd+q5wvKr3TSxjfqkPai8Gdz38M5Ji6r+5vJUI+ vgAE8vjSOLdMbfBCXTPrsM/XkDd4ETWTorTBmpOtL89ZCQwNfdXuenOrbPuINRRPzyO4 vFFtfhCfJoAzHhvOjwp1yKv6rJuIpMvKwUfd//fJAok2zL1prnMH3YnjkW4C7u0GdJeO jCNAdLP4Z0hFqTe/lNdGrpjPDt5sdClCQeNDb6djjxY8kK0jFmKuqGPsccV15q4OvQ2d zkMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BW5TIHNy; 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 c7si17499652ioi.54.2021.05.24.09.05.41; Mon, 24 May 2021 09:06:07 -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=BW5TIHNy; 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 S236017AbhEXQDx (ORCPT + 99 others); Mon, 24 May 2021 12:03:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:41136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234692AbhEXP45 (ORCPT ); Mon, 24 May 2021 11:56:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C1B16194A; Mon, 24 May 2021 15:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870998; bh=xOEGtQeJhtNmNQm5H4zbZfcB6iaCDO89XW8LkWe25LE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BW5TIHNy6ExaVor6oiVzyX/tZlzLiEsgJsrmDLcZbqGcUaj/+bcJ7QMoJhRNi53JJ ow3eg8YMMZptnlpGYlwIX6x+85XI8tAMEfYCMgbqpiigrEsdVrmJQKhyEFmvrPzvnP CZQS8kbQlxSfHu+jy4wXGSJXBjV/mDxXNIpPUTz0= 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.12 026/127] tools/testing/selftests/exec: fix link error Date: Mon, 24 May 2021 17:25:43 +0200 Message-Id: <20210524152335.732117847@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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