diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 05:53:37 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 05:53:37 +0000 |
commit | 979ba5b3c7c818b826d06298ee7f79c4234faedb (patch) | |
tree | 1bb9d35e67a141014cacf8d1178610e47498f9b8 /lib/MC/MCAssembler.cpp | |
parent | 18ff2cced7e08ac76d8d5bcff8160a5f9a109cbb (diff) |
MC/Mach-O: Implement "absolutizing" semantics of .set, by evaluating the assembly time value of variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 21feeedd67..8d0075e93b 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -539,10 +539,10 @@ public: if (Target.isAbsolute()) { // constant // SymbolNum of 0 indicates the absolute section. // - // FIXME: When is this generated? + // FIXME: Currently, these are never generated (see code below). I cannot + // find a case where they are actually emitted. Type = RIT_Vanilla; Value = 0; - llvm_unreachable("FIXME: Not yet implemented!"); } else { const MCSymbol *Symbol = Target.getSymA(); MCSymbolData *SD = &Asm.getSymbolData(*Symbol); @@ -572,6 +572,12 @@ public: if (IsPCRel) Fixup.FixedValue -= Address; + // If the target evaluates to a constant, we don't need a relocation. This + // occurs with absolutized expressions which are not resolved to constants + // until after relaxation. + if (Target.isAbsolute()) + return; + // If this fixup is a vanilla PC relative relocation for a local label, we // don't need a relocation. // |