llvm-project/llvm/test/MC/MachO
Reid Kleckner 98bbd07cc3 [MC] Enable .file support on COFF and diagnose it on unsupported targets
Summary:
The "single parameter" .file directive appears to be an ELF-only feature
that is intended to insert the main source filename into the string
table table.

I noticed that if you assemble an ELF .s file for COFF, typically it
will assert right away on a .file directive near the top of the file. My
first change was to make this emit a proper error in the asm parser so
that we don't assert so easily.

However, COFF actually does have some support for this directive, and if
you emit an object file, llvm-mc does not assert. When emitting a COFF
object, MC will take those file names and create "debug" symbol table
entries for them. I'm not familiar with these kinds of symbol table
entries, and I'm not aware of any users of them, but @compnerd added
them a while ago. They don't introduce absolute paths, and most main
source file paths are short enough that this extra entry shouldn't cause
any problems, so I enabled the flag in MCAsmInfoCOFF that indicates that
it's supported.

This has the side effect of adding an extra debug symbol to every object
produced by clang, which is a pretty big functional change. My question
is, should we keep the functionality or remove it in the name of symbol
table minimalism?

Reviewers: mstorsjo, compnerd

Subscribers: hiraditya, compnerd, llvm-commits

Differential Revision: https://reviews.llvm.org/D55900

llvm-svn: 349976
2018-12-21 23:35:48 +00:00
..
AArch64 CodeGen: Use PLT relocations for relative references to unnamed_addr functions. 2016-04-22 20:40:10 +00:00
ARM [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
PowerPC
absolute.s
absolutize.s
alias.s [MachO] Fix codegen of alias of alias. 2017-06-08 20:49:03 +00:00
altentry.s
bad-darwin-x86_64-32-bit-abs-addr.s
bad-darwin-x86_64-diff-relocs.s
bad-darwin-x86_64-reloc-expr.s
bad-dollar.s
bad-indirect-symbols.s
bad-macro.s
bss.s
build-version-with-sdk-version.s [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
coal-sections-x86_64.s
comm-1.s
cstexpr-gotpcrel-32.ll [MachO][TLOF] Add support for local symbols in the indirect symbol table 2018-12-13 17:23:30 +00:00
cstexpr-gotpcrel-64.ll
darwin-complex-difference.s
darwin-sdk-version.ll [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
darwin-version-min-load-command.s Add LC_BUILD_VERSION load command 2017-01-23 20:07:55 +00:00
darwin-x86_64-diff-reloc-assign-2.s
darwin-x86_64-diff-reloc-assign.s
darwin-x86_64-diff-relocs.s
darwin-x86_64-nobase-relocs.s
darwin-x86_64-reloc-offsets.s
darwin-x86_64-reloc.s
data.s
debug_frame.s [CodeGen] Unify MBB reference format in both MIR and debug output 2017-12-04 17:18:51 +00:00
diff-with-two-sections.s MC/AsmPrinter: Reduce code duplication. 2017-12-14 03:59:24 +00:00
direction_labels.s
eh-frame-reloc.s
eh_symbol.s
empty-twice.ll
file-single.s [MC] Enable .file support on COFF and diagnose it on unsupported targets 2018-12-21 23:35:48 +00:00
file.s [MC/Dwarf] Unclamp DWARF linetables format on Darwin. 2018-09-13 13:13:50 +00:00
gen-dwarf-cpp.s [DebugInfo] Support DWARF v5 source code embedding extension 2018-02-23 23:01:06 +00:00
gen-dwarf-macro-cpp.s [DebugInfo] Support DWARF v5 source code embedding extension 2018-02-23 23:01:06 +00:00
gen-dwarf-producer.s llvm-dwarfdump: Make -brief the default and add a -verbose option instead. 2017-09-11 23:05:20 +00:00
gen-dwarf.s [MC/Dwarf] Unclamp DWARF linetables format on Darwin. 2018-09-13 13:13:50 +00:00
i386-large-relocations.s
indirect-symbols.s
jcc.s
lcomm-attributes.s
linker-option-1.s
linker-option-2.s
linker-options.ll IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata. 2017-06-12 20:10:48 +00:00
lit.local.cfg
loc.s [MC/Dwarf] Unclamp DWARF linetables format on Darwin. 2018-09-13 13:13:50 +00:00
osx-version-min-load-command-with-sdk-errors.s [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
osx-version-min-load-command-with-sdk.s [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
osx-version-min-load-command.s
pcrel-to-other-section.s
pr19185.s
previous.s
pushsection.s
relax-jumps.s
relax-recompute-align.s
reloc-diff.s
reloc-pcrel-offset.s
reloc-pcrel.s
reloc.s
section-align-1.s
section-align-2.s
section-attributes.s
section-flags.s
string-table.s
symbol-diff.s
symbol-flags.s
symbol-indirect.s
symbols-1.s
tbss.s
tdata.s
temp-labels.s
thread_init_func.s
tls.s
tlv-bss.ll
tlv-reloc.s
tlv.s
undefined-directional.s AsmParser: record "# line file" context to calculate location for diag 2016-04-13 19:46:54 +00:00
values.s
variable-errors.s
variable-exprs.s [MachO] Fix codegen of alias of alias. 2017-06-08 20:49:03 +00:00
weakdef.s
x86-data-in-code.s MachO: enable .data_region directives everywhere 2016-04-21 23:00:17 +00:00
x86_32-optimal_nop.s [X86] Emit 11-byte or 15-byte NOPs on recent AMD targets, else default to 10-byte NOPs (PR22965) 2018-01-29 21:24:31 +00:00
x86_32-scattered-reloc-fallback.s
x86_32-sections.s
x86_32-symbols.s
x86_64-mergeable.s
x86_64-reloc-arithmetic.s
x86_64-sections.s
x86_64-symbols.s
zero-space.s [MC] Error on a .zerofill directive in a non-virtual section 2018-07-02 17:29:43 +00:00
zerofill-1.s
zerofill-2.s
zerofill-3.s
zerofill-4.s
zerofill-5.s
zerofill-sect-align.s
zerofill-text.s [MC] Error on a .zerofill directive in a non-virtual section 2018-07-02 17:29:43 +00:00