summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-26 13:57:37 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-26 13:57:37 +0000
commitc1710a04bad5d7bb01a04727a5404c52533241a7 (patch)
tree15d60eb798ab19a2c5b0441bd3ec47a2091f3f4a /llvm/lib/MC/MCMachOStreamer.cpp
parenta0e01bec875533217ab9076154f0d95efcd34c31 (diff)
downloadbcm5719-llvm-c1710a04bad5d7bb01a04727a5404c52533241a7.tar.gz
bcm5719-llvm-c1710a04bad5d7bb01a04727a5404c52533241a7.zip
llvm-mc: Add symbol entries for undefined symbols used in .fill and .org.
llvm-svn: 80086
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index bed0d43d379..4a888078833 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -72,6 +72,14 @@ public:
: MCStreamer(Context), Assembler(_OS), CurSectionData(0) {}
~MCMachOStreamer() {}
+ const MCValue &AddValueSymbols(const MCValue &Value) {
+ if (Value.getSymA())
+ getSymbolData(*const_cast<MCSymbol*>(Value.getSymA()));
+ if (Value.getSymB())
+ getSymbolData(*const_cast<MCSymbol*>(Value.getSymB()));
+ return Value;
+ }
+
/// @name MCStreamer Interface
/// @{
@@ -265,7 +273,7 @@ void MCMachOStreamer::EmitBytes(const StringRef &Data) {
}
void MCMachOStreamer::EmitValue(const MCValue &Value, unsigned Size) {
- new MCFillFragment(Value, Size, 1, CurSectionData);
+ new MCFillFragment(AddValueSymbols(Value), Size, 1, CurSectionData);
}
void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
@@ -283,7 +291,7 @@ void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
void MCMachOStreamer::EmitValueToOffset(const MCValue &Offset,
unsigned char Value) {
- new MCOrgFragment(Offset, Value, CurSectionData);
+ new MCOrgFragment(AddValueSymbols(Offset), Value, CurSectionData);
}
void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
OpenPOWER on IntegriCloud