summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-06-08 17:50:29 +0000
committerReid Kleckner <rnk@google.com>2016-06-08 17:50:29 +0000
commitee641c20cabc59d2d5e212226b9f052f5d0c6187 (patch)
tree037b24081fa2d58cf27e15bc5869a636a7a09e70 /llvm/lib/MC
parent2401c984756c25ec811bd6bbc3f4ad4f2a8e6cf6 (diff)
downloadbcm5719-llvm-ee641c20cabc59d2d5e212226b9f052f5d0c6187.tar.gz
bcm5719-llvm-ee641c20cabc59d2d5e212226b9f052f5d0c6187.zip
[codeview] Avoid emitting an empty file checksum table
Again, the Microsoft linker does not like empty substreams. We still emit an empty string table if CodeView is enabled, but that doesn't cause problems because it always contains at least one null byte. llvm-svn: 272183
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCCodeView.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCCodeView.cpp b/llvm/lib/MC/MCCodeView.cpp
index 8ae0187237a..2d8ef442f75 100644
--- a/llvm/lib/MC/MCCodeView.cpp
+++ b/llvm/lib/MC/MCCodeView.cpp
@@ -118,6 +118,11 @@ void CodeViewContext::emitStringTable(MCObjectStreamer &OS) {
}
void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) {
+ // Do nothing if there are no file checksums. Microsoft's linker rejects empty
+ // CodeView substreams.
+ if (Filenames.empty())
+ return;
+
MCContext &Ctx = OS.getContext();
MCSymbol *FileBegin = Ctx.createTempSymbol("filechecksums_begin", false),
*FileEnd = Ctx.createTempSymbol("filechecksums_end", false);
OpenPOWER on IntegriCloud