1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

222 Commits

Author SHA1 Message Date
Craig Topper
76f7896f49 Prune some includes and forward declarations.
llvm-svn: 153429
2012-03-26 06:58:25 +00:00
Jim Grosbach
012239e10a ARM Darwin symbol ref differences w/o subsection-via-symbols.
When not using subsections via symbols, the assembler can resolve
symbol differences (including pcrel references) to non-local
labels at assembly time, not just those in the same atom.

llvm-svn: 148865
2012-01-24 21:45:25 +00:00
Jim Grosbach
9de520d7ad MCAssembler tweak for determining when a symbol difference is resolved.
If the two fragments are in the same Atom, then the difference
expression is resolvable at compile time. Previously we were checking
that they were in the same fragment, but that breaks down in the
presence of instruction relaxation which has multiple fragments in the
same atom.

rdar://10711829

llvm-svn: 148423
2012-01-18 21:54:12 +00:00
Jim Grosbach
e6d2a7a097 MC tweak symbol difference resolution for non-local symbols.
When the non-local symbol in the expression is in the same fragment
as the second symbol, the assembler can still evaluate the expression
without needing a relocation.

For example, on ARM:
_foo:
	ldr lr, (_foo - 4)

rdar://10348687

llvm-svn: 148341
2012-01-17 22:14:39 +00:00
Jim Grosbach
2f57374e32 Darwin assembler improved relocs when w/o subsections_via_symbols.
When the file isn't being built with subsections-via-symbols, symbol
differences involving non-local symbols can be resolved more aggressively.
Needed for gas compatibility.

llvm-svn: 146054
2011-12-07 19:46:59 +00:00
Jim Grosbach
c3c8c0eddd Tidy up. Hard tabs.
llvm-svn: 145878
2011-12-06 00:13:09 +00:00
Jim Grosbach
93874e36fa Switch MCAssembler to method names starting w/ lower-case.
per http://llvm.org/docs/CodingStandards.html#ll_naming

llvm-svn: 145873
2011-12-06 00:03:48 +00:00
Eric Christopher
fc8e09962f Formatting and typo.
llvm-svn: 139325
2011-09-08 22:17:40 +00:00
Kevin Enderby
16f9df1f05 Fix a Darwin x86_64 special case of a jmp to a temporary symbol from an atom
without a base symbol that must not have a relocation entry.

llvm-svn: 139316
2011-09-08 20:53:44 +00:00
Benjamin Kramer
e404b3e2d1 MachOWriter: Don't crash on fixups with arithmetic, emit a relocation instead. This matches what as does.
llvm-svn: 137414
2011-08-12 01:51:29 +00:00
Jim Grosbach
5a837d70a5 Don't truncate MachO addresses.
Assigned symbol addresses get truncated to 32-bits, even on 64-bit platforms.
That's obviously bogus.
For example,

 .globl _foo
 .equ _foo, 0x987654321ULL


rdar://9922863

llvm-svn: 137158
2011-08-09 22:12:37 +00:00
Evan Cheng
2a0a4e1a73 Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136010
2011-07-25 23:24:55 +00:00
Evan Cheng
13d54fc7c9 Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
llvm-svn: 135833
2011-07-23 00:45:41 +00:00
Jim Grosbach
440526a1e8 Refactor MachO relocation generaration into the Target directories.
Move the target-specific RecordRelocation logic out of the generic MC
MachObjectWriter and into the target-specific object writers. This allows
nuking quite a bit of target knowledge from the supposedly target-independent
bits in lib/MC.

llvm-svn: 133844
2011-06-24 23:44:37 +00:00
Jim Grosbach
c3b24db27e tidy up whitespace.
llvm-svn: 133815
2011-06-24 19:43:27 +00:00
Jim Grosbach
4ba3d51f23 Fixup info for Thumb2 unconditional branch.
rdar://9667872

llvm-svn: 133808
2011-06-24 18:48:32 +00:00
Jim Grosbach
e216f0411d Tidy up.
llvm-svn: 133770
2011-06-23 22:29:00 +00:00
Bill Wendling
c62a961c09 80-column violations.
llvm-svn: 133668
2011-06-23 00:09:43 +00:00
Bill Wendling
19f2f807eb Move class methods out-of-line. This reduces the indentation, and is more in
line with LLVM's general coding style.
No functionality change.

