summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move EmitValue to MCObjectStreamer.Rafael Espindola2010-11-281-21/+0
| | | | llvm-svn: 120269
* Fixed verson of r120245.Rafael Espindola2010-11-281-16/+4
| | | | | | Factor some duplicated code into MCObjectStreamer::EmitLabel. llvm-svn: 120248
* Revert previous patch while I debug the darwin bootstrap failure.Rafael Espindola2010-11-281-1/+16
| | | | llvm-svn: 120246
* Factor some duplicated code into MCObjectStreamer::EmitLabel.Rafael Espindola2010-11-281-16/+1
| | | | llvm-svn: 120245
* Avoid code duplication in the many unsupported EmitGPRel32Value implementations.Rafael Espindola2010-11-281-3/+0
| | | | llvm-svn: 120243
* Define generic 1, 2 and 4 byte pc relative relocations. They are commonRafael Espindola2010-11-281-1/+1
| | | | | | and at least the 4 byte one will be needed to implement the .cfi_* directives. llvm-svn: 120240
* Added support for the Mach-O .symbol_resolver directive. rdar://8673046Kevin Enderby2010-11-191-0/+4
| | | | llvm-svn: 119816
* Change some methods in MCDwarf.cpp to be able to handle an arbitraryRafael Espindola2010-11-191-1/+4
| | | | | | | | | | | | MCStreamer instead of just MCObjectStreamer. Address changes cannot be as efficient as we have to use DW_LNE_set_addres, but at least most of the logic is shared. This will be used so that, with CodeGen still using EmitDwarfLocDirective, llvm-gcc is able to produce debug_line sections without needing an assembler that supports .loc. llvm-svn: 119777
* Add .loc methods to the streamer.Rafael Espindola2010-11-161-6/+0
| | | | | | | Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer and then switch codegen to use it. llvm-svn: 119384
* Parse and record the gnu_unique_object type.Rafael Espindola2010-11-131-0/+1
| | | | llvm-svn: 118980
* Add '.code 32' assembler directive to MC streamers.Jim Grosbach2010-11-051-0/+1
| | | | llvm-svn: 118309
* MC'ize the '.code 16' and '.thumb_func' ARM directives.Jim Grosbach2010-11-051-1/+7
| | | | llvm-svn: 118301
* syntaxunified directive is a no-op for MachO writing.Jim Grosbach2010-11-051-0/+1
| | | | llvm-svn: 118287
* Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.Rafael Espindola2010-11-011-37/+2
| | | | llvm-svn: 117925
* This adds a Darwin x86_64 relocation encoding for a subtraction expressionKevin Enderby2010-10-021-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | where both symbols are "local", that is non-external symbols, and there is no "base" for the symbols used in the expression, that is the section has no non-temporary symbols. This case looks like this: % cat local_reloc_A-B.s .long 0 LB: .long 1 .long LA - LB - 4 .long 2 LA: .long 3 which llvm-mc will not encode without this patch, generates a "unsupported local relocations in difference" error, but the Darwin assembler will encode with relocation entries like this: % otool -rv a.out l.out a.out: Relocation information (__TEXT,__text) 2 entries address pcrel length extern type scattered symbolnum/value 00000008 False long False SUB False 1 (__TEXT,__text) 00000008 False long False UNSIGND False 1 (__TEXT,__text) which is very similar to what is encoded when the symbols don't have the leading 'L' and they are not temporary symbols. Which llvm-mc and the Darwin assembler will encoded like this: Relocation information (__TEXT,__text) 2 entries address pcrel length extern type scattered symbolnum/value 00000008 False long True SUB False B 00000008 False long True UNSIGND False A This is the missing relocation encoding needed to allow the Mach-O x86 Dwarf file and line table to be emitted. So this patch also removes the TODO from the if() statement in MCMachOStreamer::Finish() that didn't call MCDwarfFileTable::Emit() for 64-bit targets. llvm-svn: 115389
* This is the last major patch to implement support for the .loc directiveKevin Enderby2010-09-301-204/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and output the dwarf line number tables. This contains the code to emit and encode the dwarf line tables from the previously gathered information in the MCLineSection objects. This contains all the details to encode the line and address deltas into the dwarf line table. To do this an MCDwarfLineAddrFragment has been added. Also this moves the interface code out of Mach-O streamer into MCDwarf so it should be useable by other object file formats. There is now one call to be made from an MCObjectStreamer EmitInstruction() method: MCLineEntry::Make(this, getCurrentSection()); to create a line entry after each instruction is assembled. And one call call to be made from an MCObjectStreamer Finish() method: MCDwarfFileTable::Emit(this, DwarfLineSection); when getContext().hasDwarfFiles() is true and is passed a object file specific MCSection where to emit the dwarf file and the line tables. This appears to now be correct for 32-bit targets, at least x86. But the relocation entries for 64-bit Darwin needs some further work which is next up to work on. So for now the 64-bit Mach-O target does not output the dwarf file and line tables. llvm-svn: 115157
* Silence a GCC warning about not handling all flags in this switch, weChandler Carruth2010-09-301-2/+2
| | | | | | specifically assert on unexpected flags. llvm-svn: 115143
* Avoid some Mach-O specific alignment being done on ELF.Rafael Espindola2010-09-221-1/+1
| | | | llvm-svn: 114594
* Add a InitSections method to the streamer interface.Rafael Espindola2010-09-151-0/+8
| | | | | | | | | | | | | | The ELF implementation now creates text, data and bss to match the gnu as behavior. The text streamer still has the old MachO specific behavior since the testsuite checks that it will error when a directive is given before a setting the current section for example. A nice benefit is that -n is not required anymore when producing ELF files. llvm-svn: 114027
* Get rid of "passing signed into unsigned parameter" warning on PPC.Bill Wendling2010-09-031-1/+1
| | | | llvm-svn: 112995
* This is the second of three patches to implement support for the .loc directiveKevin Enderby2010-08-311-0/+56
| | | | | | | | | | and output the dwarf line number tables. This takes the current loc info after an instruction is assembled and saves the needed info into an object that has vector and for each section. These objects will be used for the final patch to build and emit the encoded dwarf line number tables. Again for now this is only in the Mach-O streamer but at some point will move to a more generic place. llvm-svn: 112668
* Next bit of support for the dwarf .file directive. This patch takes theKevin Enderby2010-08-091-0/+155
| | | | | | | | previously collected info from the .file directives and outputs the encoded bytes for it. For now this is only in the Mach-O streamer but at some point will move to a more generic place. llvm-svn: 110617
* MC/Mach-O: Silently ignore .file directives instead of error'ing out onDaniel Dunbar2010-07-191-2/+8
| | | | | | | them. They aren't important enough to abort the entire assembly, and failing early makes testing more annoying. llvm-svn: 108747
* MC: Add WinCOFFStreamer implementation and merge common code from MachOMichael J. Spencer2010-07-191-44/+12
| | | | | | | | into MCObjectStreamer. Origonal Windows COFF implementation by Nathan Jedffords. llvm-svn: 108678
* Added the darwin .weak_def_can_be_hidden directive.Kevin Enderby2010-07-081-0/+4
| | | | llvm-svn: 107886
* MC/Mach-O: Rewrite atom association to be a final pass we do in Finish(), ↵Daniel Dunbar2010-06-161-33/+46
| | | | | | | | instead of tracking as part of emission. - This allows sharing more code with the MCObjectStreamer. llvm-svn: 106143
* MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.Daniel Dunbar2010-06-161-2/+2
| | | | llvm-svn: 106142
* MC: Lift SwitchSection() and Finish() into MCObjectStreamer.Daniel Dunbar2010-06-161-40/+21
| | | | llvm-svn: 106141
* MC: Factor out an MCObjectStreamer class, which will be shared by the concreteDaniel Dunbar2010-06-161-29/+26
| | | | | | object file format writers. llvm-svn: 106140
* MC: When running with -mc-relax-all, we can eagerly relax instructions and ↵Daniel Dunbar2010-05-261-16/+18
| | | | | | avoid creating unnecessary MCInstFragments. llvm-svn: 104736
* MC/Mach-O: Factor out EmitInstTo{Fragment,Data} for emitting MCInst's as ↵Daniel Dunbar2010-05-261-34/+46
| | | | | | MCInstFragments or appending onto an MCDataFragment. llvm-svn: 104735
* MC: Eliminate an unnecessary copy.Daniel Dunbar2010-05-261-9/+4
| | | | llvm-svn: 104709
* MC: Simplify MayNeedRelaxation to not provide the fixups, so we can query itDaniel Dunbar2010-05-261-1/+1
| | | | | | before encoding. llvm-svn: 104707
* MC: Eliminate MCAsmFixup, replace with MCFixup.Daniel Dunbar2010-05-261-8/+6
| | | | llvm-svn: 104699
* MC: Use accessors for access to MCAsmFixup.Daniel Dunbar2010-05-261-1/+1
| | | | llvm-svn: 104697
* Expand on comment.Eric Christopher2010-05-211-1/+2
| | | | llvm-svn: 104396
* Implement EmitTBSSSymbol for MachOStreamer.Eric Christopher2010-05-181-5/+7
| | | | | | Fixes build failure as well. llvm-svn: 104059
* MC/Mach-O: Implement support for setting indirect symbol table offset in ↵Daniel Dunbar2010-05-181-0/+1
| | | | | | | | section header. Also, create symbol data for LHS of assignment, to match 'as' symbol ordering better. llvm-svn: 104033
* MC/Mach-O: Fail faster/harder when we see .file, which isn't yet supported.Daniel Dunbar2010-05-181-2/+2
| | | | llvm-svn: 104031
* MC/Mach-O: Reverse order of SymbolData scanning when emitting instructions.Daniel Dunbar2010-05-171-1/+1
| | | | | | | - This fixes a string table mismatch with 'as' when two new symbols are defined in a single instruction. llvm-svn: 103979
* MC/Mach-O: Fix some differences in symbol flag handling.Daniel Dunbar2010-05-171-2/+15
| | | | | | | | | | | | | - Don't clear weak reference flag, 'as' was only "trying" to do this, it wasn't actually succeeding. - Clear the "lazy bound" bit when we mark something external. This corresponds roughly to the lazy clearing of the bit that 'as' implements in symbol_table_lookup. - The exact meaning of these flags appears pretty loose, since 'as' isn't very consistent. For now we just try to match 'as', we will clean this up one day hopefully. llvm-svn: 103964
* Add AsmParser support for darwin tbss directive.Eric Christopher2010-05-141-0/+7
| | | | | | Nothing uses this yet. llvm-svn: 103757
* MC: Move MCAlignFragment::EmitNops value out of the constructor.Daniel Dunbar2010-05-121-6/+5
| | | | llvm-svn: 103665
* MC: Eliminate MCZeroFillFragment, it is no longer needed.Daniel Dunbar2010-05-121-1/+1
| | | | llvm-svn: 103664
* MC: Drop support for alignment in ZeroFill fragment, we can just useDaniel Dunbar2010-05-121-1/+6
| | | | | | MCAlignFragments for this. llvm-svn: 103661
* MC/Mach-O: Explicitly track atoms, as represented by their defining symbol, ↵Daniel Dunbar2010-05-101-8/+36
| | | | | | for each fragment (not yet used). llvm-svn: 103438
* break coff symbol definition stuff out into proper MCStreamer callbacks,Chris Lattner2010-05-081-0/+12
| | | | | | patch by Nathan Jeffords! llvm-svn: 103346
* Fix i386 relocations to Weak Definitions. The relocation entries should beKevin Enderby2010-05-071-19/+1
| | | | | | | external and the item to be relocated should not have the address of the symbol added in. llvm-svn: 103302
* MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support forDaniel Dunbar2010-05-051-1/+0
| | | | | | | writing them. - <rdar://problem/7885351> integrated assembler broken for i386 objc code llvm-svn: 103112
* MC: Reject attempts to define a variable symbol.Daniel Dunbar2010-05-051-4/+2
| | | | llvm-svn: 103111
OpenPOWER on IntegriCloud