Rafael Espindola
9bb44a5ce8
Fixed version of 118639 with an extra assert to catch similar problems
...
earlier. Implicit bool -> int conversions are evil!
llvm-svn: 118651
2010-11-09 23:42:07 +00:00
Rafael Espindola
33048f069f
Revert previous patch. Missed a case.
...
llvm-svn: 118645
2010-11-09 22:54:38 +00:00
Rafael Espindola
4bdd2724e3
Remove IsExplicit. It was always false.
...
llvm-svn: 118639
2010-11-09 22:37:44 +00:00
Rafael Espindola
1614597873
Implement .weakref.
...
llvm-svn: 117911
2010-11-01 14:28:48 +00:00
Rafael Espindola
3fe87a1eed
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
45834a0065
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
3c5a54e4b9
Defined weak symbols should have non-zero value.
...
llvm-svn: 117585
2010-10-28 19:39:57 +00:00
Rafael Espindola
29f70afbae
Fix relocations with renamed symbols.
...
llvm-svn: 117575
2010-10-28 19:08:03 +00:00
Rafael Espindola
6cd76e63f8
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
Rafael Espindola
936ba3af28
Implement R_X86_64_DTPOFF32.
...
llvm-svn: 117548
2010-10-28 15:11:03 +00:00
Rafael Espindola
2dbec3f762
Implement TLSLD.
...
llvm-svn: 117547
2010-10-28 15:02:40 +00:00
Rafael Espindola
e8f08be11c
Implement DTPOFF.
...
llvm-svn: 117546
2010-10-28 14:48:59 +00:00
Rafael Espindola
6f23eb380d
Implement TLSLDM.
...
llvm-svn: 117544
2010-10-28 14:37:09 +00:00
Rafael Espindola
b3b49bbc39
Implement VK_GOTNTPOFF and switch RelocNeedsGOT to use VariantKind.
...
llvm-svn: 117543
2010-10-28 14:22:44 +00:00
Rafael Espindola
f8537165bd
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
24c8b04d5f
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
14807270be
Replace pointer arithmetic with StringRef::substr.
...
llvm-svn: 117477
2010-10-27 19:53:52 +00:00
Rafael Espindola
26496e6835
Produce an error for an invalid use of .symver.
...
llvm-svn: 117462
2010-10-27 17:56:18 +00:00
Rafael Espindola
cc1b168ef6
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
eb0c2c170d
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
a5efd6a27c
Move more logic to isInSymtab and simplify.
...
llvm-svn: 117447
2010-10-27 14:44:52 +00:00
Rafael Espindola
0ed1543d4e
Add support for emitting ARM file attributes.
...
llvm-svn: 117275
2010-10-25 17:50:35 +00:00
Rafael Espindola
800fd3533c
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
Wesley Peck
1851090515
Making the e_machine configurable by the target backend in ELFObjectWriter.
...
llvm-svn: 117099
2010-10-22 15:52:49 +00:00
Rafael Espindola
ee8d15157a
Small cleanups and fixes in preparation for fixing _GLOBAL_OFFSET_TABLE_.
...
llvm-svn: 116848
2010-10-19 19:31:37 +00:00
Rafael Espindola
fba9f74932
Implement R_386_GOT32.
...
llvm-svn: 116744
2010-10-18 20:47:21 +00:00
Rafael Espindola
0a5314fdb3
Relocate with .bss instead of using the symbol. Matches gas behavior.
...
llvm-svn: 116741
2010-10-18 20:25:33 +00:00
Rafael Espindola
3604d4441a
Reenable assert.
...
llvm-svn: 116738
2010-10-18 19:33:01 +00:00
Rafael Espindola
e3dc9e2ea1
Produce ELF::R_386_GOTPC relocations.
...
llvm-svn: 116728
2010-10-18 18:36:12 +00:00
Rafael Espindola
257374bb0f
Make the bots happy.
...
llvm-svn: 116719
2010-10-18 18:03:28 +00:00
Rafael Espindola
3521f8467d
Produce a R_386_PLT32 when needed. Moved the default cases of switches to the
...
start for consistency.
llvm-svn: 116715
2010-10-18 16:58:03 +00:00
Rafael Espindola
4464e0858f
Handle GOTOFF correctly on i386.
...
llvm-svn: 116711
2010-10-18 16:38:04 +00:00
Benjamin Kramer
77414757f6
Fix a typo and silence unused variable warnings in -Asserts build.
...
llvm-svn: 116685
2010-10-17 07:38:40 +00:00
Rafael Espindola
4262a22225
Add a MCObjectFormat class so that code common to all targets that use a
...
single object format can be shared.
This also adds support for
mov zed+(bar-foo), %eax
on ELF and COFF targets.
llvm-svn: 116675
2010-10-16 18:23:53 +00:00
Rafael Espindola
84378f0f53
Refactor alias handling to AliasedSymbol.
...
llvm-svn: 116600
2010-10-15 18:25:33 +00:00
Rafael Espindola
fbcf0db7ee
Refactor code a bit and avoid creating unnecessary entries in the string
...
map.
llvm-svn: 116579
2010-10-15 15:39:06 +00:00
Rafael Espindola
bee6e9f8e0
Remove some code duplication.
...
llvm-svn: 116484
2010-10-14 16:34:44 +00:00
Rafael Espindola
883936ce0b
Another case of 256 sections not being enough :-)
...
llvm-svn: 115858
2010-10-06 22:28:19 +00:00
Rafael Espindola
5f2d6a5cd9
Get binding and visibility info from the the alias, but Type from the symbol
...
being aliased.
llvm-svn: 115836
2010-10-06 21:02:29 +00:00
Rafael Espindola
d444577382
If a symbol is global, reloc against it even if it is in a mergeable section.
...
llvm-svn: 115817
2010-10-06 19:27:21 +00:00
Rafael Espindola
83b2a3337f
Make sure weak symbols are listed after the local ones.
...
llvm-svn: 115795
2010-10-06 16:47:31 +00:00
Rafael Espindola
8f3d2c9058
Correctly handle GOTPCREL relocations.
...
llvm-svn: 115793
2010-10-06 16:23:36 +00:00
Rafael Espindola
d7565c3a06
Use a relocation against the symbol if it is a PLT and the symbol is in another
...
section. Common because of linkonce sections.
llvm-svn: 115718
2010-10-05 23:57:26 +00:00
Rafael Espindola
0ad137e98e
Implement more alias cases.
...
llvm-svn: 115699
2010-10-05 22:26:43 +00:00
Rafael Espindola
3844da781f
256 sections should be enough for anyone...
...
llvm-svn: 115687
2010-10-05 21:20:07 +00:00
Rafael Espindola
c58a37ea51
Don't crash in a strange .size directive.
...
llvm-svn: 115684
2010-10-05 21:02:45 +00:00
Rafael Espindola
b1d0789357
Implement a simple alias case and refactor the code a bit so that the
...
isInSymtab and isLocal logic in the two loops don't get easily out of sync.
llvm-svn: 115643
2010-10-05 18:01:23 +00:00
Rafael Espindola
d03e81dba8
Produce a undefined reference to _GLOBAL_OFFSET_TABLE_ when needed.
...
llvm-svn: 115623
2010-10-05 15:48:37 +00:00
Rafael Espindola
bce26a1ee0
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
fd1fff8b19
Implement ELF::R_X86_64_GOTPCREL.
...
llvm-svn: 115547
2010-10-04 19:51:39 +00:00