1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/unittests/ExecutionEngine/Orc
bd1976llvm f066782da1 [MC][ELF] Put explicit section name symbols into entry size compatible sections
Ensure that symbols explicitly* assigned a section name are placed into
a section with a compatible entry size.

This is done by creating multiple sections with the same name** if
incompatible symbols are explicitly given the name of an incompatible
section, whilst:

  - Avoiding using uniqued sections where possible (for readability and
    to maximize compatibly with assemblers).

  - Creating as few SHF_MERGE sections as possible (for efficiency).

Given that each symbol is assigned to a section in a single pass, we
must decide which section each symbol is assigned to without seeing the
properties of all symbols. A stable and easy to understand assignment is
desirable. The following rules facilitate this: The "generic" section
for a given section name will be mergeable if the name is a mergeable
"default" section name (such as .debug_str), a mergeable "implicit"
section name (such as .rodata.str2.2), or MC has already created a
mergeable "generic" section for the given section name (e.g. in response
to a section directive in inline assembly). Otherwise, the "generic"
section for a given name is non-mergeable; and, non-mergeable symbols
are assigned to the "generic" section, while mergeable symbols are
assigned to uniqued sections.

Terminology:
"default" sections are those always created by MC initially, e.g. .text
or .debug_str.

"implicit" sections are those created normally by MC in response to the
symbols that it encounters, i.e. in the absence of an explicit section
name assignment on the symbol, e.g. a function foo might be placed into
a .text.foo section.

"generic" sections are those that are referred to when a unique section
ID is not supplied, e.g. if there are multiple unique .bob sections then
".quad .bob" will reference the generic .bob section. Typically, the
generic section is just the first section of a given name to be created.
Default sections are always generic.

* Typically, section names might be explicitly assigned in source code
using a language extension e.g. a section attribute: _attribute_
((section ("section-name"))) -
https://clang.llvm.org/docs/AttributeReference.html

** I refer to such sections as unique/uniqued sections. In assembly the
", unique," assembly syntax is used to express such sections.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43457.

See https://reviews.llvm.org/D68101 for previous discussions leading to
this patch.

Some minor fixes were required to LLVM's tests, for tests had been using
the old behavior - which allowed for explicitly assigning globals with
incompatible entry sizes to a section.

This fix relies on the ",unique ," assembly feature. This feature is not
available until bintuils version 2.35
(https://sourceware.org/bugzilla/show_bug.cgi?id=25380). If the
integrated assembler is not being used then we avoid using this feature
for compatibility and instead try to place mergeable symbols into
non-mergeable sections or issue an error otherwise.

Differential Revision: https://reviews.llvm.org/D72194
2020-04-16 19:12:49 +00:00
..
CMakeLists.txt [Orc][test] Fix -DBUILD_SHARED_LIBS=on build 2019-10-29 22:55:17 -07:00
CoreAPIsTest.cpp [ORC] Introduce JITSymbolFlags::HasMaterializeSideEffectsOnly flag. 2020-03-27 11:02:54 -07:00
GlobalMappingLayerTest.cpp
IndirectionUtilsTest.cpp
JITTargetMachineBuilderTest.cpp
LazyCallThroughAndReexportsTest.cpp [ORC] Update lazyReexports to support aliases with different symbol names. 2020-01-15 08:02:53 -08:00
LazyEmittingLayerTest.cpp
LegacyAPIInteropTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
LegacyCompileOnDemandLayerTest.cpp
LegacyRTDyldObjectLinkingLayerTest.cpp [MC][ELF] Put explicit section name symbols into entry size compatible sections 2020-04-16 19:12:49 +00:00
ObjectTransformLayerTest.cpp [ORC] Add support for emulated TLS to ORCv2. 2020-01-21 19:55:33 -08:00
OrcCAPITest.cpp [ORC] Add support for emulated TLS to ORCv2. 2020-01-21 19:55:33 -08:00
OrcTestCommon.cpp
OrcTestCommon.h [ORC] Add generic initializer/deinitializer support. 2020-02-19 13:59:32 -08:00
QueueChannel.cpp
QueueChannel.h
RemoteObjectLayerTest.cpp Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
RPCUtilsTest.cpp
RTDyldObjectLinkingLayerTest.cpp [MC][ELF] Put explicit section name symbols into entry size compatible sections 2020-04-16 19:12:49 +00:00
SymbolStringPoolTest.cpp
ThreadSafeModuleTest.cpp