archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <>
To: Nathan Chancellor <>
Cc: Kees Cook <>, Ingo Molnar <>,
	Russell King <>,
	Linux ARM <>,
	LKML <>,
	clang-built-linux <>,
	kernel test robot <>
Subject: Re: [PATCH] arm/build: Always handle .ARM.exidx and .ARM.extab sections
Date: Mon, 12 Oct 2020 14:10:50 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Sep 28, 2020 at 3:49 PM Nathan Chancellor
<> wrote:
> After turning on warnings for orphan section placement, enabling
> thousands of warnings when clang + ld.lld are used:
> $ scripts/config --file arch/arm/configs/multi_v7_defconfig \
>                  -d CONFIG_UNWINDER_ARM \
> $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 defconfig zImage
> ld.lld: warning: init/built-in.a(main.o):(.ARM.extab) is being placed in '.ARM.extab'
> ld.lld: warning: init/built-in.a(main.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(main.o):(.ARM.extab.ref.text) is being placed in '.ARM.extab.ref.text'
> ld.lld: warning: init/built-in.a(do_mounts.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(do_mounts.o):(.ARM.extab) is being placed in '.ARM.extab'
> ld.lld: warning: init/built-in.a(do_mounts_rd.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(do_mounts_rd.o):(.ARM.extab) is being placed in '.ARM.extab'
> ld.lld: warning: init/built-in.a(do_mounts_initrd.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(initramfs.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(initramfs.o):(.ARM.extab) is being placed in '.ARM.extab'
> ld.lld: warning: init/built-in.a(calibrate.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text'
> ld.lld: warning: init/built-in.a(calibrate.o):(.ARM.extab) is being placed in '.ARM.extab'
> These sections are handled by the ARM_UNWIND_SECTIONS define, which is
> only added to the list of sections when CONFIG_ARM_UNWIND is set.
> CONFIG_ARM_UNWIND is a hidden symbol that is only selected when
> handles these sections. According to the help text of
> CONFIG_UNWINDER_ARM, these sections should be discarded so that the
> kernel image size is not affected.

My apologies for taking so long to review this.

I have a suspicion that these come from forcing on configs that
Kconfig/menuconfig would block, and aren't clang or lld specific, yet
are exposed by the new linker warnings for orphan section placement
(good).  That said, we definitely have OEMs in Android land that still
prefer the older unwinder.

From (click
download in top left), section 4.4.1 "Sections" has a note:

Tables are not required for ABI compliance at the C/Assembler level
but are required for C++.

Review-by: Nick Desaulniers <>
Tested-by: Nick Desaulniers <>

Please submit to:

> Fixes: 5a17850e251a ("arm/build: Warn on orphan section placement")
> Link:
> Reported-by: kernel test robot <>
> Signed-off-by: Nathan Chancellor <>
> ---
>  arch/arm/kernel/ | 4 ++++
>  1 file changed, 4 insertions(+)
> diff --git a/arch/arm/kernel/ b/arch/arm/kernel/
> index 5f4922e858d0..a2c0d96b0580 100644
> --- a/arch/arm/kernel/
> +++ b/arch/arm/kernel/
> @@ -40,6 +40,10 @@ SECTIONS
>                 ARM_DISCARD
>  #ifndef CONFIG_SMP_ON_UP
>                 *(.alt.smp.init)
> +#endif
> +               *(.ARM.exidx*)

I don't think we need the wildcard, as without this line, I see:

ld.lld: warning: <internal>:(.ARM.exidx) is being placed in '.ARM.exidx'

though I do see binutils linker scripts use precisely what you have.
So I guess that's fine.

I guess we can't reuse `ARM_UNWIND_SECTIONS` since the ALIGN and
linker-script-defined-symbols would be weird in a DISCARD clause?

> +               *(.ARM.extab*)
>  #endif
>         }
> base-commit: 6e0bf0e0e55000742a53c5f3b58f8669e0091a11
> --

~Nick Desaulniers

  reply	other threads:[~2020-10-12 21:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 22:48 Nathan Chancellor
2020-10-12 21:10 ` Nick Desaulniers [this message]
2020-10-12 21:22   ` Fāng-ruì Sòng
2020-10-12 21:26     ` Kees Cook
2020-10-13  3:26       ` Nathan Chancellor
2020-10-13 22:56         ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] arm/build: Always handle .ARM.exidx and .ARM.extab sections' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).