mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
[COFF] Add an LLD specific option -debug:symbtab
With this set, we retain the symbol table, but skip the actual debug information. This is meant to be used by the MinGW frontend. Differential Revision: https://reviews.llvm.org/D48745 llvm-svn: 335946
This commit is contained in:
parent
8bf793fb35
commit
3a7905b2aa
@ -98,6 +98,7 @@ struct Configuration {
|
||||
bool Debug = false;
|
||||
bool DebugDwarf = false;
|
||||
bool DebugGHashes = false;
|
||||
bool DebugSymtab = false;
|
||||
bool ShowTiming = false;
|
||||
unsigned DebugTypes = static_cast<unsigned>(DebugType::None);
|
||||
std::vector<std::string> NatvisFiles;
|
||||
|
@ -1217,6 +1217,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
||||
!Config->DLL && Args.hasFlag(OPT_tsaware, OPT_tsaware_no, true);
|
||||
Config->DebugDwarf = Args.hasArg(OPT_debug_dwarf);
|
||||
Config->DebugGHashes = Args.hasArg(OPT_debug_ghash);
|
||||
Config->DebugSymtab = Args.hasArg(OPT_debug_symtab);
|
||||
|
||||
Config->MapFile = getMapFile(Args);
|
||||
|
||||
|
@ -139,6 +139,7 @@ def help_q : Flag<["/?", "-?"], "">, Alias<help>;
|
||||
// LLD extensions
|
||||
def debug_ghash : F<"debug:ghash">;
|
||||
def debug_dwarf : F<"debug:dwarf">;
|
||||
def debug_symtab : F<"debug:symtab">;
|
||||
def export_all_symbols : F<"export-all-symbols">;
|
||||
def kill_at : F<"kill-at">;
|
||||
def lldmingw : F<"lldmingw">;
|
||||
|
@ -665,7 +665,7 @@ void Writer::createSymbolAndStringTable() {
|
||||
Sec->setStringTableOff(addEntryToStringTable(Sec->Name));
|
||||
}
|
||||
|
||||
if (Config->DebugDwarf) {
|
||||
if (Config->DebugDwarf || Config->DebugSymtab) {
|
||||
for (ObjFile *File : ObjFile::Instances) {
|
||||
for (Symbol *B : File->getSymbols()) {
|
||||
auto *D = dyn_cast_or_null<Defined>(B);
|
||||
|
@ -1,6 +1,12 @@
|
||||
# RUN: yaml2obj < %s > %t.obj
|
||||
# RUN: lld-link /debug /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -sections %t.exe | FileCheck %s
|
||||
# RUN: lld-link /debug:dwarf /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -sections %t.exe | FileCheck %s
|
||||
# RUN: lld-link /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -sections %t.exe | FileCheck -check-prefix=NODEBUG %s
|
||||
# RUN: lld-link /debug:symtab /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -sections %t.exe | FileCheck -check-prefix=NODEBUG %s
|
||||
|
||||
# CHECK: Name: .text
|
||||
# CHECK: Name: .debug_abbrev
|
||||
@ -10,6 +16,13 @@
|
||||
# CHECK: Name: .debug_pubtypes
|
||||
# CHECK: Name: .reloc
|
||||
|
||||
# NODEBUG: Name: .text
|
||||
# NODEBUG-NOT: Name: .debug_abbrev
|
||||
# NODEBUG-NOT: Name: .debug_info
|
||||
# NODEBUG-NOT: Name: .debug_line
|
||||
# NODEBUG-NOT: Name: .debug_pubnames
|
||||
# NODEBUG-NOT: Name: .debug_pubtypes
|
||||
# NODEBUG: Name: .reloc
|
||||
|
||||
--- !COFF
|
||||
header:
|
||||
|
@ -3,6 +3,8 @@
|
||||
# RUN: llvm-readobj -symbols %t.exe | FileCheck %s
|
||||
# RUN: lld-link /debug:dwarf /opt:noref /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
|
||||
# RUN: llvm-readobj -symbols %t.exe | FileCheck %s
|
||||
# RUN: lld-link /debug:symtab /opt:noref /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
|
||||
# RUN: llvm-readobj -symbols %t.exe | FileCheck %s
|
||||
|
||||
# RUN: lld-link /debug /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
|
||||
# RUN: llvm-readobj -symbols %t.exe | FileCheck -check-prefix=NO %s
|
||||
|
Loading…
Reference in New Issue
Block a user