[llvm-commits] [llvm] r122037 - in /llvm/trunk: include/llvm/MC/MCObjectWriter.h lib/MC/ELFObjectWriter.cpp lib/MC/MachObjectWriter.cpp lib/MC/WinCOFFObjectWriter.cpp
Daniel Dunbar
daniel at zuster.org
Thu Dec 16 20:54:54 PST 2010
Author: ddunbar
Date: Thu Dec 16 22:54:54 2010
New Revision: 122037
URL: http://llvm.org/viewvc/llvm-project?rev=122037&view=rev
Log:
MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format specific hook.
- Currently just has stub implementations for Mach-O, ELF, and COFF.
Modified:
llvm/trunk/include/llvm/MC/MCObjectWriter.h
llvm/trunk/lib/MC/ELFObjectWriter.cpp
llvm/trunk/lib/MC/MachObjectWriter.cpp
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=122037&r1=122036&r2=122037&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Thu Dec 16 22:54:54 2010
@@ -20,6 +20,7 @@
class MCAssembler;
class MCFixup;
class MCFragment;
+class MCSymbolRefExpr;
class MCValue;
class raw_ostream;
@@ -77,6 +78,16 @@
const MCFixup &Fixup, MCValue Target,
uint64_t &FixedValue) = 0;
+ /// \brief Check whether the difference (A - B) between two symbol
+ /// references is fully resolved.
+ ///
+ /// Clients are not required to answer precisely and may conservatively return
+ /// false, even when a difference is fully resolved.
+ virtual bool
+ IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
+ const MCSymbolRefExpr *A,
+ const MCSymbolRefExpr *B) const = 0;
+
/// Check if a fixup is fully resolved.
///
/// This routine is used by the assembler to let the file format decide
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=122037&r1=122036&r2=122037&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Dec 16 22:54:54 2010
@@ -333,8 +333,17 @@
uint64_t Size, uint32_t Link, uint32_t Info,
uint64_t Alignment, uint64_t EntrySize);
- virtual void WriteRelocationsFragment(const MCAssembler &Asm, MCDataFragment *F,
- const MCSectionData *SD);
+ virtual void WriteRelocationsFragment(const MCAssembler &Asm,
+ MCDataFragment *F,
+ const MCSectionData *SD);
+
+ virtual bool
+ IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
+ const MCSymbolRefExpr *A,
+ const MCSymbolRefExpr *B) const {
+ // FIXME: Implement this!
+ return false;
+ }
virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
const MCValue Target,
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=122037&r1=122036&r2=122037&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Thu Dec 16 22:54:54 2010
@@ -1123,6 +1123,12 @@
UndefinedSymbolData);
}
+ bool IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
+ const MCSymbolRefExpr *A,
+ const MCSymbolRefExpr *B) const {
+ return false;
+ }
+
bool IsFixupFullyResolved(const MCAssembler &Asm,
const MCValue Target,
bool IsPCRel,
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=122037&r1=122036&r2=122037&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Thu Dec 16 22:54:54 2010
@@ -179,6 +179,14 @@
MCValue Target,
uint64_t &FixedValue);
+ virtual bool
+ IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
+ const MCSymbolRefExpr *A,
+ const MCSymbolRefExpr *B) const {
+ // FIXME: Implement this!
+ return false;
+ }
+
virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
const MCValue Target,
bool IsPCRel,
More information about the llvm-commits
mailing list