diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-06 15:27:57 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-06 15:27:57 +0000 |
commit | 94a88d7165e5b921c175c93d1a8235738a68507a (patch) | |
tree | 8ba464707dbea8238fc624778dec932a430fa5ee /llvm/lib/MC/MCObjectWriter.cpp | |
parent | af15b6dad95da8c70ec8be4ba5e93ad80ed1bd55 (diff) | |
download | bcm5719-llvm-94a88d7165e5b921c175c93d1a8235738a68507a.tar.gz bcm5719-llvm-94a88d7165e5b921c175c93d1a8235738a68507a.zip |
Be consistent when deciding if a relocation is needed.
Before when deciding if we needed a relocation in A-B, we wore only checking
if A was weak.
This fixes the asymmetry.
The "InSet" argument should probably be renamed to "ForValue", since InSet is
very MachO specific, but doing so in this patch would make it hard to read.
This fixes PR22815.
llvm-svn: 234165
Diffstat (limited to 'llvm/lib/MC/MCObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectWriter.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCObjectWriter.cpp b/llvm/lib/MC/MCObjectWriter.cpp index 3c536ecc9fd..33e4556e102 100644 --- a/llvm/lib/MC/MCObjectWriter.cpp +++ b/llvm/lib/MC/MCObjectWriter.cpp @@ -35,18 +35,14 @@ bool MCObjectWriter::IsSymbolRefDifferenceFullyResolved( if(!DataA.getFragment() || !DataB.getFragment()) return false; - return IsSymbolRefDifferenceFullyResolvedImpl(Asm, DataA, - *DataB.getFragment(), - InSet, - false); + return IsSymbolRefDifferenceFullyResolvedImpl( + Asm, DataA, &DataB, *DataB.getFragment(), InSet, false); } -bool -MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm, - const MCSymbolData &DataA, - const MCFragment &FB, - bool InSet, - bool IsPCRel) const { +bool MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl( + const MCAssembler &Asm, const MCSymbolData &DataA, + const MCSymbolData *DataB, const MCFragment &FB, bool InSet, + bool IsPCRel) const { const MCSection &SecA = DataA.getSymbol().AliasedSymbol().getSection(); const MCSection &SecB = FB.getParent()->getSection(); // On ELF and COFF A - B is absolute if A and B are in the same section. |