Commit Graph

947 Commits

Author SHA1 Message Date
Devang Patel
ee4854faf3 Use set directive for StartMinusEndExpr.
This is a fix for llvm-gcc-i386-darwin9 buildbot failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 21:32:30 +00:00
Rafael Espindola
76507f14ed Add a fast path to EvaluateSymbolicAdd. This avoids computing symbol addresses
which then avoids running EnsureValid.
This cuts the assembly time of the testcase in PR8711 from 2:50 minutes to 1
minute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 07:53:12 +00:00
Rafael Espindola
e23930543c Move EmitValueToOffset to the ObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 05:59:38 +00:00
Rafael Espindola
dedb045c32 Add EmitInstToFragment to the generic object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 05:44:06 +00:00
Rafael Espindola
6db8a9f3fa The sections that the ELF object writer has to create are very simple and
contain only data. Handle them specially instead of using AddSectionToTheEnd.
This moves a hack from the generic assembler to the elf writer. It is also
a bit faster and should make other improvements easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 03:09:06 +00:00
Devang Patel
6a13ddbd9b If tehre are not any line entry then do not try to emit .debug_line section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:17:51 +00:00
Jim Grosbach
dff84b0325 Add support for binary encoding of ARM 'adr' instructions referencing constant
pool entries (LEApcrel pseudo). Ongoing saga of rdar://8542291.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:28:45 +00:00
Rafael Espindola
6566e0a55e Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:48:11 +00:00
Rafael Espindola
9f44724be0 Rename temporary symbols if they conflict with artificial symbols created
by the assembler. This was blocking parsing any large .s produced by clang for
example.

Fixes PR8596.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:46:11 +00:00
Owen Anderson
9d63d90de5 Add correct encodings for STRD and LDRD, including fixup support. Additionally, update these to unified syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:18:46 +00:00
Jim Grosbach
fdbdaaca2c Fix a mised reloc rename spot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:02:26 +00:00
Jason W Kim
85fed5e0c5 ARM/MC/ELF relocation "hello world" for movw/movt.
Lifted adjustFixupValue() from Darwin for sharing w ELF.
Test added
TODO:
  refactor ELFObjectWriter::RecordRelocation more.
  Possibly share more code with Darwin?
  Lots more relocations...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 02:40:06 +00:00
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
Chris Lattner
3170a3bc04 correct the fixup comment printer to work on big endian platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 05:56:19 +00:00
Chris Lattner
1e61e69d40 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 02:46:57 +00:00
Rafael Espindola
1f52dfe69e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 23:53:26 +00:00
Chris Lattner
6135a96792 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 22:22:59 +00:00
Rafael Espindola
55d02f3a13 Fix another case of a .comm directive without a corresponding .type
directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 21:11:16 +00:00
Rafael Espindola
765fb1a446 Fix the type of a symbol created with .comm and no corresponding .type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 19:40:55 +00:00
Rafael Espindola
1f4f9e3d35 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 04:17:37 +00:00
Rafael Espindola
ab4a7afe98 Simplify getSymbolIndexInSymbolTable by setting the actual index of
the symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 03:12:24 +00:00
Rafael Espindola
7e528a1724 Fix warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 01:34:31 +00:00
Daniel Dunbar
115a3dd066 MC: Simplify Mach-O and ELF object writer implementations.
- What was I thinking?????

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 07:33:40 +00:00
Rafael Espindola
e9c0ff2a76 Fix warning and add support for printing gnu_unique_object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 04:55:06 +00:00
Rafael Espindola
e13a0ff8ac Parse and record the gnu_unique_object type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 04:51:02 +00:00
Rafael Espindola
c50a0fd7cb 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 03:18:27 +00:00
Rafael Espindola
64185cc609 Fix the encoding of negative line deltas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 01:06:27 +00:00
Benjamin Kramer
1261a2ff99 MCELF: Copy the symbol name only if we're going to modify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12 19:26:04 +00:00
Rafael Espindola
bac0ad9eda Remove what looks like dead code in the production of debug lines.
We only produce debug line information if we have seen a line directive, so
this code is dead. Also, if we want to be bug by bug compatible with
gas and sometimes produce "empty" .debug_line sections, this will
match the content produced by gas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12 18:41:26 +00:00
Rafael Espindola
d4a352609f gnu as support both % and @ before types, do the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12 15:47:08 +00:00
Jim Grosbach
3c3849297b Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 20:16:23 +00:00
Rafael Espindola
e1a2587ee2 Mark labels declared in tls sections as STT_TLS. This matches the behavior of
gas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 19:04:55 +00:00
Rafael Espindola
2ff9e83a82 Initial comdat implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 18:13:52 +00:00
Rafael Espindola
9302bd664d Make AliasedSymbol able to handle MCTargetExpr. They can get here if
a weakref is used with a VariantKind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 17:24:43 +00:00
Rafael Espindola
03f1b74aed Fix the symbol index of weak references. Also make RecordRelocation a bit
easier to read by having const references to the symbol, aliased symbol and
renamed symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 16:48:11 +00:00
Rafael Espindola
3f2d13c98e Remove some explicit arguments to getELFSection. This is
a leftover from the removal of isExplicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 03:40:25 +00:00
Rafael Espindola
c87a94a942 Factor some code into WriteSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 23:36:59 +00:00
Rafael Espindola
1d739a010d Update the section index map after we add the medatada sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 22:34:07 +00:00
Rafael Espindola
4beee3d06b Use SectionIndexMap in WriteSymbolTable to make it a little less brittle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 22:16:43 +00:00
Rafael Espindola
bab2a80525 Factor some code into ComputeIndexMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 21:51:05 +00:00
Rafael Espindola
af3d38f70e Change the String<size> methods to take a fragment instead of a buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 20:02:59 +00:00
Rafael Espindola
4283f4b81e Use MCSectionELF in places we know we have an ELF section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 19:05:07 +00:00
Jim Grosbach
2c4d5125c7 Update ARMConstantPoolValue to not use a modifier string. Use an explicit
VariantKind marker to indicate the additional information necessary. Update
MC to handle the new Kinds. rdar://8647623



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 03:26:07 +00:00
Rafael Espindola
34be396a12 Fixed version of 118639 with an extra assert to catch similar problems
earlier. Implicit bool -> int conversions are evil!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 23:42:07 +00:00
Rafael Espindola
037b5be15a Revert previous patch. Missed a case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:54:38 +00:00
Rafael Espindola
e61a1ac595 Remove IsExplicit. It was always false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:37:44 +00:00
Daniel Dunbar
603abd5619 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 17:53:02 +00:00
Rafael Espindola
4faf7c78fe Set default flags for .rodata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 02:47:59 +00:00
Rafael Espindola
e25e1ef48b Speed up AddSectionToTheEnd. It was walking all fragments in all sections.
This is really slow with we have 1000s of sections each with a corresponding
relocation section. Also, it is only used by the ELF writer to add
basic data, so there is no need to force a new layout pass.

Should fix PR8563.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 15:03:27 +00:00
Rafael Espindola
187d8339db Relax dwarf line fragments. This fixes a crash in the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 02:07:12 +00:00
Jim Grosbach
ba21957cbd Add '.code 32' assembler directive to MC streamers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 22:40:09 +00:00