summaryrefslogtreecommitdiff
path: root/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-12-07 19:46:59 +0000
committerJim Grosbach <grosbach@apple.com>2011-12-07 19:46:59 +0000
commit577b09155f9a6fa38e5a7918da9701e120b3642f (patch)
treea2eefae85f5ef3c67c6ba1bf2218a61d3aea1ccc /lib/MC/MachObjectWriter.cpp
parentfeb468ab24a9e85b4d27faa6badfb57a2414610c (diff)
downloadllvm-577b09155f9a6fa38e5a7918da9701e120b3642f.tar.gz
llvm-577b09155f9a6fa38e5a7918da9701e120b3642f.tar.bz2
llvm-577b09155f9a6fa38e5a7918da9701e120b3642f.tar.xz
Darwin assembler improved relocs when w/o subsections_via_symbols.
When the file isn't being built with subsections-via-symbols, symbol differences involving non-local symbols can be resolved more aggressively. Needed for gas compatibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MachObjectWriter.cpp')
-rw-r--r--lib/MC/MachObjectWriter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index 6e720115dd..e016f09c95 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -584,9 +584,14 @@ IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
// requires the compiler to use .set to absolutize the differences between
// symbols which the compiler knows to be assembly time constants, so we
// don't need to worry about considering symbol differences fully resolved.
+ //
+ // If the file isn't using sub-sections-via-symbols, we can make the
+ // same assumptions about any symbol that we normally make about
+ // assembler locals.
if (!Asm.getBackend().hasReliableSymbolDifference()) {
- if (!SA.isTemporary() || !SA.isInSection() || &SecA != &SecB)
+ if ((!SA.isTemporary() && Asm.getSubsectionsViaSymbols()) ||
+ !SA.isInSection() || &SecA != &SecB)
return false;
return true;
}