| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D14749
llvm-svn: 253352
|
| |
|
|
|
|
| |
With this the only way to get the old elf linker is "-flavor old-elf".
llvm-svn: 253318
|
| |
|
|
| |
llvm-svn: 253313
|
| |
|
|
| |
llvm-svn: 253312
|
| |
|
|
|
|
| |
This is the first step in making ELF2 the default.
llvm-svn: 253188
|
| |
|
|
|
|
|
|
|
|
| |
PT_GNU_STACK is a entry in the elf file format which contains the access rights (read, write, execute) of the stack,
it is always generated now. By default stack is not executable in this implementation.
-z execstack can be used to make executable.
Differential revision: http://reviews.llvm.org/D14571
llvm-svn: 253145
|
| |
|
|
|
|
|
|
| |
Generates single GOT entry, R_X86_64_TPOFF64 is added to RelaDyn.
Differential revision: http://reviews.llvm.org/D14621
llvm-svn: 253049
|
| |
|
|
| |
llvm-svn: 253044
|
| |
|
|
|
|
|
|
| |
This sections can be protected with relro after resolving relocations by dynamic linker.
Differential revision: http://reviews.llvm.org/D14567
llvm-svn: 253018
|
| |
|
|
|
|
|
| |
Remove backslash before redirection as it causes
echo to fail on Windows.
llvm-svn: 253017
|
| |
|
|
|
|
|
|
| |
This patch covers only the case where no DSO is involved.
Differential Revision: http://reviews.llvm.org/D14606
llvm-svn: 253007
|
| |
|
|
| |
llvm-svn: 252979
|
| |
|
|
| |
llvm-svn: 252923
|
| |
|
|
|
|
|
|
|
|
| |
* determine output section by input section name
* discard input sections
* order output sections accordingly
Differential Revision: http://reviews.llvm.org/D14140
llvm-svn: 252868
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MIPS target requires specific dynamic section entries to be defined.
* DT_MIPS_RLD_VERSION and DT_MIPS_FLAGS store predefined values.
* DT_MIPS_BASE_ADDRESS holds base VA.
* DT_MIPS_LOCAL_GOTNO holds the number of local GOT entries.
* DT_MIPS_SYMTABNO holds the number of .dynsym entries.
* DT_MIPS_GOTSYM holds the index of the .dynsym entry
which corresponds to the first entry of the global part of GOT.
* DT_MIPS_RLD_MAP holds the address of the reserved space in the data segment.
* DT_MIPS_PLTGOT points to the .got.plt section if it exists.
* DT_PLTGOT holds the address of the GOT section.
See "Dynamic Section" in Chapter 5 in the following document for detailed
description: ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
Differential revision: http://reviews.llvm.org/D14450
llvm-svn: 252857
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The MIPS ABI has requirements to sort the entries in the .dyn.sym section.
Symbols which are not in the GOT have to precede the symbols which are added to
the GOT. The latter must have the same order as the corresponding GOT entries.
Since these sorting requirements contradict those of the GNU hash section,
they cannot be used together.
Differential revision: http://reviews.llvm.org/D14281
llvm-svn: 252854
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for:
* Uniquing CIEs
* Dropping FDEs that point to dropped sections
It drops 657 488 bytes from the .eh_frame of a Release+Asserts clang.
The link time impact is smallish. Linking clang with a Release+Asserts
lld goes from 0.488064805 seconds to 0.504763060 seconds (1.034 X slower).
llvm-svn: 252790
|
| |
|
|
|
|
|
|
|
|
|
|
| |
GNU as can give it type SHT_PROGBITS or SHT_X86_64_UNWIND depending on
teh construct.
MC gives it type SHT_X86_64_UNWIND.
The linker has to canonicalize to one or the other so that there is only
one .eh_frame in the end.
llvm-svn: 252757
|
| |
|
|
| |
llvm-svn: 252686
|
| |
|
|
| |
llvm-svn: 252685
|
| |
|
|
| |
llvm-svn: 252684
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
leaq symbol@tlsld(%rip), %rdi
call __tls_get_addr@plt
symbol@tlsld (R_X86_64_TLSLD) instructs the linker to generate a tls_index entry (two GOT slots) in the GOT for the entire module (shared object or executable) with an offset of 0. The symbol for this GOT entry doesn't matter (as long as it's either local to the module or null), and gold doesn't put a symbol in the dynamic R_X86_64_DTPMOD64 relocation for the GOT entry.
All other platforms defined in http://www.akkadia.org/drepper/tls.pdf except for Itanium use a similar model where global and local dynamic GOT entries take up 2 contiguous GOT slots, so we can handle this in a unified manner if we don't care about Itanium.
While scanning relocations we need to identify local dynamic relocations and generate a single tls_index entry in the GOT for the module and store the address of it somewhere so we can later statically resolve the offset for R_X86_64_TLSLD relocations. We also need to generate a R_X86_64_DTPMOD64 relocation in the RelaDyn relocation section.
This implementation is a bit hacky. It side steps the issue of GotSection and RelocationSection only handling SymbolBody entries by relying on a specific relocation type. The alternative to this seemed to be completely rewriting how GotSection and RelocationSection work, or using a different hacky signaling method.
llvm-svn: 252682
|
| |
|
|
|
|
|
| |
For now, just don't follow edges leaving from it to mark other sections
live.
llvm-svn: 252493
|
| |
|
|
|
|
|
|
| |
SHF_MERGE type of sections.
Differential revision: http://reviews.llvm.org/D14451
llvm-svn: 252454
|
| |
|
|
| |
llvm-svn: 252415
|
| |
|
|
|
|
|
|
| |
This is cleaner than computing relocations as if we had done it.
While at it, keep a single Phdr variable instead of multiple fields of it.
llvm-svn: 252352
|
| |
|
|
| |
llvm-svn: 252312
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements R_MIPS_GOT16 relocation for global symbols in order to
generate some entries in GOT. Only reserved and global entries are supported
for now. For the detailed description about GOT in MIPS, see "Global Offset
Table" in Chapter 5 in the followin document:
ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
In addition, the platform specific symbol "_gp" is added, see "Global Data
Symbols" in Chapter 6 in the aforementioned document.
Differential revision: http://reviews.llvm.org/D14211
llvm-svn: 252275
|
| |
|
|
| |
llvm-svn: 252169
|
| |
|
|
|
|
|
|
| |
For x86-64 the initial executable TLS block is placed directly before the
thread specific data register so compilers can directly access it via
R_X86_64_TPOFF32. Generate the correct (negative) offset for this case.
llvm-svn: 252131
|
| |
|
|
|
|
| |
This does not support TPOFF32 relocations to local symbols as the address calculations are separate. Support for this will be a separate patch.
llvm-svn: 251998
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a case where there is inconsistency among ELF linkers:
* The spec says nothing special about empty sections.
* BFD ld removes them.
* Gold handles them like regular sections.
We were outputting them but sometimes ignoring them. This would create
odd looking outputs where a rw section could be in a ro segment for example.
The bfd way of doing things is also strange for the case where a symbol
points to the empty section.
Now we match gold and what seems to be the intention of the spec.
llvm-svn: 251988
|
| |
|
|
|
|
|
| |
This is a small complication, but produces nicer output and is a step to
handling zero size sections uniformly.
llvm-svn: 251980
|
| |
|
|
| |
llvm-svn: 251971
|
| |
|
|
|
|
| |
If the test is not for layout, it should not depend on the address for example.
llvm-svn: 251969
|
| |
|
|
|
|
|
| |
* We can determine the alignment requirement.
* We have to update the bss alignment with it.
llvm-svn: 251914
|
| |
|
|
| |
llvm-svn: 251913
|
| |
|
|
| |
llvm-svn: 251912
|
| |
|
|
| |
llvm-svn: 251911
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D14167
llvm-svn: 251872
|
| |
|
|
| |
llvm-svn: 251646
|
| |
|
|
| |
llvm-svn: 251645
|
| |
|
|
| |
llvm-svn: 251637
|
| |
|
|
| |
llvm-svn: 251541
|
| |
|
|
|
|
| |
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/2104
llvm-svn: 251539
|
| |
|
|
|
|
|
|
|
|
| |
This little patch is a final point in fix for https://llvm.org/bugs/show_bug.cgi?id=25175.
It`s make sample from issue description to work with -O0 optimization flag (with -O0 it generates R_X86_64_64 plt relocation).
Differential revision: http://reviews.llvm.org/D14153
llvm-svn: 251536
|
| |
|
|
|
|
| |
Differential revision: http://reviews.llvm.org/D14090.
llvm-svn: 251526
|
| |
|
|
| |
llvm-svn: 251523
|
| |
|
|
|
|
|
|
|
| |
GNU linkers accept both variants and at least for MIPS target gcc passes
joined variant of the '-m' option.
Differential Revision: http://reviews.llvm.org/D14133
llvm-svn: 251497
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D13838
llvm-svn: 251454
|