summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-12-21 22:09:27 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-12-21 22:09:27 +0000
commit56afa6e6600151858649d12e4360746918a7978b (patch)
tree0b855fb243390fc8279bc76976b319b8b1a98266 /tools/llvm-mc
parente7f0062250d0fb97a6e685f729859bb031fe67b1 (diff)
[MC, COFF] Support link /incremental conditionally
Today, we always take into account the possibility that object files produced by MC may be consumed by an incremental linker. This results in us initialing fields which vary with time (TimeDateStamp) which harms hermetic builds (e.g. verifying a self-host went well) and produces sub-optimal code because we cannot assume anything about the relative position of functions within a section (call sites can get redirected through incremental linker thunks). Let's provide an MCTargetOption which controls this behavior so that we can disable this functionality if we know a-priori that the build will not rely on /incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index f3b34e2502f..96e3f7c21a5 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -511,9 +511,10 @@ int main(int argc, char **argv) {
MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx);
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU);
- Str.reset(TheTarget->createMCObjectStreamer(TheTriple, Ctx, *MAB, *OS, CE,
- *STI, RelaxAll,
- /*DWARFMustBeAtTheEnd*/ false));
+ Str.reset(TheTarget->createMCObjectStreamer(
+ TheTriple, Ctx, *MAB, *OS, CE, *STI, MCOptions.MCRelaxAll,
+ MCOptions.MCIncrementalLinkerCompatible,
+ /*DWARFMustBeAtTheEnd*/ false));
if (NoExecStack)
Str->InitSections(true);
}