Commit Graph

1001 Commits

Author SHA1 Message Date
Daniel Dunbar
25bcc9cdc8 MC/Mach-O/ARM: Clone off an ARM version of RecordScatteredRelocation until I figure out how it is supposed to work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:45:29 +00:00
Daniel Dunbar
5cc6390495 MC/Mach-O: Return to reporting errors if we see unexpected fixup kinds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:32:41 +00:00
Daniel Dunbar
3664564395 MC/Mach-O/ARM: Recognize generic _Data_N fixup kinds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:32:37 +00:00
Daniel Dunbar
294e67861c MC/Mach-O/ARM: Add enough relocation logic to get BR24 relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122407 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:19:24 +00:00
Daniel Dunbar
fdfbc6a652 MC/Mach-O/ARM: Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:19:20 +00:00
Rafael Espindola
33a38a1b5a Use references and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:11:57 +00:00
Rafael Espindola
f01212489b Simplify the handling of .size expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 16:03:00 +00:00
Daniel Dunbar
4d74305a1f MC/Mach-O/ARM: Stub out RecordARMRelocation, which is mostly a copy of
RecordRelocation with lots of FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 13:50:05 +00:00
Daniel Dunbar
42b5286627 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 13:49:56 +00:00
Daniel Dunbar
532c456d48 MC/Mach-O: Split out RecordARMRelocation for now, it is weird enough it isn't
clear how to keep in the generic path (yet).
 - Will revisit when it actually works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 13:49:43 +00:00
Matt Beaumont-Gay
e733cf8c27 GCC objects to the two sides of a conditional expression having different enum
types, but they're just getting converted to unsigned anyway, so cast first
(and ask questions later).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 23:43:23 +00:00
Rafael Espindola
64b4412196 Simplify EvaluateAsAbsolute now that EvaluateAsRelocatableImpl does all
the folding it can.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 20:51:42 +00:00
Rafael Espindola
7a45903bf4 Don't relax org or align. They change size as the relaxation happens, but they
are not actually relaxed. For example, a section with only alignments will never
needs relaxation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 20:35:18 +00:00
Daniel Dunbar
e1feeb9da4 MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 15:26:45 +00:00
Rafael Espindola
62b83b62f3 Layout one section until no relaxations are done and then move to the next
section.

This helps because in practice sections form a dag with debug sections pointing
to text sections. Finishing up the text sections first makes the debug section
relaxation trivial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 04:22:09 +00:00
Roman Divacky
d149186e15 Set the value of absolute symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 21:14:39 +00:00
Nick Lewycky
476b242fe7 Add missing standard headers. Patch by Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:43:38 +00:00
Rafael Espindola
c5b0e44aca Fixed version of 122160 (the previous one would fold undefined symbols).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 04:18:56 +00:00
Rafael Espindola
af0e6ce80f Revert 122160 while I debug it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 03:22:05 +00:00
Rafael Espindola
f399d9d37b Move all folding to AttemptToFoldSymbolOffsetDifference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 02:15:04 +00:00
Roman Divacky
7529b16410 Add support for lexing single quotes like 'c'.
This fixed 8615.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 08:56:37 +00:00
Rafael Espindola
3132780a2e Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 06:27:54 +00:00
Rafael Espindola
1ec5bd31fe Remove the MCObjectFormat class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 05:37:28 +00:00
Rafael Espindola
3f037ef2f5 Add a FIXME and explain a hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 04:19:20 +00:00
Rafael Espindola
f705a7ed27 Fix the note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 04:01:45 +00:00
Rafael Espindola
d076482ab7 Revert 122011, 122012, 122013, 122023 adding back an important optimization.
I added a note, but suggestions on how to add a test are really welcome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 03:57:21 +00:00
Rafael Espindola
bff66a86e6 Move some data to the TargetWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 03:27:34 +00:00
Owen Anderson
175fb36f10 Thumb's forced-PC-alignment requirement applies to the _total_ displacement, not just to the fragment relative
portion.  While the fragment boundary is usually already aligned, it is possible for it not to be, which 
would lead to a non-aligned final displacement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 21:49:48 +00:00
Rafael Espindola
31f3578b00 Store and free the TargetObjectWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 18:01:31 +00:00
Rafael Espindola
6024c97ffa Stub out explicit MCELFObjectTargetWriter interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 17:45:22 +00:00
Rafael Espindola
285b3e5b61 Move createELFObjectWriter to its own header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 16:59:53 +00:00
Rafael Espindola
127a6a47bd Use getFixupKindInfo to implement isFixupKindPCRel, ELF version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 07:28:17 +00:00
Daniel Dunbar
17304b3489 MC/Expr: Implemnt more aggressive folding during symbol evaluation using
IsSymbolRefDifferenceFullyResolved(). For example, we will now fold away
something like:
--
_a:
...
L0:
...
L1:
...
.long (L1 - L0) / 2
--

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 05:50:33 +00:00
Daniel Dunbar
b87422778c MC/Mach-O: On second thought, use a custom hook for enabling aggressive
IsSymbolRefDifferenceFullyResolved, it turns out this does change behavior on
enough cases for x86-32 that I would rather wait a bit on it.
 - In practice, we will want to change this eventually because it only means we
   generate less relocations (it also eliminates the need for the horrible
   '.set' hack that Darwin requires in some places).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 05:50:29 +00:00
