1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib/MC
Michael Trent 721829227e [ MC ] Match labels to existing fragments even when switching sections.
(This commit restores the original branch (4272372c571) and applies an
additional change dropped from the original in a bad merge. This change
should address the previous bot failures. Both changes reviewed by pete.)

Summary:
This commit builds upon Derek Schuff's 2014 commit for attaching labels to
existing fragments ( Diff Revision: http://reviews.llvm.org/D5915 )

When temporary labels appear ahead of a fragment, MCObjectStreamer will
track the temporary label symbol in a "Pending Labels" list. Labels are
associated with fragments when a real fragment arrives; otherwise, an empty
data fragment will be created if the streamer's section changes or if the
stream finishes.

This commit moves the "Pending Labels" list into each MCStream, so that
this label-fragment matching process is resilient to section changes. If
the streamer emits a label in a new section, switches to another section to
do other work, then switches back to the first section and emits a
fragment, that initial label will be associated with this new fragment.
Labels will only receive empty data fragments in the case where no other
fragment exists for that section.

The downstream effects of this can be seen in Mach-O relocations. The
previous approach could produce local section relocations and external
symbol relocations for the same data in an object file, and this mix of
relocation types resulted in problems in the ld64 Mach-O linker. This
commit ensures relocations triggered by temporary labels are consistent.

Reviewers: pete, ab, dschuff

Reviewed By: pete, dschuff

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71368
2019-12-18 09:55:54 -08:00
..
MCDisassembler [MC] Assume CommentStream is non-null in MCDisassembler::tryAdding* 2019-12-15 16:21:06 -08:00
MCParser [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CMakeLists.txt [MC] Delete MCCodePadder 2019-12-09 19:21:31 -08:00
ConstantPools.cpp
ELFObjectWriter.cpp [MC] Emit unused undefined symbol even if its binding is not set 2019-11-08 14:47:48 -08:00
LLVMBuild.txt
MachObjectWriter.cpp
MCAsmBackend.cpp [MC] Delete MCCodePadder 2019-12-09 19:21:31 -08:00
MCAsmInfo.cpp
MCAsmInfoCOFF.cpp
MCAsmInfoDarwin.cpp
MCAsmInfoELF.cpp [MC] Delete unused MCAsmInfoELF::UsesNonexecutableStackSection after EM_WEBASSEMBLY was removed in D48744 2019-12-15 15:43:30 -08:00
MCAsmInfoWasm.cpp
MCAsmInfoXCOFF.cpp
MCAsmMacro.cpp
MCAsmStreamer.cpp
MCAssembler.cpp [MC] Delete MCCodePadder 2019-12-09 19:21:31 -08:00
MCCodeEmitter.cpp
MCCodeView.cpp
MCContext.cpp
MCDwarf.cpp [MC] Produce proper section relative relocations for COFF in .debug_frame 2019-11-27 10:44:42 +02:00
MCELFObjectTargetWriter.cpp
MCELFStreamer.cpp [MC] Delete redundant alignment update from MCELFStreamer::EmitCommonSymbol. NFC 2019-12-16 23:08:32 -08:00
MCExpr.cpp
MCFragment.cpp [MC] Delete MCCodePadder 2019-12-09 19:21:31 -08:00
MCInst.cpp
MCInstPrinter.cpp [MC] Rewrite tablegen for printInstrAlias to comiple faster, NFC 2019-12-06 15:00:18 -08:00
MCInstrAnalysis.cpp Revert "Forward declare Optional<T> in STLExtras.h" 2019-11-13 16:36:21 -08:00
MCInstrDesc.cpp
MCLabel.cpp
MCLinkerOptimizationHint.cpp
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp
MCNullStreamer.cpp
MCObjectFileInfo.cpp Recommit "[DebugInfo] Refactored macro related generation, 2019-12-18 02:12:59 +05:30
MCObjectStreamer.cpp [ MC ] Match labels to existing fragments even when switching sections. 2019-12-18 09:55:54 -08:00
MCObjectWriter.cpp
MCRegisterInfo.cpp
MCSchedule.cpp
MCSection.cpp [ MC ] Match labels to existing fragments even when switching sections. 2019-12-18 09:55:54 -08:00
MCSectionCOFF.cpp
MCSectionELF.cpp
MCSectionMachO.cpp
MCSectionWasm.cpp
MCSectionXCOFF.cpp [AIX] Emit TOC entries for ASM printing 2019-11-27 17:20:55 -05:00
MCStreamer.cpp
MCSubtargetInfo.cpp
MCSymbol.cpp
MCSymbolELF.cpp [MC] Delete STT_SECTION special cases from MCSymbolELF::setType and setBinding 2019-12-15 20:39:25 -08:00
MCTargetOptions.cpp
MCValue.cpp [MC] Ignore VK_WEAKREF in MCValue::getAccessVariant 2019-12-15 16:05:46 -08:00
MCWasmObjectTargetWriter.cpp
MCWasmStreamer.cpp
MCWin64EH.cpp
MCWinCOFFStreamer.cpp
MCWinEH.cpp
MCXCOFFObjectTargetWriter.cpp
MCXCOFFStreamer.cpp [XCOFF][AIX] Emit TOC entries for object file generation 2019-12-04 16:44:44 +00:00
StringTableBuilder.cpp
SubtargetFeature.cpp
WasmObjectWriter.cpp [WebAssembly] Add new export_name clang attribute for controlling wasm export names 2019-12-11 11:54:57 -08:00
WinCOFFObjectWriter.cpp
XCOFFObjectWriter.cpp [BUG-FIX][XCOFF] fixed a bug of XCOFFObjectFile.cpp when there is padding at the last csect of a sections 2019-12-10 11:14:49 -05:00