[PATCH] D135642: [MC] .addrsig_sym: ignore unregistered symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 12:56:18 PDT 2022


MaskRay added a comment.

In D135642#3849758 <https://reviews.llvm.org/D135642#3849758>, @tejohnson wrote:

> @pcc should also take a look. I'm not very familiar with addrsig but it looks like he added support for it in D47744 <https://reviews.llvm.org/D47744>, including the source line and test that are being deleted here.
>
>> - extern int x; void f() { (void)x; } produces undefined x only in -O0 -faddrsig, other -O levels and -fno-addrsig don't produce the symbol.
>> - In ThinLTO, after a non-prevailing linkonce_odr definition is converted to available_externally, and then a declaration, the addrsig code emits a symbol while the symbol is otherwise unseen.
>
> To make sure I understand the above properly, is it the case that both at "-O0 -faddrsig" and "-flto=thin -faddrsig" we get a reference to the symbol, but with "-O"x no ThinLTO we don't? I'm confused as to what was intended.

Clarified the description with this bullet point now:

  * `extern int x; void f() { (void)x; }` has inconsistent behavior whether `x` is emitted as an undefined symbol.
    `-O0 -faddrsig` makes `x` undefined while other -O levels and -fno-addrsig eliminate the symbol.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135642



More information about the llvm-commits mailing list