[all-commits] [llvm/llvm-project] 120b18: [ELF] --gc-sections: allow GC on reserved sections...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jul 22 17:09:37 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 120b18767c5243520f91e81b3baaa2bcf0d2c4ac
      https://github.com/llvm/llvm-project/commit/120b18767c5243520f91e81b3baaa2bcf0d2c4ac
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M lld/ELF/MarkLive.cpp
    M lld/test/ELF/gc-sections-group.s

  Log Message:
  -----------
  [ELF] --gc-sections: allow GC on reserved sections in a group

This generalizes D70146 (SHT_NOTE) to more reserved sections and makes our rules
more consistent. Now SHF_GROUP is more similar to SHF_LINK_ORDER.

For SHT_INIT_ARRAY/SHT_FINI_ARRAY, the rule will be closer to PE/COFF link.exe.

Previously sanitizers use llvm.global_ctors to make module_ctor a GC
root, which is considered an abuse.
https://groups.google.com/g/generic-abi/c/TpleUEkNoQI

We can squeak through on compatibility issues because compilers otherwise don't
use SHF_GROUP special sections.




More information about the All-commits mailing list