Daniel Dunbar
32c1c5ae5f MC/Mach-O: Implement IsSymbolRefDifferenceFullyResolved.
- Unlike for fixups, we always do the "reliable" thing (not just for x86_64).
 - Since Darwin 'as' would typically reject things that using this will allow,
   we don't need to worry about compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 04:54:58 +00:00
Daniel Dunbar
1f3662abba MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format specific hook.
- Currently just has stub implementations for Mach-O, ELF, and COFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 04:54:54 +00:00
Daniel Dunbar
5d2477cecf MC/Assembler: Strip out object writer arguments, now that it is always available
-- and remove FIXME asking for the same!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 02:45:59 +00:00
Daniel Dunbar
feb7ba3d9a MC/Assembler: Make the MCObjectWriter available through the lifetime of the
assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 02:45:41 +00:00
Daniel Dunbar
7b62afac0a MC/Target: Remove HasScatteredSymbols target hook variable, which has been
superceded and was effectively dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 02:06:08 +00:00
Daniel Dunbar
8f714fedba MC/Expr: Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 02:05:45 +00:00
Daniel Dunbar
2d8e3e741f MC: Remove another dead MCAssembler argument, and update clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:07:35 +00:00
Daniel Dunbar
92c66c7bf9 MC: Remove dead MCAssembler argument -- Rafael, can you check the FIXME I added
here?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:07:31 +00:00
Daniel Dunbar
204e3b65eb MC: Simplify (remove unnecessary MCAssembler argument, obsoleted by containment
in MCAsmLayout).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:07:28 +00:00
Daniel Dunbar
cdf94e8592 Write => in a more normal form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:07:22 +00:00
Daniel Dunbar
f2ed62d6bf MC/Expr: Simplify (and add a FIXME).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:07:20 +00:00
Rafael Espindola
dfe125cc9c "Fix" FDE alignment to match what gas does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 00:28:02 +00:00
Daniel Dunbar
dd18e28c62 MC/Expr: Add a doxyment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 18:36:25 +00:00
Daniel Dunbar
5d05d9769e MC/Mach-O: Lift some MachObjectWriter arguments into the target specific
interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 17:21:02 +00:00
Daniel Dunbar
ae5abd595f MC/Mach-O: Stub out explicit MCMachObjectTargetWriter interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 16:09:19 +00:00
Daniel Dunbar
aa4b7dd13b MC/Mach-O: Move createMachObjectWriter into MCMachObjectWriter.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 16:08:33 +00:00