blob: acfda32cdaa9e12da50b1d06d5e4d5d7c3785376 [file] [log] [blame]
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +00001//===- lib/MC/MCMachOStreamer.cpp - Mach-O Object Output ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCStreamer.h"
11
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000012#include "llvm/MC/MCAssembler.h"
13#include "llvm/MC/MCContext.h"
Daniel Dunbar4fac7492009-08-27 08:17:51 +000014#include "llvm/MC/MCCodeEmitter.h"
Daniel Dunbar8c2eebe2009-08-31 08:08:38 +000015#include "llvm/MC/MCExpr.h"
Daniel Dunbar4fac7492009-08-27 08:17:51 +000016#include "llvm/MC/MCInst.h"
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000017#include "llvm/MC/MCSection.h"
18#include "llvm/MC/MCSymbol.h"
Daniel Dunbar821e3332009-08-31 08:09:28 +000019#include "llvm/MC/MCValue.h"
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000020#include "llvm/Support/ErrorHandling.h"
Daniel Dunbar4fac7492009-08-27 08:17:51 +000021#include "llvm/Support/raw_ostream.h"
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000022using namespace llvm;
23
24namespace {
25
26class MCMachOStreamer : public MCStreamer {
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +000027 /// SymbolFlags - We store the value for the 'desc' symbol field in the lowest
28 /// 16 bits of the implementation defined flags.
29 enum SymbolFlags { // See <mach-o/nlist.h>.
30 SF_DescFlagsMask = 0xFFFF,
31
32 // Reference type flags.
33 SF_ReferenceTypeMask = 0x0007,
34 SF_ReferenceTypeUndefinedNonLazy = 0x0000,
35 SF_ReferenceTypeUndefinedLazy = 0x0001,
36 SF_ReferenceTypeDefined = 0x0002,
37 SF_ReferenceTypePrivateDefined = 0x0003,
38 SF_ReferenceTypePrivateUndefinedNonLazy = 0x0004,
39 SF_ReferenceTypePrivateUndefinedLazy = 0x0005,
40
41 // Other 'desc' flags.
42 SF_NoDeadStrip = 0x0020,
43 SF_WeakReference = 0x0040,
44 SF_WeakDefinition = 0x0080
45 };
46
47private:
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000048 MCAssembler Assembler;
49
Daniel Dunbar4fac7492009-08-27 08:17:51 +000050 MCCodeEmitter *Emitter;
51
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000052 MCSectionData *CurSectionData;
53
54 DenseMap<const MCSection*, MCSectionData*> SectionMap;
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +000055
56 DenseMap<const MCSymbol*, MCSymbolData*> SymbolMap;
57
58private:
59 MCFragment *getCurrentFragment() const {
60 assert(CurSectionData && "No current section!");
61
62 if (!CurSectionData->empty())
63 return &CurSectionData->getFragmentList().back();
64
65 return 0;
66 }
67
Daniel Dunbar0f5fa692009-08-28 05:48:54 +000068 MCSectionData &getSectionData(const MCSection &Section) {
69 MCSectionData *&Entry = SectionMap[&Section];
70
71 if (!Entry)
72 Entry = new MCSectionData(Section, &Assembler);
73
74 return *Entry;
75 }
76
Daniel Dunbarcb579b32009-08-31 08:08:06 +000077 MCSymbolData &getSymbolData(const MCSymbol &Symbol) {
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +000078 MCSymbolData *&Entry = SymbolMap[&Symbol];
79
80 if (!Entry)
81 Entry = new MCSymbolData(Symbol, 0, 0, &Assembler);
82
83 return *Entry;
84 }
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000085
86public:
Daniel Dunbar4fac7492009-08-27 08:17:51 +000087 MCMachOStreamer(MCContext &Context, raw_ostream &_OS, MCCodeEmitter *_Emitter)
Daniel Dunbara03a3682009-08-31 08:07:55 +000088 : MCStreamer(Context), Assembler(Context, _OS), Emitter(_Emitter),
Daniel Dunbar4fac7492009-08-27 08:17:51 +000089 CurSectionData(0) {}
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +000090 ~MCMachOStreamer() {}
91
Daniel Dunbar8c2eebe2009-08-31 08:08:38 +000092 const MCExpr *AddValueSymbols(const MCExpr *Value) {
93 switch (Value->getKind()) {
94 case MCExpr::Constant:
95 break;
96
97 case MCExpr::Binary: {
98 const MCBinaryExpr *BE = cast<MCBinaryExpr>(Value);
99 AddValueSymbols(BE->getLHS());
100 AddValueSymbols(BE->getRHS());
101 break;
102 }
103
104 case MCExpr::SymbolRef:
105 getSymbolData(cast<MCSymbolRefExpr>(Value)->getSymbol());
106 break;
107
108 case MCExpr::Unary:
109 AddValueSymbols(cast<MCUnaryExpr>(Value)->getSubExpr());
110 break;
111 }
112
113 return Value;
114 }
115
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000116 /// @name MCStreamer Interface
117 /// @{
118
119 virtual void SwitchSection(const MCSection *Section);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000120 virtual void EmitLabel(MCSymbol *Symbol);
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000121 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
Daniel Dunbar821e3332009-08-31 08:09:28 +0000122 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000123 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000124 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
Chris Lattner9eb158d2010-01-23 07:47:02 +0000125 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000126 unsigned ByteAlignment);
Chris Lattner99328ad2010-01-25 07:52:13 +0000127 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
128 assert(0 && "macho doesn't support this directive");
129 }
Chris Lattner9eb158d2010-01-23 07:47:02 +0000130 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) {
131 assert(0 && "macho doesn't support this directive");
132 }
Daniel Dunbar8751b942009-08-28 05:48:22 +0000133 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000134 unsigned Size = 0, unsigned ByteAlignment = 0);
Chris Lattneraaec2052010-01-19 19:46:13 +0000135 virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
Chris Lattneraaec2052010-01-19 19:46:13 +0000136 virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000137 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
138 unsigned ValueSize = 1,
139 unsigned MaxBytesToEmit = 0);
Daniel Dunbar821e3332009-08-31 08:09:28 +0000140 virtual void EmitValueToOffset(const MCExpr *Offset,
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000141 unsigned char Value = 0);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000142 virtual void EmitInstruction(const MCInst &Inst);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000143 virtual void Finish();
144
145 /// @}
146};
147
148} // end anonymous namespace.
149
150void MCMachOStreamer::SwitchSection(const MCSection *Section) {
151 assert(Section && "Cannot switch to a null section!");
Chris Lattnercda7f782009-08-22 19:35:08 +0000152
153 // If already in this section, then this is a noop.
154 if (Section == CurSection) return;
Daniel Dunbar0f5fa692009-08-28 05:48:54 +0000155
Chris Lattnercda7f782009-08-22 19:35:08 +0000156 CurSection = Section;
Daniel Dunbar0f5fa692009-08-28 05:48:54 +0000157 CurSectionData = &getSectionData(*Section);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000158}
159
160void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
Daniel Dunbar8906ff12009-08-22 07:22:36 +0000161 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000162
Daniel Dunbar5e835962009-08-26 02:48:04 +0000163 // FIXME: We should also use offsets into Fill fragments.
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +0000164 MCDataFragment *F = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
165 if (!F)
166 F = new MCDataFragment(CurSectionData);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000167
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +0000168 MCSymbolData &SD = getSymbolData(*Symbol);
169 assert(!SD.getFragment() && "Unexpected fragment on symbol data!");
170 SD.setFragment(F);
171 SD.setOffset(F->getContents().size());
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000172
173 // This causes the reference type and weak reference flags to be cleared.
174 SD.setFlags(SD.getFlags() & ~(SF_WeakReference | SF_ReferenceTypeMask));
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +0000175
Daniel Dunbar8906ff12009-08-22 07:22:36 +0000176 Symbol->setSection(*CurSection);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000177}
178
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000179void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
Daniel Dunbar6009db42009-08-26 21:22:22 +0000180 switch (Flag) {
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000181 case MCAF_SubsectionsViaSymbols:
Daniel Dunbar6009db42009-08-26 21:22:22 +0000182 Assembler.setSubsectionsViaSymbols(true);
Daniel Dunbar8c3eaf42009-08-28 07:08:47 +0000183 return;
Daniel Dunbar6009db42009-08-26 21:22:22 +0000184 }
Daniel Dunbar8c3eaf42009-08-28 07:08:47 +0000185
186 assert(0 && "invalid assembler flag!");
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000187}
188
Daniel Dunbar821e3332009-08-31 08:09:28 +0000189void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
Daniel Dunbar8906ff12009-08-22 07:22:36 +0000190 // Only absolute symbols can be redefined.
191 assert((Symbol->isUndefined() || Symbol->isAbsolute()) &&
192 "Cannot define a symbol twice!");
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000193
Daniel Dunbara4d86672009-10-16 01:58:23 +0000194 // FIXME: Lift context changes into super class.
195 // FIXME: Set associated section.
196 Symbol->setValue(Value);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000197}
198
199void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000200 MCSymbolAttr Attribute) {
Daniel Dunbar0c7761b2009-08-24 11:56:58 +0000201 // Indirect symbols are handled differently, to match how 'as' handles
202 // them. This makes writing matching .o files easier.
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000203 if (Attribute == MCSA_IndirectSymbol) {
Daniel Dunbarad7c3d52009-08-26 00:18:21 +0000204 // Note that we intentionally cannot use the symbol data here; this is
205 // important for matching the string table that 'as' generates.
Daniel Dunbar0c7761b2009-08-24 11:56:58 +0000206 IndirectSymbolData ISD;
207 ISD.Symbol = Symbol;
208 ISD.SectionData = CurSectionData;
209 Assembler.getIndirectSymbols().push_back(ISD);
210 return;
211 }
212
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000213 // Adding a symbol attribute always introduces the symbol, note that an
214 // important side effect of calling getSymbolData here is to register the
215 // symbol with the assembler.
216 MCSymbolData &SD = getSymbolData(*Symbol);
217
218 // The implementation of symbol attributes is designed to match 'as', but it
219 // leaves much to desired. It doesn't really make sense to arbitrarily add and
220 // remove flags, but 'as' allows this (in particular, see .desc).
221 //
222 // In the future it might be worth trying to make these operations more well
223 // defined.
Daniel Dunbar3edd9bb2009-08-22 11:41:10 +0000224 switch (Attribute) {
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000225 case MCSA_Invalid:
Chris Lattnered0ab152010-01-25 18:30:45 +0000226 case MCSA_ELF_TypeFunction:
227 case MCSA_ELF_TypeIndFunction:
228 case MCSA_ELF_TypeObject:
229 case MCSA_ELF_TypeTLS:
230 case MCSA_ELF_TypeCommon:
231 case MCSA_ELF_TypeNoType:
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000232 case MCSA_IndirectSymbol:
233 case MCSA_Hidden:
234 case MCSA_Internal:
235 case MCSA_Protected:
236 case MCSA_Weak:
237 case MCSA_Local:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000238 assert(0 && "Invalid symbol attribute for Mach-O!");
239 break;
Daniel Dunbar3edd9bb2009-08-22 11:41:10 +0000240
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000241 case MCSA_Global:
Daniel Dunbar8f4d1462009-08-28 07:08:35 +0000242 SD.setExternal(true);
Daniel Dunbar3edd9bb2009-08-22 11:41:10 +0000243 break;
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000244
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000245 case MCSA_LazyReference:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000246 // FIXME: This requires -dynamic.
247 SD.setFlags(SD.getFlags() | SF_NoDeadStrip);
248 if (Symbol->isUndefined())
249 SD.setFlags(SD.getFlags() | SF_ReferenceTypeUndefinedLazy);
250 break;
251
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000252 // Since .reference sets the no dead strip bit, it is equivalent to
253 // .no_dead_strip in practice.
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000254 case MCSA_Reference:
255 case MCSA_NoDeadStrip:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000256 SD.setFlags(SD.getFlags() | SF_NoDeadStrip);
257 break;
258
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000259 case MCSA_PrivateExtern:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000260 SD.setExternal(true);
261 SD.setPrivateExtern(true);
262 break;
263
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000264 case MCSA_WeakReference:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000265 // FIXME: This requires -dynamic.
266 if (Symbol->isUndefined())
267 SD.setFlags(SD.getFlags() | SF_WeakReference);
268 break;
269
Chris Lattnera5ad93a2010-01-23 06:39:22 +0000270 case MCSA_WeakDefinition:
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000271 // FIXME: 'as' enforces that this is defined and global. The manual claims
272 // it has to be in a coalesced section, but this isn't enforced.
273 SD.setFlags(SD.getFlags() | SF_WeakDefinition);
274 break;
Daniel Dunbar3edd9bb2009-08-22 11:41:10 +0000275 }
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000276}
277
278void MCMachOStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
Daniel Dunbar6aff2fb2009-08-24 08:40:12 +0000279 // Encode the 'desc' value into the lowest implementation defined bits.
280 assert(DescValue == (DescValue & SF_DescFlagsMask) &&
281 "Invalid .desc value!");
282 getSymbolData(*Symbol).setFlags(DescValue & SF_DescFlagsMask);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000283}
284
Chris Lattner9eb158d2010-01-23 07:47:02 +0000285void MCMachOStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000286 unsigned ByteAlignment) {
Daniel Dunbar8f4d1462009-08-28 07:08:35 +0000287 // FIXME: Darwin 'as' does appear to allow redef of a .comm by itself.
288 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
289
290 MCSymbolData &SD = getSymbolData(*Symbol);
291 SD.setExternal(true);
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000292 SD.setCommon(Size, ByteAlignment);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000293}
294
Daniel Dunbar8751b942009-08-28 05:48:22 +0000295void MCMachOStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000296 unsigned Size, unsigned ByteAlignment) {
Daniel Dunbard5a8e982009-08-28 05:49:21 +0000297 MCSectionData &SectData = getSectionData(*Section);
298
299 // The symbol may not be present, which only creates the section.
300 if (!Symbol)
301 return;
302
303 // FIXME: Assert that this section has the zerofill type.
304
305 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
306
307 MCSymbolData &SD = getSymbolData(*Symbol);
308
Daniel Dunbar7092c7e2009-08-30 06:17:16 +0000309 MCFragment *F = new MCZeroFillFragment(Size, ByteAlignment, &SectData);
Daniel Dunbard5a8e982009-08-28 05:49:21 +0000310 SD.setFragment(F);
311
312 Symbol->setSection(*Section);
313
314 // Update the maximum alignment on the zero fill section if necessary.
315 if (ByteAlignment > SectData.getAlignment())
316 SectData.setAlignment(ByteAlignment);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000317}
318
Chris Lattneraaec2052010-01-19 19:46:13 +0000319void MCMachOStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) {
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +0000320 MCDataFragment *DF = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
321 if (!DF)
322 DF = new MCDataFragment(CurSectionData);
Daniel Dunbar0705fbf2009-08-21 18:29:01 +0000323 DF->getContents().append(Data.begin(), Data.end());
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000324}
325
Chris Lattneraaec2052010-01-19 19:46:13 +0000326void MCMachOStreamer::EmitValue(const MCExpr *Value, unsigned Size,
327 unsigned AddrSpace) {
Daniel Dunbar1253a6f2009-10-16 01:58:03 +0000328 new MCFillFragment(*AddValueSymbols(Value), Size, 1, CurSectionData);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000329}
330
331void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
332 int64_t Value, unsigned ValueSize,
333 unsigned MaxBytesToEmit) {
Daniel Dunbard6f761e2009-08-21 23:07:38 +0000334 if (MaxBytesToEmit == 0)
335 MaxBytesToEmit = ByteAlignment;
Daniel Dunbar0705fbf2009-08-21 18:29:01 +0000336 new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit,
337 CurSectionData);
338
Daniel Dunbarf3d2ef02009-08-22 10:13:24 +0000339 // Update the maximum alignment on the current section if necessary.
Daniel Dunbar0705fbf2009-08-21 18:29:01 +0000340 if (ByteAlignment > CurSectionData->getAlignment())
341 CurSectionData->setAlignment(ByteAlignment);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000342}
343
Daniel Dunbar821e3332009-08-31 08:09:28 +0000344void MCMachOStreamer::EmitValueToOffset(const MCExpr *Offset,
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000345 unsigned char Value) {
Daniel Dunbar1253a6f2009-10-16 01:58:03 +0000346 new MCOrgFragment(*Offset, Value, CurSectionData);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000347}
348
349void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
Daniel Dunbar4fac7492009-08-27 08:17:51 +0000350 // Scan for values.
351 for (unsigned i = 0; i != Inst.getNumOperands(); ++i)
Daniel Dunbar8c2eebe2009-08-31 08:08:38 +0000352 if (Inst.getOperand(i).isExpr())
353 AddValueSymbols(Inst.getOperand(i).getExpr());
Daniel Dunbar4fac7492009-08-27 08:17:51 +0000354
355 if (!Emitter)
356 llvm_unreachable("no code emitter available!");
357
Nate Begeman6f24a0a2010-01-17 03:49:01 +0000358 // FIXME: Emitting an instruction should cause S_ATTR_SOME_INSTRUCTIONS to
359 // be set for the current section.
Daniel Dunbar4fac7492009-08-27 08:17:51 +0000360 // FIXME: Relocations!
361 SmallString<256> Code;
362 raw_svector_ostream VecOS(Code);
363 Emitter->EncodeInstruction(Inst, VecOS);
Chris Lattneraaec2052010-01-19 19:46:13 +0000364 EmitBytes(VecOS.str(), 0);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000365}
366
367void MCMachOStreamer::Finish() {
368 Assembler.Finish();
369}
370
Daniel Dunbar4fac7492009-08-27 08:17:51 +0000371MCStreamer *llvm::createMachOStreamer(MCContext &Context, raw_ostream &OS,
372 MCCodeEmitter *CE) {
373 return new MCMachOStreamer(Context, OS, CE);
Daniel Dunbarfb4a6b32009-08-21 09:11:24 +0000374}