[PATCH] D123874: [Clang][IA] support -generate-unused-section-symbols={yes|no}

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 00:00:26 PDT 2022


MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

In D123874#3454723 <https://reviews.llvm.org/D123874#3454723>, @MaskRay wrote:

>> Add support to clang (-Wa,-generate-unused-section-symbols={yes|no}) and llvm-mc.
>
>
>
>> This feature might be used by the Linux kernel. https://lore.kernel.org/linux-toolchains/YllUqPK4CWZeHku8@hirez.programming.kicks-ass.net/
>
>
>
>> This has been supported by GNU binutils since 2.36. https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1408485ce69f844dcd7ded093a8
>
> AFAICT GNU as never gets an option named `-generate-unused-section-symbols=yes`.
> It just has a quirk <https://sourceware.org/bugzilla/show_bug.cgi?id=29067> that interprets nearly all `-g*` options as `-g`, which indicates generation of some compile units for ELF symbols with the help of `.size` directives.
> It's very different from generating unused section symbols.

Latest GNU as added an error for an unknown `-g` option.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123874/new/

https://reviews.llvm.org/D123874



More information about the llvm-commits mailing list