git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188296
91177308-0d34-0410-b5e6-
96231b3b80d8
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
+ unsigned Size,
+ bool IsSectionRelative = false) const;
/// EmitLabelReference - Emit something like ".long Label"
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label.
/// EmitLabelReference - Emit something like ".long Label"
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label.
- void EmitLabelReference(const MCSymbol *Label, unsigned Size) const {
- EmitLabelPlusOffset(Label, 0, Size);
+ void EmitLabelReference(const MCSymbol *Label, unsigned Size,
+ bool IsSectionRelative = false) const {
+ EmitLabelPlusOffset(Label, 0, Size, IsSectionRelative);
}
//===------------------------------------------------------------------===//
}
//===------------------------------------------------------------------===//
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void AsmPrinter::EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void AsmPrinter::EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
+ unsigned Size, bool IsSectionRelative)
- if (MAI->needsDwarfSectionOffsetDirective() && Size == 4) { // secrel32 ONLY works for 32bits.
+ if (MAI->needsDwarfSectionOffsetDirective() && IsSectionRelative) {
OutStreamer.EmitCOFFSecRel32(Label);
return;
}
OutStreamer.EmitCOFFSecRel32(Label);
return;
}
/// EmitValue - Emit label value.
///
void DIELabel::EmitValue(AsmPrinter *AP, uint16_t Form) const {
/// EmitValue - Emit label value.
///
void DIELabel::EmitValue(AsmPrinter *AP, uint16_t Form) const {
- AP->EmitLabelReference(Label, SizeOf(AP, Form));
+ AP->EmitLabelReference(Label, SizeOf(AP, Form), Form == dwarf::DW_FORM_strp
+ || Form == dwarf::DW_FORM_sec_offset || Form == dwarf::DW_OP_call_ref
+ || Form == dwarf::DW_FORM_ref_addr);
}
/// SizeOf - Determine size of label value in bytes.
}
/// SizeOf - Determine size of label value in bytes.