From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E158C55179 for ; Tue, 27 Oct 2020 11:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E97AD20829 for ; Tue, 27 Oct 2020 11:53:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iqYh9kcc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2899628AbgJ0Lxa (ORCPT ); Tue, 27 Oct 2020 07:53:30 -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-Google-Smtp-Source: ABdhPJyvSct9JJTg273eAAF5FKtW1ItmWMUxF+cbtvl+7ovbBPYn79lxWvcnBziQwfg/eNxTx6jWn9QkHK0mkwDGp34= 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