[all-commits] [llvm/llvm-project] d54013: [LangRef] Clarify comdat

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Jul 23 16:33:20 PDT 2021


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

  Changed paths:
    M llvm/docs/LangRef.rst

  Log Message:
  -----------
  [LangRef] Clarify comdat

* ELF supports `nodeduplicate`.
* ELF calls the concept "section group". `GRP_COMDAT` emulates the PE COMDAT deduplication feature.
* "COMDAT group" is an ELF term. Avoid it for PE/COFF.
* WebAssembly supports comdat but only supports the `any` selection kind. https://bugs.llvm.org/show_bug.cgi?id=50531
* A comdat must be included or omitted as a unit. Both the compiler and the linker must obey this rule.
* A global object can be a member of at most one comdat.
* COFF requires a non-local linkage for non-`nodeduplicate` selection kinds.
* llvm.global_ctors/.llvm.global_dtors: if the third field is used on ELF, it must reference a global variable or function in a comdat

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D106300




More information about the All-commits mailing list