mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
The DW_AT_GNU_pubnames/pubtypes attributes are actually form
SEC_OFFSET from the beginning of the section so go ahead and emit a label at the beginning of each one. llvm-svn: 191710
This commit is contained in:
parent
aa86376c19
commit
d9670853b9
@ -777,8 +777,29 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
|
|||||||
|
|
||||||
// Flag to let the linker know we have emitted new style pubnames. Only
|
// Flag to let the linker know we have emitted new style pubnames. Only
|
||||||
// emit it here if we don't have a skeleton CU for split dwarf.
|
// emit it here if we don't have a skeleton CU for split dwarf.
|
||||||
if (GenerateGnuPubSections)
|
if (GenerateGnuPubSections) {
|
||||||
NewCU->addFlag(Die, dwarf::DW_AT_GNU_pubnames);
|
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||||
|
NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubnames,
|
||||||
|
dwarf::DW_FORM_sec_offset,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames",
|
||||||
|
NewCU->getUniqueID()));
|
||||||
|
else
|
||||||
|
NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_data4,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames",
|
||||||
|
NewCU->getUniqueID()),
|
||||||
|
DwarfGnuPubNamesSectionSym);
|
||||||
|
|
||||||
|
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||||
|
NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubtypes,
|
||||||
|
dwarf::DW_FORM_sec_offset,
|
||||||
|
Asm->GetTempSymbol("gnu_pubtypes",
|
||||||
|
NewCU->getUniqueID()));
|
||||||
|
else
|
||||||
|
NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_data4,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames",
|
||||||
|
NewCU->getUniqueID()),
|
||||||
|
DwarfGnuPubTypesSectionSym);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DIUnit.isOptimized())
|
if (DIUnit.isOptimized())
|
||||||
@ -1967,7 +1988,9 @@ void DwarfDebug::emitSectionLabels() {
|
|||||||
emitSectionSym(Asm, TLOF.getDwarfLineSection(), "section_line");
|
emitSectionSym(Asm, TLOF.getDwarfLineSection(), "section_line");
|
||||||
emitSectionSym(Asm, TLOF.getDwarfLocSection());
|
emitSectionSym(Asm, TLOF.getDwarfLocSection());
|
||||||
if (GenerateGnuPubSections) {
|
if (GenerateGnuPubSections) {
|
||||||
|
DwarfGnuPubNamesSectionSym =
|
||||||
emitSectionSym(Asm, TLOF.getDwarfGnuPubNamesSection());
|
emitSectionSym(Asm, TLOF.getDwarfGnuPubNamesSection());
|
||||||
|
DwarfGnuPubTypesSectionSym =
|
||||||
emitSectionSym(Asm, TLOF.getDwarfGnuPubTypesSection());
|
emitSectionSym(Asm, TLOF.getDwarfGnuPubTypesSection());
|
||||||
} else if (HasDwarfPubSections) {
|
} else if (HasDwarfPubSections) {
|
||||||
emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());
|
emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());
|
||||||
@ -2400,6 +2423,11 @@ void DwarfDebug::emitDebugPubNames(bool GnuStyle) {
|
|||||||
// Start the dwarf pubnames section.
|
// Start the dwarf pubnames section.
|
||||||
Asm->OutStreamer.SwitchSection(PSec);
|
Asm->OutStreamer.SwitchSection(PSec);
|
||||||
|
|
||||||
|
// Emit a label so we can reference the beginning of this pubname section.
|
||||||
|
if (GnuStyle)
|
||||||
|
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("gnu_pubnames",
|
||||||
|
TheCU->getUniqueID()));
|
||||||
|
|
||||||
// Emit the header.
|
// Emit the header.
|
||||||
Asm->OutStreamer.AddComment("Length of Public Names Info");
|
Asm->OutStreamer.AddComment("Length of Public Names Info");
|
||||||
Asm->EmitLabelDifference(Asm->GetTempSymbol("pubnames_end", ID),
|
Asm->EmitLabelDifference(Asm->GetTempSymbol("pubnames_end", ID),
|
||||||
@ -2460,6 +2488,13 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) {
|
|||||||
CompileUnit *TheCU = I->second;
|
CompileUnit *TheCU = I->second;
|
||||||
// Start the dwarf pubtypes section.
|
// Start the dwarf pubtypes section.
|
||||||
Asm->OutStreamer.SwitchSection(PSec);
|
Asm->OutStreamer.SwitchSection(PSec);
|
||||||
|
|
||||||
|
// Emit a label so we can reference the beginning of this pubtype section.
|
||||||
|
if (GnuStyle)
|
||||||
|
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("gnu_pubtypes",
|
||||||
|
TheCU->getUniqueID()));
|
||||||
|
|
||||||
|
// Emit the header.
|
||||||
Asm->OutStreamer.AddComment("Length of Public Types Info");
|
Asm->OutStreamer.AddComment("Length of Public Types Info");
|
||||||
Asm->EmitLabelDifference(
|
Asm->EmitLabelDifference(
|
||||||
Asm->GetTempSymbol("pubtypes_end", TheCU->getUniqueID()),
|
Asm->GetTempSymbol("pubtypes_end", TheCU->getUniqueID()),
|
||||||
@ -2482,6 +2517,7 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) {
|
|||||||
Asm->GetTempSymbol(ISec->getLabelEndName(), TheCU->getUniqueID()),
|
Asm->GetTempSymbol(ISec->getLabelEndName(), TheCU->getUniqueID()),
|
||||||
Asm->GetTempSymbol(ISec->getLabelBeginName(), TheCU->getUniqueID()), 4);
|
Asm->GetTempSymbol(ISec->getLabelBeginName(), TheCU->getUniqueID()), 4);
|
||||||
|
|
||||||
|
// Emit the pubtypes.
|
||||||
const StringMap<DIE *> &Globals = TheCU->getGlobalTypes();
|
const StringMap<DIE *> &Globals = TheCU->getGlobalTypes();
|
||||||
for (StringMap<DIE *>::const_iterator GI = Globals.begin(),
|
for (StringMap<DIE *>::const_iterator GI = Globals.begin(),
|
||||||
GE = Globals.end();
|
GE = Globals.end();
|
||||||
@ -2929,8 +2965,23 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const CompileUnit *CU) {
|
|||||||
NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
|
NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
|
||||||
|
|
||||||
// Flag to let the linker know we have emitted new style pubnames.
|
// Flag to let the linker know we have emitted new style pubnames.
|
||||||
if (GenerateGnuPubSections)
|
if (GenerateGnuPubSections) {
|
||||||
NewCU->addFlag(Die, dwarf::DW_AT_GNU_pubnames);
|
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||||
|
NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_sec_offset,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()));
|
||||||
|
else
|
||||||
|
NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_data4,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()),
|
||||||
|
DwarfGnuPubNamesSectionSym);
|
||||||
|
|
||||||
|
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||||
|
NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_sec_offset,
|
||||||
|
Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID()));
|
||||||
|
else
|
||||||
|
NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_data4,
|
||||||
|
Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()),
|
||||||
|
DwarfGnuPubTypesSectionSym);
|
||||||
|
}
|
||||||
|
|
||||||
SkeletonHolder.addUnit(NewCU);
|
SkeletonHolder.addUnit(NewCU);
|
||||||
SkeletonCUs.push_back(NewCU);
|
SkeletonCUs.push_back(NewCU);
|
||||||
|
@ -411,6 +411,7 @@ class DwarfDebug {
|
|||||||
MCSymbol *DwarfDebugLocSectionSym, *DwarfLineSectionSym, *DwarfAddrSectionSym;
|
MCSymbol *DwarfDebugLocSectionSym, *DwarfLineSectionSym, *DwarfAddrSectionSym;
|
||||||
MCSymbol *FunctionBeginSym, *FunctionEndSym;
|
MCSymbol *FunctionBeginSym, *FunctionEndSym;
|
||||||
MCSymbol *DwarfAbbrevDWOSectionSym, *DwarfStrDWOSectionSym;
|
MCSymbol *DwarfAbbrevDWOSectionSym, *DwarfStrDWOSectionSym;
|
||||||
|
MCSymbol *DwarfGnuPubNamesSectionSym, *DwarfGnuPubTypesSectionSym;
|
||||||
|
|
||||||
// As an optimization, there is no need to emit an entry in the directory
|
// As an optimization, there is no need to emit an entry in the directory
|
||||||
// table for the same directory as DW_AT_comp_dir.
|
// table for the same directory as DW_AT_comp_dir.
|
||||||
|
@ -42,28 +42,30 @@
|
|||||||
; ASM-NEXT: .asciz "C" # External Name
|
; ASM-NEXT: .asciz "C" # External Name
|
||||||
|
|
||||||
; CHECK: .debug_info contents:
|
; CHECK: .debug_info contents:
|
||||||
; CHECK: 0x00000026: DW_TAG_base_type
|
; CHECK: DW_AT_GNU_pubnames [DW_FORM_sec_offset] (0x00000000)
|
||||||
|
; CHECK: DW_AT_GNU_pubtypes [DW_FORM_sec_offset] (0x00000000)
|
||||||
|
; CHECK: 0x0000002e: DW_TAG_base_type
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "int"
|
; CHECK-NEXT: DW_AT_name {{.*}} "int"
|
||||||
; CHECK: 0x00000032: DW_TAG_structure_type
|
; CHECK: 0x0000003a: DW_TAG_structure_type
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "C"
|
; CHECK-NEXT: DW_AT_name {{.*}} "C"
|
||||||
; CHECK: 0x00000046: DW_TAG_subprogram
|
; CHECK: 0x0000004e: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
|
; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
|
||||||
; CHECK: 0x00000058: DW_TAG_subprogram
|
; CHECK: 0x00000060: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
|
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
|
||||||
; CHECK: 0x0000007c: DW_TAG_variable
|
; CHECK: 0x00000084: DW_TAG_variable
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "global_variable"
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_variable"
|
||||||
; CHECK: 0x00000098: DW_TAG_variable
|
; CHECK: 0x000000a0: DW_TAG_variable
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable"
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable"
|
||||||
; CHECK: 0x000000a7: DW_TAG_subprogram
|
; CHECK: 0x000000af: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_function"
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_function"
|
||||||
; CHECK: 0x000000c2: DW_TAG_subprogram
|
; CHECK: 0x000000ca: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_specification {{.*}}0x00000046}
|
; CHECK-NEXT: DW_AT_specification {{.*}}0x0000004e}
|
||||||
; CHECK: 0x000000ea: DW_TAG_subprogram
|
; CHECK: 0x000000f2: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_specification {{.*}}0x00000058}
|
; CHECK-NEXT: DW_AT_specification {{.*}}0x00000060}
|
||||||
; CHECK: 0x00000101: DW_TAG_subprogram
|
; CHECK: 0x00000109: DW_TAG_subprogram
|
||||||
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
; CHECK-NEXT: DW_AT_MIPS_linkage_name
|
||||||
; CHECK-NEXT: DW_AT_name {{.*}} "global_function"
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_function"
|
||||||
|
|
||||||
@ -71,15 +73,15 @@
|
|||||||
; CHECK-NEXT: Length: 175
|
; CHECK-NEXT: Length: 175
|
||||||
; CHECK-NEXT: Version: 2
|
; CHECK-NEXT: Version: 2
|
||||||
; CHECK-NEXT: Offset in .debug_info: 0
|
; CHECK-NEXT: Offset in .debug_info: 0
|
||||||
; CHECK-NEXT: Size: 319
|
; CHECK-NEXT: Size: 327
|
||||||
; CHECK-NEXT: Offset Linkage Kind Name
|
; CHECK-NEXT: Offset Linkage Kind Name
|
||||||
; CHECK-DAG: 0x00000091 EXTERNAL TYPE "ns"
|
; CHECK-DAG: 0x00000099 EXTERNAL TYPE "ns"
|
||||||
; CHECK-DAG: 0x00000098 EXTERNAL VARIABLE "global_namespace_variable"
|
; CHECK-DAG: 0x000000a0 EXTERNAL VARIABLE "global_namespace_variable"
|
||||||
; CHECK-DAG: 0x000000a7 EXTERNAL FUNCTION "global_namespace_function"
|
; CHECK-DAG: 0x000000af EXTERNAL FUNCTION "global_namespace_function"
|
||||||
; CHECK-DAG: 0x000000ea STATIC FUNCTION "static_member_function"
|
; CHECK-DAG: 0x000000f2 STATIC FUNCTION "static_member_function"
|
||||||
; CHECK-DAG: 0x0000007c EXTERNAL VARIABLE "global_variable"
|
; CHECK-DAG: 0x00000084 EXTERNAL VARIABLE "global_variable"
|
||||||
; CHECK-DAG: 0x00000101 EXTERNAL FUNCTION "global_function"
|
; CHECK-DAG: 0x00000109 EXTERNAL FUNCTION "global_function"
|
||||||
; CHECK-DAG: 0x000000c2 STATIC FUNCTION "member_function"
|
; CHECK-DAG: 0x000000ca STATIC FUNCTION "member_function"
|
||||||
|
|
||||||
; CHECK-LABEL: debug_gnu_pubtypes contents:
|
; CHECK-LABEL: debug_gnu_pubtypes contents:
|
||||||
; CHECK-NEXT: Length:
|
; CHECK-NEXT: Length:
|
||||||
@ -87,8 +89,8 @@
|
|||||||
; CHECK-NEXT: Offset in .debug_info:
|
; CHECK-NEXT: Offset in .debug_info:
|
||||||
; CHECK-NEXT: Size:
|
; CHECK-NEXT: Size:
|
||||||
; CHECK-NEXT: Offset Linkage Kind Name
|
; CHECK-NEXT: Offset Linkage Kind Name
|
||||||
; CHECK-DAG: 0x00000032 EXTERNAL TYPE "C"
|
; CHECK-DAG: 0x0000003a EXTERNAL TYPE "C"
|
||||||
; CHECK-DAG: 0x00000026 STATIC TYPE "int"
|
; CHECK-DAG: 0x0000002e STATIC TYPE "int"
|
||||||
|
|
||||||
%struct.C = type { i8 }
|
%struct.C = type { i8 }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user