mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 01:48:15 +00:00
[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
This commit is contained in:
parent
4009301768
commit
16fb1d2906
@ -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);
|
||||
|
13
test/MC/COFF/cv-empty-file-table.s
Normal file
13
test/MC/COFF/cv-empty-file-table.s
Normal file
@ -0,0 +1,13 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple i686-pc-win32 < %s | llvm-readobj -codeview - | FileCheck %s
|
||||
.text
|
||||
.section .debug$S,"dr"
|
||||
.p2align 2
|
||||
.long 4 # Debug section magic
|
||||
.cv_filechecksums # File index to string table offset subsection
|
||||
.cv_stringtable # String table
|
||||
|
||||
# CHECK: CodeViewDebugInfo [
|
||||
# CHECK: Section: .debug$S (4)
|
||||
# CHECK: Magic: 0x4
|
||||
# CHECK-NOT: FileChecksum
|
||||
# CHECK: ]
|
Loading…
x
Reference in New Issue
Block a user