1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

801 Commits

Author SHA1 Message Date
Rafael Espindola
1602d991d5 Set default flags for .rodata.
llvm-svn: 118395
2010-11-08 02:47:59 +00:00
Rafael Espindola
296935eca3 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.

llvm-svn: 118377
2010-11-07 15:03:27 +00:00
Rafael Espindola
877bb5ba4b Relax dwarf line fragments. This fixes a crash in the included testcase.
llvm-svn: 118365
2010-11-07 02:07:12 +00:00
Jim Grosbach
a98b9ba916 Add '.code 32' assembler directive to MC streamers.
llvm-svn: 118309
2010-11-05 22:40:09 +00:00
Jim Grosbach
bbef2c5fcc MC'ize the '.code 16' and '.thumb_func' ARM directives.
llvm-svn: 118301
2010-11-05 22:08:08 +00:00
Benjamin Kramer
ac2bcb05cc Put class into an anonymous namespace.
llvm-svn: 118294
2010-11-05 19:56:38 +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
Jim Grosbach
e952ae2659 syntaxunified directive is a no-op for MachO writing.
llvm-svn: 118287
2010-11-05 18:47:32 +00:00
Rafael Espindola
3f4a79b243 Add 118023 back, but with proper spelling for .uleb128/.sleb128.
llvm-svn: 118254
2010-11-04 18:17:08 +00:00
Rafael Espindola
daf6328eb0 Do relaxations with FT_Org fragments. Fixes the FIXME:
// FIXME: We should compute this sooner, we don't want to recurse here, and
    // we would like to be more functional.

In MCAssembler::ComputeFragmentSize.

llvm-svn: 118080
2010-11-02 21:38:23 +00:00
Rafael Espindola
1db6a21aff Add support for expressions in .sleb/.uleb directives.
llvm-svn: 118023
2010-11-02 17:22:24 +00:00
Rafael Espindola
2f114f8430 Write the line info to .debug_line.
llvm-svn: 117930
2010-11-01 17:07:14 +00:00
Rafael Espindola
5571ce5ed4 Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.
llvm-svn: 117925
2010-11-01 16:27:31 +00:00
Rafael Espindola
a7f92c500c Add support for .value.
llvm-svn: 117922
2010-11-01 15:29:07 +00:00
Rafael Espindola
7a38cb0144 Implement .weakref.
llvm-svn: 117911
2010-11-01 14:28:48 +00:00
Rafael Espindola
660b7f5c4a Add support for files with more than 65280 sections. No testcase since
it would be a bit too big :-)

llvm-svn: 117849
2010-10-31 00:16:26 +00:00
Rafael Espindola
0d9ac34ffa Be more strict on when we produce an undefined reference. In gas a file with
just

.type   foo,@object

will produce an undefined reference to foo. On the other hand, a file with
just

.weakref bar, foo

will not. It is somewhat hard to support both in MC since both statements
should create the symbols. It should be possible if we really need to by
adding to the flags, but hopefully that is not necessary.

With this patch we do not produce a undefined reference in any of those cases.
The assembly file needs an actual use for the undefined reference to be
present.

This is in preparation for a patch implementing .weakref.

llvm-svn: 117735
2010-10-29 23:09:31 +00:00
Rafael Espindola
913ce7ebc8 Improvements to .section parsing:
* If we have a M or a G, reject sections without the type
* Only parse the flag specific arguments if we have M or G
* Parse the corresponding arguments for M and G

We ignore the G arguments and flag for now.

llvm-svn: 117608
2010-10-28 21:33:33 +00:00
Rafael Espindola
b562975139 Add support for the .string directive.
llvm-svn: 117592
2010-10-28 20:02:27 +00:00
Rafael Espindola
f230319275 Defined weak symbols should have non-zero value.
llvm-svn: 117585
2010-10-28 19:39:57 +00:00
Rafael Espindola
862d688cbd Fix relocations with renamed symbols.
llvm-svn: 117575
2010-10-28 19:08:03 +00:00
Rafael Espindola
e62cf892ae Aliases defined with .symver should copy the binding of the symbols they alias.
Move the existing patching for undefined symbols so that all the patching
is done in the same function.

llvm-svn: 117570
2010-10-28 18:33:03 +00:00
Roman Divacky
2aedee6ff2 Use the IDVal directly as there's no need to convert to std::string.
Pointed out by Chris!

