Commit Graph

885 Commits

Author SHA1 Message Date
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Rafael Espindola
ec0b428398 Make EmitIntValue non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:22:44 +00:00
Rafael Espindola
f7c3b75bc5 Forgot the MCPureStreamer::EmitValue in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:13:47 +00:00
Rafael Espindola
6f95023a7f Move EmitValue to MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:08:47 +00:00
Rafael Espindola
ea4afa91eb Fixed verson of r120245.
Factor some duplicated code into MCObjectStreamer::EmitLabel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 17:18:55 +00:00
Rafael Espindola
ba210243ef Revert previous patch while I debug the darwin bootstrap failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 16:22:59 +00:00
Rafael Espindola
f90a2de72c Factor some duplicated code into MCObjectStreamer::EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 15:54:36 +00:00
Rafael Espindola
3e03211625 Avoid code duplication in the many unsupported EmitGPRel32Value implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 15:09:24 +00:00
Rafael Espindola
e04ed7e45f Define generic 1, 2 and 4 byte pc relative relocations. They are common
and at least the 4 byte one will be needed to implement the .cfi_* directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 14:17:56 +00:00
Daniel Dunbar
90e3e3a429 macho-dump: Add support for dumping relocation entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 13:39:48 +00:00
Daniel Dunbar
590956f24f Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 07:39:37 +00:00
Daniel Dunbar
7976b88d9f Reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 05:18:48 +00:00
Daniel Dunbar
f52788f4e6 MC/Mach-O: Migrate more constants into MachOFormat.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 04:59:14 +00:00
Daniel Dunbar
821ecd7c90 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 04:19:38 +00:00
Rafael Espindola
fd46797d0d Remove the unused TheTarget member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 04:24:21 +00:00
Michael J. Spencer
326990f1eb Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 04:16:08 +00:00
Rafael Espindola
6b8e4357ec Factor some code to parseSectionFlags and fix the default type of a section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25 15:32:56 +00:00
Rafael Espindola
25958730df 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 21:57:39 +00:00
Rafael Espindola
1683fcc823 Relocate with the symbol if the relocation is of kind NTPOFF.
Patch by David Meyer, I added the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:23:50 +00:00
Rafael Espindola
bf8209daf8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 18:51:21 +00:00
Rafael Espindola
97551276c5 If a symbol is used as tls, mark it as tls even if not declare as so. Probably
fixes PR8659.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 02:19:40 +00:00
Rafael Espindola
a9d4281cc0 Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
While here, remove unused argument and rename UpdateForSlide to Invalidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 08:08:33 +00:00
Rafael Espindola
0e11dfc4a6 Reuse data fragments while lowering. Patch by David Meyer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 05:49:35 +00:00
Jason W Kim
1090742689 Fixed some style issues (no _, no spc after !)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 22:05:16 +00:00
Jason W Kim
28ef0a5719 Make the <ARCH>ELFObjectWriter statics private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 18:57:00 +00:00
Jason W Kim
ccbe000e09 Fix misplaced statics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 18:47:05 +00:00
Jason W Kim
858e7506e1 Kill trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 18:42:07 +00:00
Jason W Kim
4a511f0be2 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()





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 18:41:13 +00:00
Rafael Espindola
cdfecc8759 Add basic CFI methods to the streamer interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 14:27:24 +00:00
Rafael Espindola
ad8aaa069c Remove some #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 11:53:17 +00:00
Wesley Peck
4b04713423 Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 22:06:28 +00:00
Rafael Espindola
12203cc7c3 Handle PCRel relocations with absolute values. Fixes PR8656.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 00:48:25 +00:00
Kevin Enderby
e8e98d7f2e Added support for the Mach-O .symbol_resolver directive. rdar://8673046
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 18:39:33 +00:00
Rafael Espindola
17fd7bda5a Add a MCLineSectionOrder vector so that we produce the line tables in a
deterministic order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 07:41:23 +00:00
Rafael Espindola
b651a96ef2 Add an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 04:55:36 +00:00
Rafael Espindola
a4b23ffced Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when
possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 04:10:13 +00:00
Rafael Espindola
195a0ce484 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 02:26:16 +00:00
Rafael Espindola
5c0556341e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 02:04:25 +00:00
Rafael Espindola
f2dc4aa562 make isVirtualSection a virtual method on MCSection. Chris' suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 20:03:54 +00:00
Jim Grosbach
4d08863108 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:30:11 +00:00
Rafael Espindola
435279b1a6 Add support for .int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:24:40 +00:00
Rafael Espindola
110f22aae8 Add support for .2byte, .4byte and .8byte.
Fixes PR8631.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:15:42 +00:00
Daniel Dunbar
abc756216d MC-JIT: Stub out "pure" streamer.
- No immediate use, but maybe someone feels like hacking on it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:06:47 +00:00
Rafael Espindola
af6b580875 Add .loc methods to the streamer.
Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer
and then switch codegen to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 21:20:32 +00:00
Rafael Espindola
1fdfbc47d8 Parse and ignore some .cfi_* directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 18:34:07 +00:00
Rafael Espindola
2c92085034 A bit more of gnu as compatibility when handling relocations with aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 04:11:46 +00:00
Benjamin Kramer
3285877131 Fix compiler warnigns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 19:20:50 +00:00
Rafael Espindola
94ed5fca3f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 16:33:49 +00:00
Jason W Kim
d3443e99e4 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 16:18:39 +00:00
Rafael Espindola
db9835d089 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 14:40:36 +00:00