Commit Graph

8 Commits

Author SHA1 Message Date
Ed Maste 8fd0196c6f lld: Default image base address to 0x200000 on x86-64
Align to the large page size (known as a superpage or huge page).
FreeBSD automatically promotes large, superpage-aligned allocations.

Differential Revision:	https://reviews.llvm.org/D27042

llvm-svn: 287782
2016-11-23 17:44:02 +00:00
Rui Ueyama cc1f10df5f Remove trailing whitespaces.
llvm-svn: 276649
2016-07-25 16:51:52 +00:00
Rui Ueyama 03a6cec51e Detect invalid use of R_X86_64_GOTTPOFF.
It is an ABI requirement that the relocation must be used
in MOVQ or LEAQ instructions. Previously, we ignored invalid
relocations.

llvm-svn: 273248
2016-06-21 06:03:28 +00:00
Rui Ueyama 55a9def2bf Refactor X86_64TargetInfo::relaxTlsIeToLe.
This patch is to rewrite the function with a table-lookup-ish approach
so that it can read as a series of "convert this pattern to this" pattern.

llvm-svn: 273238
2016-06-21 03:42:32 +00:00
Rafael Espindola 22ef956a45 Change how we apply relocations.
With this patch we use the first scan over the relocations to remember
the information we found about them: will them be relaxed, will a plt be
used, etc.

With that the actual relocation application becomes much simpler. That
is particularly true for the interfaces in Target.h.

This unfortunately means that we now do two passes over relocations for
non SHF_ALLOC sections. I think this can be solved by factoring out the
code that scans a single relocation. It can then be used both as a scan
that record info and for a dedicated direct relocation of non SHF_ALLOC
sections.

I also think it is possible to reduce the number of enum values by
representing a target with just an OutputSection and an offset (which
can be from the start or end).

This should unblock adding features like relocation optimizations.

llvm-svn: 266158
2016-04-13 01:40:19 +00:00
George Rimar 1452f485e2 [ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxation
R_X86_64_DTPOFF64 was not handled properly.
Next sample app was impossible to link before this patch:

~/pg/release/bin/clang -target x86_64-pc-linux testthread.cpp -c -g
~/pg/d+a/bin/ld.lld testthread.o 
"Unknown TLS optimization" (value was 17)

__thread int x = 0;
void _start() {
}

It works fine now.

Differential revision: http://reviews.llvm.org/D18039

llvm-svn: 263150
2016-03-10 18:57:17 +00:00
George Rimar 6713cf8a52 [ELF] - Implemented optimizations for @tlsld and @tlsgd
Implements @tlsld (LD to LE) and @tlsgd (GD to LE) optimizations.
Patch does not implement the GD->IE case for @tlsgd.

Differential revision: http://reviews.llvm.org/D14870

llvm-svn: 254101
2015-11-25 21:46:05 +00:00
George Rimar 77d1cb1ddf [ELF2] - Optimization for R_X86_64_GOTTPOFF relocation.
R_X86_64_GOTTPOFF is not always requires GOT entries. Some relocations can be converted to local ones.

Differential revision: http://reviews.llvm.org/D14713

llvm-svn: 253966
2015-11-24 09:00:06 +00:00