Commit Graph

19 Commits

Author SHA1 Message Date
Kevin Enderby 818b6b96cb Fixed MCSectionMachO::ParseSectionSpecifier to allow an attribute of "none" so
that a symbol stub section with no attributes can be parsed as in:
.section __TEXT,__picsymbolstub4,symbol_stubs,none,16

llvm-svn: 83488
2009-10-07 20:57:20 +00:00
Daniel Dunbar 2701eee0ad llvm-mc: Support .comm emission.
llvm-svn: 80351
2009-08-28 07:08:35 +00:00
Daniel Dunbar 42a39d038a llvm-mc: Support .zerofill emission.
- I'm still trying to figure out the cleanest way to implement this and match the assembler, currently there are some substantial differences.

llvm-svn: 80347
2009-08-28 05:49:21 +00:00
Daniel Dunbar a1cb9ba541 For now, only run MC tests if X86 is configured.
llvm-svn: 80213
2009-08-27 06:11:15 +00:00
Daniel Dunbar 4d7b2e3307 llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate text
sections, etc.
 - The quick and dirty way, just clone the TargetLoweringObjectFile
   code. Eventually this should be shared... somehow.

llvm-svn: 80168
2009-08-26 22:49:51 +00:00
Daniel Dunbar e73b267301 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
- I moved section creation back into AsmParser. I think policy decisions like
   this should be pushed higher, not lower, when possible (in addition the
   assembler has flags which change this behavior, for example).

llvm-svn: 80162
2009-08-26 22:13:22 +00:00
Daniel Dunbar e2697738a4 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
llvm-svn: 80144
2009-08-26 21:22:22 +00:00
Daniel Dunbar c4581eaca8 llvm-mc/Mach-O: Add support for relocations.
- I haven't really tried to find the "right" way to store the fixups or apply
   them, yet. This works, but isn't particularly elegant or fast.

 - Still no evaluation support, so we don't actually ever not turn a fixup into
   a relocation entry.

llvm-svn: 80089
2009-08-26 13:58:10 +00:00
Daniel Dunbar bee148a185 llvm-mc: Fix tests for python variations in int printing, sigh.
llvm-svn: 80069
2009-08-26 04:28:45 +00:00
Daniel Dunbar 066d0f93bf llvm-mc/Mach-O: Add section padding where needed (to align the next section).
Also, simplify some of Mach-O writer code which can now use section addresses.

llvm-svn: 80067
2009-08-26 04:13:32 +00:00
Daniel Dunbar aef5317edd llvm-mc/Mach-O: Set addresses for symbols.
llvm-svn: 80065
2009-08-26 02:48:04 +00:00
Daniel Dunbar c2c0bf961f llvm-mc: Improve indirect symbol support (add the indirect index table).
llvm-svn: 80059
2009-08-26 00:18:21 +00:00
Daniel Dunbar 04a1158d13 llvm-mc/Mach-O: Support symbol attributes.
- This is mostly complete, the main thing missing is .indirect_symbol support
   (which would be straight-forward, except that the way it is implemented in
   'as' makes getting an exact .o match interesting).

llvm-svn: 79899
2009-08-24 08:40:12 +00:00
Daniel Dunbar d1859474a7 llvm-mc/Mach-O: Improve symbol table support:
- Honor .globl.

 - Set symbol type and section correctly ('nm' now works), and order symbols
   appropriately.

 - Take care to the string table so that the .o matches 'as' exactly (for ease
   of testing).

llvm-svn: 79740
2009-08-22 11:41:10 +00:00
Daniel Dunbar 87671b7fdc Force triple for these tests.
llvm-svn: 79737
2009-08-22 09:45:43 +00:00
Daniel Dunbar 67dfb1de23 llvm-mc: Improve handling of implicit alignment for magic section directives
(e.g., .objc_message_refs).
 - Just emit a .align when we see the directive; this isn't exactly what 'as'
   does but in practice it should be ok, at least for now. See FIXME.

llvm-svn: 79697
2009-08-21 23:30:15 +00:00
Daniel Dunbar b1068e4fe3 llvm-mc/Mach-O: Support .o emission for .org and .align.
llvm-svn: 79684
2009-08-21 23:07:38 +00:00
Daniel Dunbar 4ef7fb9530 llvm-mc/Mach-O: Support byte and fill value emission.
llvm-svn: 79652
2009-08-21 18:29:01 +00:00
Daniel Dunbar 3016db39dd llvm-mc: Start MCAssembler and MCMachOStreamer.
- Together these form the (Mach-O) back end of the assembler.

 - MCAssembler is the actual assembler backend, which is designed to have a
   reasonable API. This will eventually grow to support multiple object file
   implementations, but for now its Mach-O/i386 only.

 - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API,
   e.g. converting the various directives into fragments, managing state like
   the current section, and so on.

 - llvm-mc will use the new backend via '-filetype=obj', which may eventually
   be, but is not yet, since I hear that people like assemblers which actually
   assemble.

 - The only thing that works at the moment is changing sections. For the time
   being I have a Python Mach-O dumping tool in test/scripts so this stuff can
   be easily tested, eventually I expect to replace this with a real LLVM tool.

 - More doxyments to come.

I assume that since this stuff doesn't touch any of the things which are part of
2.6 that it is ok to put this in not so long before the freeze, but if someone
objects let me know, I can pull it.

llvm-svn: 79612
2009-08-21 09:11:24 +00:00