Daniel Dunbar
f050a00c17
MC/Mach-O: Introduce Object/MachOFormat for describing purely platform / machine
...
independent information on the Mach object format, and move some stuff from
MachObjectWriter.cpp there.
llvm-svn: 120186
2010-11-27 04:19:38 +00:00
Rafael Espindola
0641196380
Remove the unused TheTarget member.
...
llvm-svn: 120168
2010-11-26 04:24:21 +00:00
Michael J. Spencer
b2cfb3b443
Fix Whitespace.
...
llvm-svn: 120166
2010-11-26 04:16:08 +00:00
Rafael Espindola
a8488b04e1
Factor some code to parseSectionFlags and fix the default type of a section.
...
llvm-svn: 120145
2010-11-25 15:32:56 +00:00
Rafael Espindola
1a81f03f87
Behave a bit more like gnu as and use the symbol (instead of the section)
...
for any relocation to a symbol defined in a tls section.
llvm-svn: 120121
2010-11-24 21:57:39 +00:00
Rafael Espindola
97690e2d7d
Relocate with the symbol if the relocation is of kind NTPOFF.
...
Patch by David Meyer, I added the test.
llvm-svn: 120104
2010-11-24 19:23:50 +00:00
Rafael Espindola
81ecba9559
Fix and add tests for all cases in x86 and x86_64 where gnu as implicitly
...
sets the type of a symbol to STT_TLS.
llvm-svn: 120100
2010-11-24 18:51:21 +00:00
Rafael Espindola
dc299d2615
If a symbol is used as tls, mark it as tls even if not declare as so. Probably
...
fixes PR8659.
llvm-svn: 120076
2010-11-24 02:19:40 +00:00
Rafael Espindola
af4cd15f2a
Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
...
While here, remove unused argument and rename UpdateForSlide to Invalidate.
llvm-svn: 120009
2010-11-23 08:08:33 +00:00
Rafael Espindola
a660c25883
Reuse data fragments while lowering. Patch by David Meyer.
...
llvm-svn: 119999
2010-11-23 05:49:35 +00:00
Jason W Kim
287d5fb10b
Fixed some style issues (no _, no spc after !)
...
llvm-svn: 119986
2010-11-22 22:05:16 +00:00
Jason W Kim
0941164ddb
Make the <ARCH>ELFObjectWriter statics private
...
llvm-svn: 119982
2010-11-22 18:57:00 +00:00
Jason W Kim
243d3f5d8c
Fix misplaced statics.
...
llvm-svn: 119981
2010-11-22 18:47:05 +00:00
Jason W Kim
dea9f17ab2
Kill trailing whitespace
...
llvm-svn: 119979
2010-11-22 18:42:07 +00:00
Jason W Kim
e2fece2f4c
Refactor the ELFRelocationEntry (pull up) and move the arch-specific statics to inside the class where it belongs.
...
Next step is to rationally break apart the RecordRelocation()
Probably the step will be to have 1 member function for ech slot of the ELFRelocationEntry()
llvm-svn: 119978
2010-11-22 18:41:13 +00:00
Rafael Espindola
e20c3d7c26
Add basic CFI methods to the streamer interface.
...
llvm-svn: 119972
2010-11-22 14:27:24 +00:00
Rafael Espindola
5f582e980e
Remove some #includes.
...
llvm-svn: 119967
2010-11-22 11:53:17 +00:00
Wesley Peck
e25f241e37
Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
...
llvm-svn: 119952
2010-11-21 22:06:28 +00:00
Rafael Espindola
ee6aea622f
Handle PCRel relocations with absolute values. Fixes PR8656.
...
llvm-svn: 119917
2010-11-21 00:48:25 +00:00
Kevin Enderby
214e641d8d
Added support for the Mach-O .symbol_resolver directive. rdar://8673046
...
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Rafael Espindola
7c6bd9e0f9
Add a MCLineSectionOrder vector so that we produce the line tables in a
...
deterministic order.
llvm-svn: 119795
2010-11-19 07:41:23 +00:00
Rafael Espindola
a06725942f
Add an assert.
...
llvm-svn: 119788
2010-11-19 04:55:36 +00:00
Rafael Espindola
921ef0c471
Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when
...
possible.
llvm-svn: 119785
2010-11-19 04:10:13 +00:00
Rafael Espindola
b33e5e07e1
Change some methods in MCDwarf.cpp to be able to handle an arbitrary
...
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
2010-11-19 02:26:16 +00:00
Rafael Espindola
93a07b464e
Change CodeGen to use .loc directives. This produces a lot more readable output
...
and testing is easier. A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0". We also don't use a DW_LNE_set_address for
every address change anymore.
llvm-svn: 119613
2010-11-18 02:04:25 +00:00
Rafael Espindola
7fc5cd0a58
make isVirtualSection a virtual method on MCSection. Chris' suggestion.
...
llvm-svn: 119547
2010-11-17 20:03:54 +00:00
Jim Grosbach
122ce7f051
Fix typo.
...
llvm-svn: 119542
2010-11-17 19:30:11 +00:00
Rafael Espindola
b6fcca35a2
Add support for .int.
...
llvm-svn: 119512
2010-11-17 16:24:40 +00:00
Rafael Espindola
9186952072
Add support for .2byte, .4byte and .8byte.
...
Fixes PR8631.
llvm-svn: 119511
2010-11-17 16:15:42 +00:00
Daniel Dunbar
1890e9a6b7
MC-JIT: Stub out "pure" streamer.
...
- No immediate use, but maybe someone feels like hacking on it.
llvm-svn: 119510
2010-11-17 16:06:47 +00:00
Rafael Espindola
283e6bd938
Add .loc methods to the streamer.
...
Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer
and then switch codegen to use it.
llvm-svn: 119384
2010-11-16 21:20:32 +00:00
Rafael Espindola
dc0be5a0cc
Parse and ignore some .cfi_* directives.
...
llvm-svn: 119362
2010-11-16 18:34:07 +00:00
Rafael Espindola
47e7ef8c8f
A bit more of gnu as compatibility when handling relocations with aliases.
...
llvm-svn: 119328
2010-11-16 04:11:46 +00:00
Benjamin Kramer
8ee77c5320
Fix compiler warnigns.
...
llvm-svn: 119175
2010-11-15 19:20:50 +00:00
Rafael Espindola
1f6440b1e2
Change MCExpr::EvaluateAsRelocatableImpl of variables to return the original
...
variable if recursing fails to simplify it.
Factor AliasedSymbol to be a method of MCSymbol.
Update MCAssembler::EvaluateFixup to match the change in
EvaluateAsRelocatableImpl.
Remove the WeakRefExpr hack, as the object writer now sees the weakref with
no extra effort needed.
Nothing else is using MCTargetExpr, but keep it for now.
Now that the ELF writer sees relocations with aliases, handle
.weak foo2
foo2:
.weak bar2
.set bar2,foo2
.quad bar2
the same way gas does and produce a relocation with bar2.
llvm-svn: 119152
2010-11-15 16:33:49 +00:00
Jason W Kim
8dc24d5066
Dovetail with Dan Dunbar's rework of ELFObjectWriter.
...
Added 2 new subclasses - X86ELFObjectWriter and ARMELFObectWriter.
ARM and X86 require different code for RecordRelocation(), possibly others.
llvm-svn: 119149
2010-11-15 16:18:39 +00:00
Rafael Espindola
f6c0121c93
Fix PR8565.
...
This moves most of the isUsed logic to the MCSymbol itself. With this we
get a bit more relaxed about allowing definitions after uses: uses that
don't evaluate their argument immediately (jmp foo) are accepted.
ddunbar, this was the smallest compromise I could think of that lets us
accept gcc (and clang!) assembly.
llvm-svn: 119144
2010-11-15 14:40:36 +00:00
Chris Lattner
3b5f2a871a
correct the fixup comment printer to work on big endian platforms.
...
llvm-svn: 119122
2010-11-15 05:56:19 +00:00
Chris Lattner
9a0a840839
add targetoperand flags for jump tables, constant pool and block address
...
nodes to indicate when ha16/lo16 modifiers should be used. This lets
us pass PowerPC/indirectbr.ll.
The one annoying thing about this patch is that the MCSymbolExpr isn't
expressive enough to represent ha16(label1-label2) which we need on
PowerPC. I have a terrible hack in the meantime, but this will have
to be revisited at some point.
Last major conversion item left is global variable references.
llvm-svn: 119105
2010-11-15 02:46:57 +00:00
Rafael Espindola
5572cb1aed
Move the logic to decide with which symbol we produce a relocation (if any) to
...
a central location. This also makes us a bit more compatible with gas.
llvm-svn: 119094
2010-11-14 23:53:26 +00:00
Chris Lattner
fc626aa37d
reimplement ppc asmprinter "toc" handling to use a VariantKind
...
on the operand, required for .o file writing and fixing
the PowerPC/mult-alt-generic-powerpc64.ll failure with the new
instprinter.
llvm-svn: 119087
2010-11-14 22:22:59 +00:00
Rafael Espindola
59a93284d7
Fix another case of a .comm directive without a corresponding .type
...
directive.
llvm-svn: 119073
2010-11-14 21:11:16 +00:00
Rafael Espindola
1884e6d475
Fix the type of a symbol created with .comm and no corresponding .type.
...
llvm-svn: 119060
2010-11-14 19:40:55 +00:00
Rafael Espindola
444d9c0b02
Handle a peculiar comdat case: Creating a section with an undefined
...
signature symbol causes a local symbol to be created unless there is
some other use of the symbol.
llvm-svn: 119026
2010-11-14 04:17:37 +00:00
Rafael Espindola
55e673b1c2
Simplify getSymbolIndexInSymbolTable by setting the actual index of
...
the symbols.
llvm-svn: 119022
2010-11-14 03:12:24 +00:00
Rafael Espindola
1b4c835948
Fix warning.
...
llvm-svn: 119021
2010-11-14 01:34:31 +00:00
Daniel Dunbar
2ba9f79194
MC: Simplify Mach-O and ELF object writer implementations.
...
- What was I thinking?????
llvm-svn: 118992
2010-11-13 07:33:40 +00:00
Rafael Espindola
d2ff64abae
Fix warning and add support for printing gnu_unique_object.
...
llvm-svn: 118981
2010-11-13 04:55:06 +00:00
Rafael Espindola
9cd0fd30e0
Parse and record the gnu_unique_object type.
...
llvm-svn: 118980
2010-11-13 04:51:02 +00:00
Rafael Espindola
00c5605efc
Parse and remember discriminators in .loc line. I try to output them with
...
another patch.
This lets us parse a bit more of the gcc 4.5 output.
llvm-svn: 118975
2010-11-13 03:18:27 +00:00