diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-21 20:27:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-21 20:27:21 +0000 |
commit | 4d221b3e89604126826732ea549a065a30276cd6 (patch) | |
tree | 2ad36272676ae87190826e00f7ec2a8e4b93ed1c /lib/CodeGen | |
parent | 1eb67a4f84d49d88454e2b6142d30e81c839209f (diff) | |
download | llvm-4d221b3e89604126826732ea549a065a30276cd6.tar.gz llvm-4d221b3e89604126826732ea549a065a30276cd6.tar.bz2 llvm-4d221b3e89604126826732ea549a065a30276cd6.tar.xz |
DebugInfo: Omit DW_AT_addr_base from skeletal type units.
Type units have no addresses, so there's no need for DW_AT_addr_base.
This removes another relocation from every skeletal type unit and brings
LLVM's skeletal type units in line with GCC's (containing only
GNU_dwo_name (strp), comp_dir (strp), and GNU_pubnames (flag_present)).
Cary's got some ideas about using str_index in the .o file to reduce
those last two relocations (well, replace two relocations with one
relocation (pointing to the string index) and two indicies)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 22512e83d7..027f0b89a5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2637,13 +2637,6 @@ void DwarfDebug::initSkeletonUnit(const DwarfUnit *U, DIE *Die, NewU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name, U->getCUNode().getSplitDebugFilename()); - // Relocate to the beginning of the addr_base section, else 0 for the - // beginning of the one for this compile unit. - if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) - NewU->addSectionLabel(Die, dwarf::DW_AT_GNU_addr_base, DwarfAddrSectionSym); - else - NewU->addSectionOffset(Die, dwarf::DW_AT_GNU_addr_base, 0); - if (!CompilationDir.empty()) NewU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir); @@ -2668,6 +2661,13 @@ DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) { initSkeletonUnit(CU, Die, NewCU); + // Relocate to the beginning of the addr_base section, else 0 for the + // beginning of the one for this compile unit. + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) + NewCU->addSectionLabel(Die, dwarf::DW_AT_GNU_addr_base, DwarfAddrSectionSym); + else + NewCU->addSectionOffset(Die, dwarf::DW_AT_GNU_addr_base, 0); + return NewCU; } |