Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1069859pxx; Tue, 27 Oct 2020 07:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxho/UJk1yTMV0fDRgWc6nP9hWtZhDtL7hWzYqsd6K16gvr5+Q+lIaawszFu/Ogx9HYySQv X-Received: by 2002:a05:6402:754:: with SMTP id p20mr2554944edy.109.1603809353897; Tue, 27 Oct 2020 07:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603809353; cv=none; d=google.com; s=arc-20160816; b=WoNJEX9sZWI3Y5+0XFGtXGjmTin4jrP/I+XuHDGcIsuuonanj2EouvYqvMTJRQ9xzE WhFXqpAgM9N09LRsekK4Ft5jO5YXTUpz7U5DQnewBLQ0ihMOvB6Myj8uGt/dgEYvzuIb an5dSAFGauD/mdmA/WLIiRjdmIBIGvY2mzAccpd2xDn4aamtvogNVmDnyLYpsTlzlON8 1cgzzL4QLsdGcf1crx/NK/GG+F2OCHJWiYYACbaQJhDZF6npCoBZ1q9Lmuf3GB68abRX kCbjmvCEG1XBTCTkHelmn00tz4qxNMQA+tF/shOn2EXOM3Rrgc8RTE/ZLyr6SKWLoBQV 0Dig== 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; bh=HMHz77bZPNKFM5hBqgF+AXfFIQtkGp2+sGUr8mpAMdk=; b=rA09It7Kk/aF39U1RhtNjmNsZcAJv6oD+4p/a3NbtPaYGJjgB2kcDQePas/rBwIjp8 BRQoUff7fVjk7aJ6WQ3u0xuPPzs4xsuXXBNDFRwCUsGh2RK2uMEUT4taKNQ1Wyngv6fZ N8lTzBaTjAP4solA2HgLz+laWIyQJBbhPSsS0eL3LejgTwRosvHhdtDLiB2zWOBdMxb/ WKKRx3zhjf1nVtrpeUFlRwLqmKIsM8P4Y8TPuxV0LF1KjNNhWIuVeMIl98Ur/s5ZA2DZ nhl2+IJ0ZGnNkBowkDfi41kKhxEy+1hTSVgJ2hPSJ2SQpABtGYhX9WmJFBbtu9w35w5E 7Q1g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si1131117ejy.78.2020.10.27.07.35.30; Tue, 27 Oct 2020 07:35:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2897934AbgJ0KU2 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 27 Oct 2020 06:20:28 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:41437 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2897922AbgJ0KU1 (ORCPT ); Tue, 27 Oct 2020 06:20:27 -0400 Received: by mail-oi1-f195.google.com with SMTP id k65so730158oih.8; Tue, 27 Oct 2020 03:20:26 -0700 (PDT) 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=k0U7EsdK27CwbcUqJCGedR1nNrqKkk5RW5FI4v5npXo=; b=E2T2Mn6JpaQq29BPpUCVSSqk2rIWupY+ARah58gduPZgTRXhQe1O4gA8uBoFSUGiR2 leOxnuANyMAnvPjpaJUiSrf+z3kY5tvYDuBDAUY5EdfAoDgaEfdTrCv8nqy7jas8XZb/ TFbjDPE3JRtYYvThbV+3EKYK+NyYblTIJTJwLOSFGXtD8Vr7aVvapWSqQYlC2CP+qNVQ 0cAC+sNHxph8pP12uWTecOvBfrdAzBoQ1ONsul+uUmYdvDNHOIGkFZf7CaWQFy2Deq7j IXigVkN9O6ZAm5mvbbckO/NfOJM57a1au0vJ5lA4/322ARjQXkUWTuXBw1KSilQTnNGl 6fqw== X-Gm-Message-State: AOAM5331TZlcYxc5muTzVBdqB/PMSA3PDhkjbmrVNgIe+uLi1fSyu9RQ KvuMMce2y5FVKWJSYomUe7SAurvLwoUHcEMuzLU= X-Received: by 2002:aca:f40c:: with SMTP id s12mr858558oih.153.1603794026088; Tue, 27 Oct 2020 03:20:26 -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: <20201027100844.GA1514990@myrica> From: Geert Uytterhoeven Date: Tue, 27 Oct 2020 11:20:14 +0100 Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Jean-Philippe Brucker Cc: Ard Biesheuvel , Mark Rutland , Linux-Arch , linux-efi , Kees Cook , 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 linkages detected! > > > > > > > > > > The parent commit obviously doesn't show that (but probably still 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 (Debian 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-handling=warn --build-id=sha1 --strip-debug -o .tmp_vmlinux.kallsyms1 -T ./arch/arm64/kernel/vmlinux.lds --whole-archive arch/arm64/kernel/head.o init/built-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 drivers/built-in.a sound/built-in.a net/built-in.a virt/built-in.a --no-whole-archive --start-group arch/arm64/lib/lib.a lib/lib.a ./drivers/firmware/efi/libstub/lib.a --end-group > ld: Unexpected GOT/PLT entries detected! > ld: Unexpected run-time procedure linkages detected! > > Adding -fno-pie to this command doesn't fix the problem. > > Note that when cross-building with a GCC 10.2 and binutils 2.35.1 I also > get several "aarch64-linux-gnu-ld: warning: -z norelro ignored" in > addition to the error, but I don't get that warning with the 8.3.0 > toolchain. Thanks, my config (renesas_defconfig) also had CONFIG_MODULES disabled. Enabling that fixes the link error due to unexpected entries, but the .eh_frame orphan section warning is still there. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds