summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-10 04:11:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-10 04:11:52 +0000
commit760bf9520ad1ec7a487ea1244c5c97ea235e4532 (patch)
treeaf912a6dc544790a24513c5ed67732dafb135ee5 /llvm/lib/CodeGen
parentfcc28218827b226092e27c77b5700e1f3c9c71b6 (diff)
downloadbcm5719-llvm-760bf9520ad1ec7a487ea1244c5c97ea235e4532.tar.gz
bcm5719-llvm-760bf9520ad1ec7a487ea1244c5c97ea235e4532.zip
Remove incredibly confusing isBaseAddressKnownZero.
When referring to a symbol in a dwarf section on ELF we should use .long foo instead of .long foo - .debug_something because ELF is unaware of the content of the sections and therefore needs relocations. This has nothing to do with optimizing a -0. llvm-svn: 231751
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp5
1 files changed, 2 insertions, 3 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;
}
OpenPOWER on IntegriCloud