diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXSection.h | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp index 37434312555..50047c1ab71 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp @@ -179,9 +179,8 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label, assert((!Label->isInSection() || &Label->getSection() == &Section) && "Section offset using wrong section base for label"); - // If the section in question will end up with an address of 0 anyway, we can - // just emit an absolute reference to save a relocation. - if (Section.isBaseAddressKnownZero()) { + // If the format uses relocations with dwarf, refer to the symbol directly. + if (MAI->doesDwarfUseRelocationsAcrossSections()) { OutStreamer.EmitSymbolValue(Label, 4); return; } diff --git a/llvm/lib/Target/NVPTX/NVPTXSection.h b/llvm/lib/Target/NVPTX/NVPTXSection.h index 6bb1e3dbb27..6b412b4a4c9 100644 --- a/llvm/lib/Target/NVPTX/NVPTXSection.h +++ b/llvm/lib/Target/NVPTX/NVPTXSection.h @@ -36,7 +36,6 @@ public: const MCExpr *Subsection) const override {} /// Base address of PTX sections is zero. - bool isBaseAddressKnownZero() const override { return true; } bool UseCodeAlign() const override { return false; } bool isVirtualSection() const override { return false; } }; |