llvm-svn: 133645
2011-06-22 21:07:27 +00:00
Daniel Dunbar
32545135b1 MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.
llvm-svn: 130522
2011-04-29 18:13:42 +00:00
Daniel Dunbar
f419ec6362 MC/Mach-O: Allow emission of relocations for variables in some more cases.
llvm-svn: 130520
2011-04-29 18:10:47 +00:00
Daniel Dunbar
6178302330 MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
llvm-svn: 130519
2011-04-29 18:07:43 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Owen Anderson
b201c7dede Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like BLX, rather than a 2-byte instruction like B.
llvm-svn: 128169
2011-03-23 21:19:56 +00:00
Owen Anderson
7785f055b9 RIT_ARM_ThumbBranch32Bit relocations are not used and should never be generated.
This fixes kimwitu++, bullet, and tramp3dv4 with the ARM integrated assembler.
Fixes <rdar://problem/9165738>.

llvm-svn: 128117
2011-03-22 22:52:54 +00:00
Duncan Sands
e91289191a Silence compiler warning about case values not being in the enumerated type
MCFixupKind.  This is the same technique that is used elsewhere in MC.

llvm-svn: 127676
2011-03-15 08:54:51 +00:00
Oscar Fuentes
15a668f50b Fixes warnings emitted by Visual Studio 2010 compiler.
Patch by Erik Olofsson!

llvm-svn: 126796
2011-03-01 23:11:57 +00:00
Jason W Kim
10c1a81736 Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.
(yes, this is different from R_ARM_CALL)

- Adds a new method getARMBranchTargetOpValue() which handles the
  necessary distinction between the conditional and unconditional br/bl
  needed for ARM/ELF

At least for ARM mode, the needed fixup for conditional versus unconditional
br/bl is identical, but the ARM docs and existing ARM tools expect this
reloc type...

Added a few FIXME's for future naming fixups in ARMInstrInfo.td

llvm-svn: 124895
2011-02-04 19:47:15 +00:00
Evan Cheng
3689d1302d Fix bogus assert condition noticed by Csaba Raduly.
llvm-svn: 124645
2011-02-01 01:50:49 +00:00
Evan Cheng
0cdd5547f1 Completed :lower16: / :upper16: support for movw / movt pairs on Darwin.
- Fixed :upper16: fix up routine. It should be shifting down the top 16 bits first.
- Added support for Thumb2 :lower16: and :upper16: fix up.
- Added :upper16: and :lower16: relocation support to mach-o object writer.

llvm-svn: 123424
2011-01-14 02:38:49 +00:00
Daniel Dunbar
2d0cf8e149 MC/Mach-O/Thumb: Select appropriate relocation types for Thumb.
llvm-svn: 122583
2010-12-27 14:49:49 +00:00
Rafael Espindola
b2e09adc62 Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We now
have a single point where targets test if a relocation is needed.

llvm-svn: 122549
2010-12-24 21:22:02 +00:00
Daniel Dunbar
592854a10a MC/Mach-O/ARM: Start handling some Thumb branches.
llvm-svn: 122547
2010-12-24 16:41:46 +00:00
Daniel Dunbar
e6ec0e7149 MC/Mach-O/ARM: Don't try to use scattered relocs for BR24 fixups.
llvm-svn: 122441
2010-12-22 21:26:43 +00:00
Matt Beaumont-Gay
2a54f466cf Fix another conditional expression mismatched enum type warning.
llvm-svn: 122419
2010-12-22 18:25:55 +00:00
Daniel Dunbar
cb8ac619a2 MC/Mach-O/ARM: We always use the SECTDIFF reloc type on ARM, which is
esp. important given that the LOCAL_SECTDIFF enumeration got redefined.

llvm-svn: 122412
2010-12-22 16:52:19 +00:00
Daniel Dunbar
63f7a3a108 MC/Mach-O/ARM: Clone off an ARM version of RecordScatteredRelocation until I figure out how it is supposed to work.
llvm-svn: 122410
2010-12-22 16:45:29 +00:00
Daniel Dunbar
985567aebc MC/Mach-O: Return to reporting errors if we see unexpected fixup kinds.
llvm-svn: 122409
2010-12-22 16:32:41 +00:00
Daniel Dunbar
d85743ca7a MC/Mach-O/ARM: Recognize generic _Data_N fixup kinds.
llvm-svn: 122408
2010-12-22 16:32:37 +00:00
Daniel Dunbar
e44a2c1166 MC/Mach-O/ARM: Add enough relocation logic to get BR24 relocations.
llvm-svn: 122407
2010-12-22 16:19:24 +00:00
Daniel Dunbar
55eff2421b MC/Mach-O/ARM: Fix thinko.
llvm-svn: 122406
2010-12-22 16:19:20 +00:00
Daniel Dunbar
17e19b2d45 MC/Mach-O/ARM: Stub out RecordARMRelocation, which is mostly a copy of
RecordRelocation with lots of FIXMEs.

