[PATCH] D77807: [LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 11:20:36 PDT 2020


MaskRay added a comment.

I am still uncomfortable with the following change:

  - used(!config->gcSections),
  + used(!config->gcSections && binding != llvm::ELF::STB_LOCAL),

and the relocation scanning behavior guarded by the subtle condition:

  if (config->copyRelocs && config->discard != DiscardPolicy::None)
    markUsedLocalSymbols<ELFT>();

The `--emit-relocs --discard-all` bugfix is correct and we should fix that. I took this opportunity to improve test coverage a bit. Created D78389 <https://reviews.llvm.org/D78389>.


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

https://reviews.llvm.org/D77807





More information about the llvm-commits mailing list