DebugInfo: Produce debug_{gnu_}pub{names,types} entries when explicitly requested...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 25 May 2017 18:50:28 +0000 (18:50 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 25 May 2017 18:50:28 +0000 (18:50 +0000)
commitb3cee2fb42e9117d6ec2e291e9e99cb4eb99c18d
tree5e0af2e2c334031a4ffc7dfb9ec19dbc9f959193
parent236e78101127a35971405201c7ab0563ce8601af
DebugInfo: Produce debug_{gnu_}pub{names,types} entries when explicitly requested, even in -gmlt or when empty

Turns out gold doesn't use the DW_AT_GNU_pubnames to decide whether to
parse the rest of the DIEs when building gdb-index. This causes gold to
trip over LLVM's output when there are DW_FORM_ref_addr present.

Gold does use the presence of a debug_gnu_pub{names,types} entry for the
CU to skip parsing the debug_info portion, so make sure that's included
even when empty (technically, when empty there couldn't be any ref_addr
anyway - it only came up when gmlt didn't produce any (even non-empty)
pubnames - but given what that reveals about gold's implementation, this
seems like a good thing to do for consistency).

llvm-svn: 303894
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/test/DebugInfo/Generic/empty.ll
llvm/test/DebugInfo/X86/empty.ll
llvm/test/DebugInfo/X86/gnu-public-names-empty.ll
llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll [new file with mode: 0644]