llvm-svn: 117557
2010-10-28 16:57:58 +00:00
Roman Divacky
8555f153e9 Implement .equ directive as a synonym to .set.
llvm-svn: 117553
2010-10-28 16:22:58 +00:00
Rafael Espindola
ff7e4e4e43 Implement R_X86_64_DTPOFF32.
llvm-svn: 117548
2010-10-28 15:11:03 +00:00
Rafael Espindola
1d1ff5485c Implement TLSLD.
llvm-svn: 117547
2010-10-28 15:02:40 +00:00
Rafael Espindola
8372247e83 Implement DTPOFF.
llvm-svn: 117546
2010-10-28 14:48:59 +00:00
Rafael Espindola
c44c5b374a Implement TLSLDM.
llvm-svn: 117544
2010-10-28 14:37:09 +00:00
Rafael Espindola
d8ef67f8b9 Implement VK_GOTNTPOFF and switch RelocNeedsGOT to use VariantKind.
llvm-svn: 117543
2010-10-28 14:22:44 +00:00
Rafael Espindola
68ec803155 Add support for R_386_TLS_GD, R_386_TLS_LE_32, R_386_TLS_IE and R_386_TLS_LE.
llvm-svn: 117494
2010-10-27 21:23:52 +00:00
Rafael Espindola
2ea1239070 Implement R_X86_64_GOTTPOFF, R_X86_64_TLSGD and R_X86_64_TPOFF32.
llvm-svn: 117481
2010-10-27 20:28:07 +00:00
Benjamin Kramer
a79201f572 Replace pointer arithmetic with StringRef::substr.
llvm-svn: 117477
2010-10-27 19:53:52 +00:00
Rafael Espindola
4db628cd34 Set default type and flags for .init and .fini.
llvm-svn: 117471
2010-10-27 18:45:20 +00:00
Rafael Espindola
ca302c994a Produce an error for an invalid use of .symver.
llvm-svn: 117462
2010-10-27 17:56:18 +00:00
Rafael Espindola
58a0ea80a4 Symbols defined as the difference of other two end up in the ABS section.
llvm-svn: 117451
2010-10-27 16:04:30 +00:00
Rafael Espindola
23d05a8675 Add support for the .symver directive. This is really ugly, but most of it is
contained in the ELF object writer.

llvm-svn: 117448
2010-10-27 15:18:17 +00:00
Rafael Espindola
f5b4013598 Move more logic to isInSymtab and simplify.
llvm-svn: 117447
2010-10-27 14:44:52 +00:00
Rafael Espindola
50d3c29c30 Add support for .ident.
llvm-svn: 117389
2010-10-26 19:35:47 +00:00
Daniel Dunbar
5cbb066ea3 MC/AsmParser: Fix relative precedence of {+,-} and comparison ops.
llvm-svn: 117299
2010-10-25 20:18:56 +00:00
Daniel Dunbar
97fa30f53b MC/AsmLexer: Fix bug in source location for Slash token.
llvm-svn: 117298
2010-10-25 20:18:53 +00:00
Rafael Espindola
5748458e7d Add support for emitting ARM file attributes.
llvm-svn: 117275
2010-10-25 17:50:35 +00:00
Rafael Espindola
c6e7790c4b Add X86::reloc_global_offset_table and use it to have a single place where
we check for _GLOBAL_OFFSET_TABLE_.

llvm-svn: 117241
2010-10-24 17:35:42 +00:00
Benjamin Kramer
9e988fe81e Make some symbols static, move classes into anonymous namespaces.
llvm-svn: 117111
2010-10-22 17:35:07 +00:00
Wesley Peck
488027efa3 Making the e_machine configurable by the target backend in ELFObjectWriter.
llvm-svn: 117099
2010-10-22 15:52:49 +00:00
Jim Grosbach
e6d61a87e4 Trailing whitespace.
llvm-svn: 117073
2010-10-21 22:04:05 +00:00
Michael J. Spencer
a43c204ef7 Fix Warnings.
llvm-svn: 117062
2010-10-21 20:49:38 +00:00
Rafael Espindola
69c973fbfd Do not recurse into symbol refs that have a variant kind. This prevents us
from losing the variant when producing a relocation on an alias.

llvm-svn: 117037
2010-10-21 18:00:20 +00:00
Chandler Carruth
55850cad48 Remove remaining uses of ATTRIBUTE_UNUSED on variables, and delete three
#includes in the process.

llvm-svn: 116919
2010-10-20 08:27:02 +00:00
Rafael Espindola
5f43aeb079 Small cleanups and fixes in preparation for fixing _GLOBAL_OFFSET_TABLE_.
llvm-svn: 116848
2010-10-19 19:31:37 +00:00
Bill Wendling
f937f0ed59 Fix spelling.
llvm-svn: 116804
2010-10-19 10:18:23 +00:00