llvm-svn: 122402
2010-12-22 13:50:05 +00:00
Daniel Dunbar
8db4843cd3 Simplify.
llvm-svn: 122401
2010-12-22 13:49:56 +00:00
Daniel Dunbar
bc2bf96e91 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.

llvm-svn: 122400
2010-12-22 13:49:43 +00:00
Matt Beaumont-Gay
b03146b50a 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).

llvm-svn: 122377
2010-12-21 23:43:23 +00:00
Daniel Dunbar
1c98bbd915 MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
type.

llvm-svn: 122334
2010-12-21 15:26:45 +00:00
Rafael Espindola
df98fb74f6 Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.
llvm-svn: 122148
2010-12-18 06:27:54 +00:00
Rafael Espindola
7f9be9e112 Remove the MCObjectFormat class.
llvm-svn: 122147
2010-12-18 05:37:28 +00:00
Daniel Dunbar
6979fc1057 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).

llvm-svn: 122042
2010-12-17 05:50:29 +00:00
Daniel Dunbar
14208868a4 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.

llvm-svn: 122038
2010-12-17 04:54:58 +00:00
Daniel Dunbar
2caf23b5a9 MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format specific hook.
- Currently just has stub implementations for Mach-O, ELF, and COFF.

llvm-svn: 122037
2010-12-17 04:54:54 +00:00
Daniel Dunbar
f77af712b7 MC/Assembler: Strip out object writer arguments, now that it is always available
-- and remove FIXME asking for the same!

llvm-svn: 122032
2010-12-17 02:45:59 +00:00
Daniel Dunbar
6d4a3e98f3 MC/Target: Remove HasScatteredSymbols target hook variable, which has been
superceded and was effectively dead.

llvm-svn: 122024
2010-12-17 02:06:08 +00:00
Daniel Dunbar
2277f06687 MC/Mach-O: Lift some MachObjectWriter arguments into the target specific
interface.

llvm-svn: 121981
2010-12-16 17:21:02 +00:00
Daniel Dunbar
5fee4f6862 MC/Mach-O: Stub out explicit MCMachObjectTargetWriter interface.
llvm-svn: 121973
2010-12-16 16:09:19 +00:00
Daniel Dunbar
636e690f58 MC/Mach-O: Move createMachObjectWriter into MCMachObjectWriter.h.
llvm-svn: 121971
2010-12-16 16:08:33 +00:00
Daniel Dunbar
af109884b9 MC/Mach-O: Use fixup info instead of hard coded list.
llvm-svn: 121970
2010-12-16 15:42:31 +00:00
Rafael Espindola
866531d633 Fix absolute recording of differences of symbols in two sections. Reduced from ctor_dtor_count-2.cpp.
llvm-svn: 121152
2010-12-07 17:12:32 +00:00
Rafael Espindola
da64b6aa50 Fix relocations with weak definitions.
llvm-svn: 121114
2010-12-07 05:57:28 +00:00
Rafael Espindola
9ede5ef045 Fix pcrel relocations that cross sections.
llvm-svn: 121107
2010-12-07 03:50:14 +00:00
Rafael Espindola
c98cc0b286 Fix a crash reduced from gcc produced assembly.
llvm-svn: 121085
2010-12-07 01:09:54 +00:00
Rafael Espindola
8dad37785c Sorry for such a large commit. The summary is that only MachO cares about the
actuall addresses in a .o file, so it is better to let the MachO writer compute
it.

This is good for two reasons. First, areas that shouldn't care about
addresses now don't have access to it. Second, the layout of each section
is independent. I should use this in a subsequent commit to speed it up.

Most of the patch is just removing the section address computation. The two
interesting parts are the change on how we handle padding in the end
of sections and how MachO can get the address of a-b when a and b are in
different sections.

Since now the expression evaluation normally doesn't know the section address,
it will think that a-b needs relocation and let the MachO writer know. Once
it has computed the section addresses, it calls back the expression evaluation
with the section addresses to resolve these expressions.

