1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[LangRef] Reorder two paragraphs for comdat

so that IMAGE_COMDAT_SELECT_LARGEST refers to the correct example.
This commit is contained in:
Fangrui Song 2021-07-25 12:53:14 -07:00
parent a499e7c2d0
commit 56c255e563

View File

@ -965,6 +965,12 @@ the COMDAT key's section is the largest:
ret void
}
In a COFF object file, this will create a COMDAT section with selection kind
``IMAGE_COMDAT_SELECT_LARGEST`` containing the contents of the ``@foo`` symbol
and another COMDAT section with selection kind
``IMAGE_COMDAT_SELECT_ASSOCIATIVE`` which is associated with the first COMDAT
section and contains the contents of the ``@bar`` symbol.
As a syntactic sugar the ``$name`` can be omitted if the name is the same as
the global name:
@ -974,12 +980,6 @@ the global name:
@foo = global i32 2, comdat
@bar = global i32 3, comdat($foo)
In a COFF object file, this will create a COMDAT section with selection kind
``IMAGE_COMDAT_SELECT_LARGEST`` containing the contents of the ``@foo`` symbol
and another COMDAT section with selection kind
``IMAGE_COMDAT_SELECT_ASSOCIATIVE`` which is associated with the first COMDAT
section and contains the contents of the ``@bar`` symbol.
There are some restrictions on the properties of the global object.
It, or an alias to it, must have the same name as the COMDAT group when
targeting COFF.