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

57 Commits

Author SHA1 Message Date
Nico Rieck
d907b86dee MC: Support larger COFF string tables
Single-slash encoded entries do not require a terminating null. This bumps
the maximum table size from ~1MB to ~9.5MB.

llvm-svn: 187352
2013-07-29 12:30:12 +00:00
Reid Kleckner
b24f07e0af [mc-coff] Resolve aliases when emitting COFF relocations
This is consistent with the ELF object writer.

Add some COFF tests that relocate against an alias.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D1079

llvm-svn: 186341
2013-07-15 19:41:21 +00:00
Nico Rieck
fb7b696627 MC: Implement COFF .linkonce directive
llvm-svn: 185753
2013-07-06 12:13:10 +00:00
Peter Collingbourne
9c7b994acf COFF: Fix weak external aliases.
Differential Revision: http://llvm-reviews.chandlerc.com/D700

llvm-svn: 180034
2013-04-22 18:48:56 +00:00
Nico Rieck
8e22855ea6 MC: Support COFF image-relative MCSymbolRefs
Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and
IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are
similar to normal 4-byte relocations except that they do not include
the base address of the image.

Image-relative relocations are used for debug information (32-bit) and
SEH unwind tables (64-bit).

A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to
specify such relocations. For AT&T assembly, this variant can be accessed
using the symbol suffix '@imgrel'.

llvm-svn: 179240
2013-04-10 23:28:17 +00:00
Dmitri Gribenko
bbc618e0fa Remove unused variable (unused since r173839)
llvm-svn: 173847
2013-01-29 23:27:45 +00:00
Michael J. Spencer
264c449666 [MC][COFF] Delay handling symbol aliases when writing
Fixes PR14447 and PR9034. Patch by Nico Rieck!

llvm-svn: 173839
2013-01-29 22:10:07 +00:00
Dmitri Gribenko
1584888148 Remove redundant 'llvm::' qualifications
llvm-svn: 172358
2013-01-13 16:01:15 +00:00
Chandler Carruth
a490793037 Use the new script to sort the includes of every file under lib.
Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

llvm-svn: 169131
2012-12-03 16:50:05 +00:00
Sylvestre Ledru
b77340e506 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Michael J. Spencer
e8ce31af5d Implement relocation-overflow behavior for PE/COFF.
This needs a test, but it will take some time to figure
out the best way to get an input that will produce > 2^16 relocs.

Patch by Graydon Hoare!

llvm-svn: 152787
2012-03-15 09:03:03 +00:00
Rafael Espindola
2fc741dfac Move x86 specific bits of the COFF writer to lib/Target/X86.
llvm-svn: 147231
2011-12-24 02:14:02 +00:00
Rafael Espindola
640fd8dd5f Move all the dependencies on X86FixupKinds.h to a single method in preparation
to moving it to lib/Target/X86.

llvm-svn: 147190
2011-12-22 22:21:47 +00:00
Rafael Espindola
549d0683b1 Add back the MC bits of 126425. Original patch by Nathan Jeffords. I added the
asm parsing and testcase.

llvm-svn: 146801
2011-12-17 01:14:52 +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
Michael J. Spencer
3b2694409f MC/COFF: Correctly emit the size of an empty string table.
llvm-svn: 144111
2011-11-08 19:52:32 +00:00
Evan Cheng
6fb04ad32e Refactor X86 target to separate MC code from Target code.
llvm-svn: 135930
2011-07-25 18:43:53 +00:00
Rafael Espindola
e206800036 Fix relative relocations. This is sufficient for running the rust testsuite with
MC :-)

llvm-svn: 129923
2011-04-21 18:36:50 +00:00
Rafael Espindola
032ab8c114 Behave like gnu as when a relocation crosses sections.
llvm-svn: 129850
2011-04-20 14:01:45 +00:00
Cameron Zwarich
974208a607 Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.
llvm-svn: 126488
2011-02-25 16:30:32 +00:00
Devang Patel
f2b2417c2c Enable DebugInfo support for COFF object files.
Patch by Nathan Jeffords!

llvm-svn: 126425
2011-02-24 21:04:00 +00:00
Rafael Espindola
4ef1268b39 Gas is very inconsistent about when a relaxation/relocation is needed. Do
the right thing and stop trying to copy it. Fixes PR8944.

llvm-svn: 125648
2011-02-16 03:25:55 +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
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
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
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
d361a448af Use getSymbolOffset on the COFF writer.
llvm-svn: 120979
2010-12-06 03:24:04 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +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
Michael J. Spencer
a43c204ef7 Fix Warnings.
llvm-svn: 117062
2010-10-21 20:49:38 +00:00
Michael J. Spencer
f9a7c39ecc MC-COFF: Add support for default-null weak externals.
llvm-svn: 116666
2010-10-16 08:25:57 +00:00
Michael J. Spencer
56d81e7eae MC-COFF: Fix .bss section size. Fixes PR8335. Patch by NAKAMUTA Takumi!
llvm-svn: 116155
2010-10-09 16:04:45 +00:00
Michael J. Spencer
3066a09189 MC-COFF: Assert on non-coff sections.
llvm-svn: 116148
2010-10-09 11:00:37 +00:00
Michael J. Spencer
43ccdd557d MC-COFF: Handle relaxation in COFF better. Fixes PR8321.
llvm-svn: 116013
2010-10-07 23:55:40 +00:00
Michael J. Spencer
079e1e2ce8 Fix Punctuation.
llvm-svn: 115657
2010-10-05 19:48:12 +00:00
Michael J. Spencer
19b6962abb MC-COFF: Fix (PR8278) temporary symbol relocations.
llvm-svn: 115656
2010-10-05 19:48:03 +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
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
Michael J. Spencer
9c138864bc MC-COFF: Fix symbol storage class for globals
llvm-svn: 115020
2010-09-29 03:13:41 +00:00
Michael J. Spencer
13fb9cadcb MC-COFF: Fix signed/unsigned comparison.
llvm-svn: 114888
2010-09-27 21:17:39 +00:00
Michael J. Spencer
4867bf0fad MC-COFF: Drop empty sections, and label symbols. Convert relocations
targeted at symbols into relocations relative to the containing section.

Patch by Nathan Jeffords!

llvm-svn: 114823
2010-09-27 08:58:26 +00:00
Michael J. Spencer
526e183800 Fix COFF x86-64 relocations. PR7960.
Multiple symbol reloc handling part of the patch by Cameron Esfahani.

llvm-svn: 111963
2010-08-24 21:04:52 +00:00
Michael J. Spencer
18689045ce MC: Add partial x86-64 support to COFF.
llvm-svn: 111728
2010-08-21 05:58:13 +00:00
Michael J. Spencer
59bd7389a4 MC: Fix symbol fragment offsets in COFF.
Patch by Cameron Esfahani!

llvm-svn: 110104
2010-08-03 05:02:46 +00:00
Michael J. Spencer
135ecc4689 Revert "MC: Fix symbol fragment offsets in COFF."
This reverts commit r110100

Wrong path caps.

llvm-svn: 110103
2010-08-03 04:53:28 +00:00
Michael J. Spencer
6ff92fbc86 MC: Add time travel support to COFF.
llvm-svn: 110101
2010-08-03 04:43:33 +00:00