The remaining problem is the handling of padding. Currently it will create
a special alignment fragment at the end. Since that fragment doesn't update
the alignment of the section, it needs the real address to be computed.

Since now the layout will not compute a-b with a and b in different sections,
the only effect that the special alignment fragment has is update the
address size of the section. This can also be done by the MachO writer.

llvm-svn: 121076
2010-12-07 00:27:36 +00:00
Rafael Espindola
c726be7d0a use getSymbolOffset.
llvm-svn: 121041
2010-12-06 21:51:55 +00:00
Rafael Espindola
fd0cc5d13f Another use of getSymbolOffset.
llvm-svn: 121034
2010-12-06 19:55:05 +00:00
Jim Grosbach
0e71db6919 Add support for binary encoding of ARM 'adr' instructions referencing constant
pool entries (LEApcrel pseudo). Ongoing saga of rdar://8542291.

llvm-svn: 120635
2010-12-02 00:28:45 +00:00
Rafael Espindola
f77005db2b 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.

llvm-svn: 120240
2010-11-28 14:17:56 +00:00
Daniel Dunbar
2dd3ae7c9c macho-dump: Add support for dumping relocation entries.
llvm-svn: 120216
2010-11-27 13:39:48 +00:00
Daniel Dunbar
a9f9d6d2db Fix a comment.
llvm-svn: 120199
2010-11-27 07:39:37 +00:00
Daniel Dunbar
9b9f0a4d16 Reduce nesting.
llvm-svn: 120189
2010-11-27 05:18:48 +00:00
Daniel Dunbar
c686ff034f MC/Mach-O: Migrate more constants into MachOFormat.h.
llvm-svn: 120188
2010-11-27 04:59:14 +00:00
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
7fc5cd0a58 make isVirtualSection a virtual method on MCSection. Chris' suggestion.
llvm-svn: 119547
2010-11-17 20:03:54 +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
Jim Grosbach
b48a272807 Trailing whitespace.
llvm-svn: 118831
2010-11-11 20:16:23 +00:00
Jim Grosbach
a85416eb77 Allow targets to specify the MachO CPUType/CPUSubtype information.
llvm-svn: 118288
2010-11-05 18:48:58 +00:00
Rafael Espindola
5f53528867 On ELF we need to know which symbols are used in relocations to decide if
they should be in the symbol table or not. Instead of "guessing", just compute
the symbol table after the relocations are known.

llvm-svn: 115619
2010-10-05 15:11:03 +00:00
Kevin Enderby
84d750a85c This adds a Darwin x86_64 relocation encoding for a subtraction expression
where both symbols are "local", that is non-external symbols, and there is
no "base" for the symbols used in the expression, that is the section has
no non-temporary symbols.  This case looks like this:

% cat local_reloc_A-B.s
	.long 0
LB:	.long 1
	.long LA - LB - 4
	.long 2
LA:	.long 3

which llvm-mc will not encode without this patch, generates a "unsupported
local relocations in difference" error, but the Darwin assembler will
encode with relocation entries like this:

% otool -rv a.out l.out 
a.out:
Relocation information (__TEXT,__text) 2 entries
address  pcrel length extern type    scattered symbolnum/value
00000008 False long   False  SUB     False     1 (__TEXT,__text)
00000008 False long   False  UNSIGND False     1 (__TEXT,__text)

which is very similar to what is encoded when the symbols don't have the
leading 'L' and they are not temporary symbols.  Which llvm-mc and the
Darwin assembler will encoded like this:

Relocation information (__TEXT,__text) 2 entries
address  pcrel length extern type    scattered symbolnum/value
00000008 False long   True   SUB     False     B
00000008 False long   True   UNSIGND False     A

This is the missing relocation encoding needed to allow the Mach-O x86
Dwarf file and line table to be emitted.  So this patch also removes the
TODO from the if() statement in MCMachOStreamer::Finish() that didn't 
call MCDwarfFileTable::Emit() for 64-bit targets.

llvm-svn: 115389
2010-10-02 00:13:41 +00:00
Rafael Espindola
480ee577ad Correctly produce R_X86_64_32 or R_X86_64_32S.
With this patch in

movq    $foo, foo(%rip)
foo:
.long   foo

We produce a R_X86_64_32S for the first relocation and R_X86_64_32 for the
second one.

