Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1074894pxx; Tue, 27 Oct 2020 07:42:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUW6sq2/83zun+thTlKPat72ohrCW25NVqsfDod/HvoYSC+c1jezd7kzVR8FPdW8cXj/v6 X-Received: by 2002:a17:906:a444:: with SMTP id cb4mr2901431ejb.416.1603809777880; Tue, 27 Oct 2020 07:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603809777; cv=none; d=google.com; s=arc-20160816; b=ll9t4aBP/R7/yxvahGCoYV5Cgezv8pKA1FxYYJHtSA+RYVltUEf0x7eTsnS1Xb1cuc UTEJ6MBKo2kJNu4sZg/7TqBk6cgKodYQasHgWs+gSEgRVglXchehI+VplwyQrRRzzZf4 ZksIpnt1eG/GSyRMyFBaUVihryjhX+OaXFOFXB+x5eVRRXmrzp+D1z2b1/WL/CbmLFkl wK63Ow55c3HfNErL/gPYLNcFr86/A3gW120VmtDwf75Uqa+UlQAeWpgzj5iGqHxXYkKA nYNGN45jMU83P2xKpNoBuzZlDfxSM6r77cvj6tIiK/wzmHDha7blOFX6/t0Z4MocKPj+ ho7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=s+UBJg6LO9Rf1v1keW2mwB44PjQMVZlghePfQtTq54M=; b=tLxGLAitOLL/RtZH+NzvvoaT7m0Y8hcXZYBM9V0O30LIQhDoq1hAeZZF9h+Z/8sF+s Hhsej/umuLeaVDmwp8Aqtmd21RPxKmsQpItDOmuKpWMT0bwmMmKQ6kE9EjwtWOqRLQvY 26yojQnEDQxaQ6IEoxwqqsigx1VNjje1dESDf8xx9QLa+72Gm8lh/NiCl4sSVylIu738 Pq/nTEFOq8hmTwdqSYI+4ITNJmD3XVUSNkp8Pkea/ZP/JvOB43YoaBm8LrqiZjLqYsVr P7bPxDc8qiALuy89tPS5Nfut9BQO7gDEMGex9aO5Eqs+3CaFQShahFI6DVOUyX28b8cv Q2Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iqYh9kcc; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si1056933edl.282.2020.10.27.07.42.35; Tue, 27 Oct 2020 07:42:57 -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=@linaro.org header.s=google header.b=iqYh9kcc; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2899624AbgJ0Lx3 (ORCPT + 99 others); Tue, 27 Oct 2020 07:53:29 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:35673 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411499AbgJ0Lx3 (ORCPT ); Tue, 27 Oct 2020 07:53:29 -0400 Received: by mail-io1-f67.google.com with SMTP id k6so1191056ior.2 for ; Tue, 27 Oct 2020 04:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=s+UBJg6LO9Rf1v1keW2mwB44PjQMVZlghePfQtTq54M=; b=iqYh9kcc313LqLNQ1u4THo/DppeQEGGrWD4aOGxMar3Y2DW1ZASEPI1TZCajzyWbQ6 b3CrL66dJSqwP/YWR2lmAnp1wMHm9kQQL4ut04qtHRuAlsyqNt1/VrX5prOagxLSjBDV NL9l0nm97nL0V22EvKatUVRHCfiiwfrfSTBdxnKXmbkqn1ESdtWKtbWnBVFHj5UISPUJ IyEiVjg6EOSfRB4EHcgmXN30WxDSUzM4nv1wcaHIrWdBup/7owLVh51sLUksKQeKrLF0 xUbBrOOpUlxxVHFZNsO7YdJ2ECy2kwRJ1hJqDjDdTSRiagBlFn0ecRg03JUEYoAkA27h 3Mrg== 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:content-transfer-encoding; bh=s+UBJg6LO9Rf1v1keW2mwB44PjQMVZlghePfQtTq54M=; b=nO40GXQcap6IHLkwEKxztakPpEnhvGzgFj/6HiUP456Hj0AGY/qpZY6czEd8ldsd2a kfBhE68MHrEAYqg8s/c8qjyeItNCic2+ZKv18engiWDha3aXn7odp2hknHB2fN2W33gn /dvryDJhJ0p+AVfQ3S8vSBIzItoOtSpgx+323hYVAdczQoaFF5jGXTbj5GUZho1hn9Qq uhHWuN5YbnWrYYdFUixWvxiE8NbipO5ed1hUdpTZrNFHOf4eXDr0dPhAnY0tQjU7BjPG TSezb7uPt8t10k0rqouv0OwTQQPidL2PD5g6D3NDi4mylRGsu/OpUBNbu7x23kd2kBgb zoNQ== X-Gm-Message-State: AOAM53169ClAb9qsUt5eTktqEyLl0sMQVs6P0KUGChzgpzn6ZdQlWeVU sKB4qMfeN58DjDXfGNTPFgwXQ5sFtBkwmiTLxch0ng== X-Received: by 2002:a02:234a:: with SMTP id u71mr1925579jau.3.1603799607846; Tue, 27 Oct 2020 04:53:27 -0700 (PDT) MIME-Version: 1.0 References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-14-keescook@chromium.org> <20201027100844.GA1514990@myrica> In-Reply-To: From: Naresh Kamboju Date: Tue, 27 Oct 2020 17:23:16 +0530 Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Ard Biesheuvel , Geert Uytterhoeven , Kees Cook , Anders Roxell Cc: Jean-Philippe Brucker , Mark Rutland , Linux-Arch , linux-efi , Arnd Bergmann , Catalin Marinas , Masahiro Yamada , "the arch/x86 maintainers" , Nick Desaulniers , Russell King , Linux Kernel Mailing List , Linux-Renesas , clang-built-linux , Arvind Sankar , Ingo Molnar , James Morse , Nathan Chancellor , Borislav Petkov , Peter Collingbourne , Ingo Molnar , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Oct 2020 at 17:00, Ard Biesheuvel wrote: > > On Tue, 27 Oct 2020 at 11:20, Geert Uytterhoeven w= rote: > > > > Hi Jean-Philippe, > > > > On Tue, Oct 27, 2020 at 11:09 AM Jean-Philippe Brucker > > wrote: > > > On Mon, Oct 26, 2020 at 06:38:46PM +0100, Ard Biesheuvel wrote: > > > > > > > Note that even on plain be2881824ae9eb92, I get: > > > > > > > > > > > > > > aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected= ! > > > > > > > aarch64-linux-gnu-ld: Unexpected run-time procedure linka= ges detected! > > > > > > > > > > > > > > The parent commit obviously doesn't show that (but probably s= till has > > > > > > > the problem). > > > > > > > > > > Reverting both > > > > > b3e5d80d0c48c0cc ("arm64/build: Warn on orphan section placement"= ) > > > > > be2881824ae9eb92 ("arm64/build: Assert for unwanted sections") > > > > > seems to solve my problems, without any ill effects? > > > > > > > > > > > > > I cannot reproduce the issue here with my distro GCC+binutils (Debi= an 8.3.0) > > > > > > I have the same problem with one of my debug configs and Linux v5.10-= rc1, > > > and can reproduce with the Debian 8.3.0 toolchain, by using the arm64 > > > defconfig and disabling CONFIG_MODULES: > > > > > > ld -EL -maarch64elf --no-undefined -X -z norelro -shared -Bsymbolic -= z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --orphan-handlin= g=3Dwarn --build-id=3Dsha1 --strip-debug -o .tmp_vmlinux.kallsyms1 -T ./arc= h/arm64/kernel/vmlinux.lds --whole-archive arch/arm64/kernel/head.o init/bu= ilt-in.a usr/built-in.a arch/arm64/built-in.a kernel/built-in.a certs/built= -in.a mm/built-in.a fs/built-in.a ipc/built-in.a security/built-in.a crypto= /built-in.a block/built-in.a arch/arm64/lib/built-in.a lib/built-in.a drive= rs/built-in.a sound/built-in.a net/built-in.a virt/built-in.a --no-whole-ar= chive --start-group arch/arm64/lib/lib.a lib/lib.a ./drivers/firmware/efi/l= ibstub/lib.a --end-group > > > ld: Unexpected GOT/PLT entries detected! > > > ld: Unexpected run-time procedure linkages detected! ld: Unexpected GOT/PLT entries detected! ld: Unexpected run-time procedure linkages detected! The arm64 build error fixed by (I have tested defconfig) [PATCH] soc: qcom: QCOM_RPMH fix build with modular QCOM_RPMH https://lore.kernel.org/linux-arm-msm/20201027111422.4008114-1-anders.roxel= l@linaro.org/ --- When building allmodconfig leading to the following link error with CONFIG_QCOM_RPMH=3Dy and CONFIG_QCOM_COMMAND_DB=3Dm: aarch64-linux-gnu-ld: drivers/clk/qcom/clk-rpmh.o: in function `clk_rpmh_pr= obe': drivers/clk/qcom/clk-rpmh.c:474: undefined reference to `cmd_db_read_addr= ' drivers/clk/qcom/clk-rpmh.c:474:(.text+0x254): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cmd_db_read_addr' Fix this by adding a Kconfig depenency and forcing QCOM_RPMH to be a module when QCOM_COMMAND_DB is a module. Also removing the dependency on 'ARCH_QCOM || COMPILE_TEST' since that is already a dependency for QCOM_COMMAND_DB. Fixes: 778279f4f5e4 ("soc: qcom: cmd-db: allow loading as a module") Signed-off-by: Anders Roxell --- drivers/soc/qcom/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 9b4ae9c16ba7..3bdd1604f78f 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -109,7 +109,7 @@ config QCOM_RMTFS_MEM config QCOM_RPMH tristate "Qualcomm RPM-Hardened (RPMH) Communication" - depends on ARCH_QCOM || COMPILE_TEST + depends on QCOM_COMMAND_DB help Support for communication with the hardened-RPM blocks in Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an --=20 2.28.0 - Naresh