1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib
Saleem Abdulrasool f56e4f6d3d RISCV: adjust handling of relocation emission for RISCV
This re-architects the RISCV relocation handling to bring the
implementation closer in line with the implementation in binutils.  We
would previously aggressively resolve the relocation.  With this
restructuring, we always will emit a paired relocation for any symbolic
difference of the type of S±T[±C] where S and T are labels and C is a
constant.

GAS has a special target hook controlled by `RELOC_EXPANSION_POSSIBLE`
which indicates that a fixup may be expanded into multiple relocations.
This is used by the RISCV backend to always emit a paired relocation -
either ADD[WIDTH] + SUB[WIDTH] for text relocations or SET[WIDTH] +
SUB[WIDTH] for a debug info relocation.  Irrespective of whether linker
relaxation support is enabled, symbolic difference is always emitted as
a paired relocation.

This change also sinks the target specific behaviour down into the
target specific area rather than exposing it to the shared relocation
handling.  In the process, we also sink the "special" handling for debug
information down into the RISCV target.  Although this improves the path
for the other targets, this is not necessarily entirely ideal either.
The changes in the debug info emission could be done through another
type of hook as this functionality would be required by any other target
which wishes to do linker relaxation.  However, as there are no other
targets in LLVM which currently do this, this is a reasonable thing to
do until such time as the code needs to be shared.

Improve the handling of the relocation (and add a reduced test case from
the Linux kernel) to ensure that we handle complex expressions for
symbolic difference.  This ensures that we correct relocate symbols with
the adddends normalized and associated with the addition portion of the
paired relocation.

This change also addresses some review comments from Alex Bradbury about
the relocations meant for use in the DWARF CFA being named incorrectly
(using ADD6 instead of SET6) in the original change which introduced the
relocation type.

This resolves the issues with the symbolic difference emission
sufficiently to enable building the Linux kernel with clang+IAS+lld
(without linker relaxation).

Resolves PR50153, PR50156!
Fixes: ClangBuiltLinux/linux#1023, ClangBuiltLinux/linux#1143

Reviewed By: nickdesaulniers, maskray

Differential Revision: https://reviews.llvm.org/D103539
2021-06-17 08:20:02 -07:00
..
Analysis Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
AsmParser [LLParser] Remove outdated deplibs 2021-06-14 12:46:12 +08:00
BinaryFormat [AIX][XCOFF] emit vector info of traceback table. 2021-06-14 11:15:22 -04:00
Bitcode Move some code under NDEBUG from D103135 2021-06-14 11:39:12 -07:00
Bitstream
CodeGen [InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave access pass 2021-06-17 09:53:33 +01:00
DebugInfo [Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects. 2021-06-15 06:53:21 +01:00
Demangle [Demangle] Support Rust v0 mangling scheme in llvm::demangle 2021-06-17 10:37:26 +02:00
DWARFLinker [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
ExecutionEngine [ORC] Switch from uint8_t to char buffers for TargetProcessControl::runWrapper. 2021-06-17 13:27:09 +10:00
Extensions
FileCheck Fix PR46880: Fail CHECK-NOT with undefined variable 2021-04-20 14:42:46 +01:00
Frontend [OPENMP]Fix PR50129: omp cancel parallel not working as expected. 2021-06-04 08:24:55 -07:00
Fuzzer
FuzzMutate [FuzzMutate] Fix getWeight of InstDeleterIRStrategy 2021-06-08 11:14:33 -07:00
InterfaceStub
IR Reapply "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value" 2021-06-17 16:16:55 +01:00
IRReader [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
LineEditor
Linker Linker: Avoid scheduling the link of a global value twice due to an alias 2021-04-28 13:22:10 -07:00
LTO [LTO] Support new PM in ThinLTOCodeGenerator. 2021-06-09 10:05:14 +01:00
MC RISCV: adjust handling of relocation emission for RISCV 2021-06-17 08:20:02 -07:00
MCA [MCA] Anchoring the vtable of CustomBehaviour 2021-06-16 12:43:58 -07:00
Object [AIX][XCOFF] emit vector info of traceback table. 2021-06-14 11:15:22 -04:00
ObjectYAML [obj2yaml] Address D104035 review comments 2021-06-16 15:01:54 +01:00
Option
Passes [NewPM] Remove SpeculateAroundPHIs pass 2021-06-15 20:35:55 +03:00
ProfileData [CSSPGO] Report zero-count probe in profile instead of dangling probes. 2021-06-16 11:45:29 -07:00
Remarks [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04:00
Support Move the definition of LLVM_SUPPORT_XCODE_SIGNPOSTS into llvm-config.h 2021-06-16 14:40:37 -07:00
TableGen DetailedRecordsBackend.cpp - printSectionHeading - avoid std::string creation/copies. 2021-06-13 16:49:40 +01:00
Target RISCV: adjust handling of relocation emission for RISCV 2021-06-17 08:20:02 -07:00
Testing Fix for error "'Run' overrides a member function but is not marked 2021-06-11 06:56:00 -07:00
TextAPI Reland "[llvm] llvm-tapi-diff" 2021-06-09 21:17:34 -07:00
ToolDrivers [llvm-dlltool] Imply the target arch from a tool triple prefix 2021-06-17 13:02:35 +03:00
Transforms [InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210) 2021-06-17 19:46:17 +09:00
WindowsManifest
XRay
CMakeLists.txt