llvm-svn: 115134
2010-09-30 03:11:42 +00:00
Rafael Espindola
3e2630deca Make it possible for the MCObjectWriter to decide if a given fixup is fully
resolved or not. Different object files have different restrictions and
different native assemblers have different idiosyncrasies we want to emulate
for now.

Move the existing MachO logic to the new place and implement an ELF one that
gets fixups to globals right.

llvm-svn: 115131
2010-09-30 02:22:20 +00:00
Rafael Espindola
843df9bbed Remove unused argument.
llvm-svn: 114852
2010-09-27 18:13:03 +00:00
Daniel Dunbar
ed92665b19 MC/Mach-O/i386: Fix a crash in relocation handling.
llvm-svn: 114176
2010-09-17 15:21:50 +00:00
Chris Lattner
e51188af11 silence a vc2010 warning: " result of 32-bit shift implicitly converted to
64 bits (was 64-bit shift intended?)", pointed out by 'nobled' on llvmdev

llvm-svn: 111148
2010-08-16 16:35:20 +00:00
Michael J. Spencer
26a45fe57e Revert "MC/MachO: Fix possible null pointer dereference."
This reverts commit 110575.

Target.isAbsolute() is true if SD would be null.

llvm-svn: 110683
2010-08-10 16:00:49 +00:00
Michael J. Spencer
72463de287 MC/MachO: Fix possible null pointer dereference.
Discovered by Microsoft Visual Studio 2010 Code Analysis.

llvm-svn: 110575
2010-08-09 15:28:05 +00:00
Chris Lattner
155420f59f finish up support for callw: PR7195
llvm-svn: 107826
2010-07-07 22:35:13 +00:00
Duncan Sands
5446bab8a5 The variable "Value" is carefully set to Layout.getSymbolAddress,
but then not actually used - maybe a bug?  Remove the variable.

llvm-svn: 107137
2010-06-29 13:26:33 +00:00
Eric Christopher
0c4230b33c Get the addend correct for i386 pic.
Thanks Daniel!

llvm-svn: 106608
2010-06-22 23:51:47 +00:00
Eric Christopher
b92292eb08 Update comment.
llvm-svn: 106191
2010-06-17 00:49:46 +00:00
Eric Christopher
9c56c0a851 In progress on 32-bit addends.
llvm-svn: 106154
2010-06-16 21:32:38 +00:00
Daniel Dunbar
2c6d6693e2 MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.
llvm-svn: 106142
2010-06-16 20:04:29 +00:00
Eric Christopher
62a7f68562 Fix indentation.
llvm-svn: 106072
2010-06-16 00:26:36 +00:00
Eric Christopher
6c154dc98d Some more work on mach-o TLV relocations.
llvm-svn: 106062
2010-06-15 22:59:05 +00:00
Eric Christopher
405e56fdfb Rearrange conditionals so we don't get caught with the correct type as wrong.
llvm-svn: 104793
2010-05-27 00:52:31 +00:00
Daniel Dunbar
87dcbd1ee5 MC: Eliminate MCAsmFixup, replace with MCFixup.
llvm-svn: 104699
2010-05-26 15:18:56 +00:00
Daniel Dunbar
55c1bf55fe MC: Use accessors for access to MCAsmFixup.
llvm-svn: 104697
2010-05-26 15:18:31 +00:00
Eric Christopher
371732bd2a Start adding mach-o tls reloc support.
llvm-svn: 104651
2010-05-26 00:02:12 +00:00
Benjamin Kramer
47bf53a5dd Reduce string trashing.
llvm-svn: 104223
2010-05-20 14:14:22 +00:00
Daniel Dunbar
739e720a21 MC/Mach-O: Implement support for setting indirect symbol table offset in section header.
Also, create symbol data for LHS of assignment, to match 'as' symbol ordering better.

llvm-svn: 104033
2010-05-18 17:28:24 +00:00
Daniel Dunbar
9a1bbd9dc5 MC/Mach-O: Remove some FIXMEs.
llvm-svn: 104032
2010-05-18 17:28:20 +00:00
Daniel Dunbar
89a1d9036a MC/Mach-O/x86_64: Darwin's special "signed_N" relocation types should only be
used to replace a normal relocation, not a reference to a GOT entry.

llvm-svn: 103789
2010-05-14 18:53:40 +00:00
Daniel Dunbar
a033860d55 MC/Mach-O/x86_64: Fix PCrel adjustment for x86_64, which was using the fixup
offset instead of the fixup address as intended.

llvm-svn: 103527
2010-05-11 23:53:11 +00:00
Daniel Dunbar
7d7b6cf3b7 MC/Mach-O: As Kevin pointed out, 'Address' is really an offset -- rename to clarify.
llvm-svn: 103526
2010-05-11 23:53:07 +00:00
Daniel Dunbar
e43676c164 MC/Mach-O: Fix a crash on invalid.
llvm-svn: 103525
2010-05-11 23:53:05 +00:00
Daniel Dunbar
d2c14ce38d MC/Mach-O: Fix another mismatch with .weak_definition, we shouldn't use a
scattered relocation entry with a .weak_definition.

llvm-svn: 103443
2010-05-10 23:15:20 +00:00
Daniel Dunbar
c54539c121 MC/Mach-O: Factor out doesSymbolRequireExternRelocation.
llvm-svn: 103442
2010-05-10 23:15:13 +00:00
Kevin Enderby
3807a4746a Fix i386 relocations to Weak Definitions. The relocation entries should be
external and the item to be relocated should not have the address of the
symbol added in.

llvm-svn: 103302
2010-05-07 21:44:23 +00:00
Daniel Dunbar
9a3d46162f MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support for
writing them.
 - <rdar://problem/7885351> integrated assembler broken for i386 objc code

llvm-svn: 103112
2010-05-05 19:01:05 +00:00
Daniel Dunbar
f5dc70a7d1 MC/Mach-O/x86_64: Relocations in debug sections should use local relocations
when possible.
 - <rdar://problem/7934873>

llvm-svn: 103092
2010-05-05 17:22:39 +00:00
Benjamin Kramer
3b7602b1fb Various MSVC warning fixes about truncated 64 bit shifts and const pointers passed to free.
llvm-svn: 100767
2010-04-08 15:25:57 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Daniel Dunbar
f2c7999cd8 MC/Mach-O/x86_64: Support @GOTPCREL on symbols, even for non-PCrel relocations!
llvm-svn: 99853
2010-03-29 23:56:40 +00:00
Daniel Dunbar
f793969cd1 MC/Mach-O: Switch to MCSectionData::getOrdinal.
llvm-svn: 99504
2010-03-25 08:08:54 +00:00
Daniel Dunbar
276acc64a9 Fix -Asserts warning.
llvm-svn: 99499
2010-03-25 07:10:05 +00:00
Daniel Dunbar
797b44b26c MC: Route access to SectionData offset and file size through MCAsmLayout.
llvm-svn: 99474
2010-03-25 02:00:07 +00:00
Daniel Dunbar
4b6b2a1a1f MC: Route access to Fragment offset and effective size through MCAsmLayout.
llvm-svn: 99473
2010-03-25 02:00:02 +00:00
Daniel Dunbar
3a79d30c6c MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
llvm-svn: 99380
2010-03-24 03:43:40 +00:00
Daniel Dunbar
1836f73559 Add a FIXME.
llvm-svn: 99228
2010-03-22 23:16:43 +00:00
Daniel Dunbar
6a91d2767b MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead of a MCDataFragment). Object files should only need the generic MCFragment features.
llvm-svn: 99205
2010-03-22 20:35:50 +00:00
Daniel Dunbar
6b3e18d2c4 Better fix for r98994, MachObjectWriterImpl wasn't intended to be virtual.
llvm-svn: 99031
2010-03-20 01:58:40 +00:00
Rafael Espindola
5b074c72ee Fix -Wnon-virtual-dtor warning.
llvm-svn: 98994
2010-03-19 21:26:46 +00:00
Daniel Dunbar
3c66c7a3c1 MC/Mach-O/x86_64: Add relocation support.
- This is "extraordinarily" Darwin 'as' compatible. See the litany of FIXMEs littered about for more information.
 - There are a few cases which seem to clearly be 'as' bugs which I have left unsupported, and there is one cases where we diverge but should fix if it blocks diffing .o files (Darwin 'as' ends up widening a jump unnecessarily).
 - 403.gcc build, runs, and diffs equivalently to the 'as' built version now (using llvm-mc). However, it builds so slowly that I wouldn't recommend trying it quite yet. :)

llvm-svn: 98974
2010-03-19 18:07:55 +00:00
Daniel Dunbar
74330a6389 MC/Mach-O: Move to MachObjectWriter.{h,cpp}.
llvm-svn: 98952
2010-03-19 10:43:15 +00:00