summaryrefslogtreecommitdiffstats
path: root/lld/test
Commit message (Collapse)AuthorAgeFilesLines
* [ELF2/AArch64] Add lazy relocation support for AArch64.Igor Kudrin2015-11-173-2/+211
| | | | | | Differential Revision: http://reviews.llvm.org/D14749 llvm-svn: 253352
* Make ELF2 the default.Rafael Espindola2015-11-171-1/+1
| | | | | | With this the only way to get the old elf linker is "-flavor old-elf". llvm-svn: 253318
* Rename test/elf2 to test/ELF.Rafael Espindola2015-11-17171-0/+0
| | | | llvm-svn: 253313
* Rename test/elf to test/old-elf.Rafael Espindola2015-11-17640-0/+0
| | | | llvm-svn: 253312
* Rename the gnu flavour to gnu old.Rafael Espindola2015-11-16461-687/+687
| | | | | | This is the first step in making ELF2 the default. llvm-svn: 253188
* [ELF2] - Implemented PT_GNU_STACK support, -z execstack option.George Rimar2015-11-1420-96/+220
| | | | | | | | | | 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
* [ELF2] - Implemented R_X86_64_GOTTPOFF relocationGeorge Rimar2015-11-132-0/+72
| | | | | | | | Generates single GOT entry, R_X86_64_TPOFF64 is added to RelaDyn. Differential revision: http://reviews.llvm.org/D14621 llvm-svn: 253049
* Use ld.lld2, not -flavor gnu2Rafael Espindola2015-11-132-6/+6
| | | | llvm-svn: 253044
* [ELF2] - dont merge .data.rel.ro/.data.rel.ro.local into .data section.George Rimar2015-11-131-0/+7
| | | | | | | | This sections can be protected with relro after resolving relocations by dynamic linker. Differential revision: http://reviews.llvm.org/D14567 llvm-svn: 253018
* Fix failing test on WindowsDenis Protivensky2015-11-131-5/+5
| | | | | | | Remove backslash before redirection as it causes echo to fail on Windows. llvm-svn: 253017
* [ELF2/AArch64] Add support for R_AARCH64_CALL26 and R_AARCH64_JUMP26.Igor Kudrin2015-11-133-0/+53
| | | | | | | | This patch covers only the case where no DSO is involved. Differential Revision: http://reviews.llvm.org/D14606 llvm-svn: 253007
* [elf2] Implement global dynamic tls.Michael J. Spencer2015-11-131-2/+18
| | | | llvm-svn: 252979
* ELF2: Print an error message for --relocatable.Rui Ueyama2015-11-121-0/+9
| | | | llvm-svn: 252923
* [ELF2] SECTIONS command basic supportDenis Protivensky2015-11-121-0/+119
| | | | | | | | | | * determine output section by input section name * discard input sections * order output sections accordingly Differential Revision: http://reviews.llvm.org/D14140 llvm-svn: 252868
* [ELF2] Add mandatory .dynamic section entries on MIPS.Igor Kudrin2015-11-123-5/+100
| | | | | | | | | | | | | | | | | | | | | 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
* [ELF2] Sort dynamic symbols according to the MIPS requirements.Igor Kudrin2015-11-122-0/+58
| | | | | | | | | | | | | 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
* Add support for processing .eh_frame.Rafael Espindola2015-11-118-0/+160
| | | | | | | | | | | | | 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
* Canonicalize the type of .eh_frame.Rafael Espindola2015-11-111-0/+16
| | | | | | | | | | | | 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
* [elf2] Add support for local TLS symbols.Michael J. Spencer2015-11-111-3/+1
| | | | llvm-svn: 252686
* [elf2][x86-64] Add support for DTPOFF64Michael J. Spencer2015-11-111-0/+5
| | | | llvm-svn: 252685
* [elf2][x86-64] Add support for DTPOFF32Michael J. Spencer2015-11-111-0/+8
| | | | llvm-svn: 252684
* [elf2] Add support for R_X86_64_TLSLD.Michael J. Spencer2015-11-111-0/+48
| | | | | | | | | | | | | | | 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
* Start treating .eh_frame specially.Rafael Espindola2015-11-091-0/+19
| | | | | | | For now, just don't follow edges leaving from it to mark other sections live. llvm-svn: 252493
* [ELF2] - Fixed crash for case when section sh_entsize is set to zero for ↵George Rimar2015-11-092-0/+4
| | | | | | | | SHF_MERGE type of sections. Differential revision: http://reviews.llvm.org/D14451 llvm-svn: 252454
* [ELF2/AArch64] Support R_AARCH64_LDST64_ABS_LO12_NC relocation.Davide Italiano2015-11-081-0/+13
| | | | llvm-svn: 252415
* Round up the memsize of PT_TLS.Rafael Espindola2015-11-061-0/+21
| | | | | | | | 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
* .eh_frame is not normally writable. Update the test to reflect that.Rafael Espindola2015-11-061-4/+4
| | | | llvm-svn: 252312
* [ELF2] Add GOT section for MIPS target.Igor Kudrin2015-11-062-5/+113
| | | | | | | | | | | | | | | 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
* Check the range of R_X86_64_TPOFF32.Rafael Espindola2015-11-051-0/+12
| | | | llvm-svn: 252169
* [elf2] Fix R_X86_64_TPOFF32 handling.Michael J. Spencer2015-11-051-4/+4
| | | | | | | | 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
* [elf2] Implement R_X86_64_TPOFF32.Michael J. Spencer2015-11-031-3/+61
| | | | | | 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
* Handle 0 sized sections like any other section.Rafael Espindola2015-11-0312-64/+90
| | | | | | | | | | | | | | | | | | 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
* Create .bss only when needed.Rafael Espindola2015-11-037-111/+38
| | | | | | | This is a small complication, but produces nicer output and is a step to handling zero size sections uniformly. llvm-svn: 251980
* Update for llvm change.Rafael Espindola2015-11-036-111/+47
| | | | llvm-svn: 251971
* Avoid checking for irrelevant facts.Rafael Espindola2015-11-034-15/+15
| | | | | | If the test is not for layout, it should not depend on the address for example. llvm-svn: 251969
* Two small fixes to copy relocation processing.Rafael Espindola2015-11-032-4/+20
| | | | | | | * We can determine the alignment requirement. * We have to update the bss alignment with it. llvm-svn: 251914
* Make the test a bit more strict and fix the math.Rafael Espindola2015-11-031-1/+3
| | | | llvm-svn: 251913
* Simplify. NFC.Rafael Espindola2015-11-031-2/+2
| | | | llvm-svn: 251912
* Make this input a bit more readable.Rafael Espindola2015-11-031-2/+3
| | | | llvm-svn: 251911
* [elf2] Generate PT_TLS.Michael J. Spencer2015-11-031-3/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D14167 llvm-svn: 251872
* [ELF2/AArch64] Add relocation tests to ensure we handle overflow correctly.Davide Italiano2015-10-292-0/+14
| | | | llvm-svn: 251646
* [ELF2/AArch64] Implement R_AARCH64_PREL16 and R_AARCH64_PREL32 relocations.Davide Italiano2015-10-291-5/+23
| | | | llvm-svn: 251645
* [lld][MachO] Make sure LC_RPATH command size is a multiple of the pointer size.Lang Hames2015-10-291-1/+1
| | | | llvm-svn: 251637
* Reapply r251536George Rimar2015-10-282-12/+12
| | | | llvm-svn: 251541
* Revert r251536 as it broke buildbot: ↵George Rimar2015-10-282-12/+12
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/2104 llvm-svn: 251539
* [ELF2] R_X86_64_64 plt relocation implemented.George Rimar2015-10-282-12/+12
| | | | | | | | | | 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
* [ELF2] R_X86_64_COPY relocation implementedGeorge Rimar2015-10-282-0/+66
| | | | | | Differential revision: http://reviews.llvm.org/D14090. llvm-svn: 251526
* [ELF2/AArch64] Add support for R_AARCH64_PREL64.Davide Italiano2015-10-281-0/+11
| | | | llvm-svn: 251523
* [Driver] Accept both -m <emulation> and -m<emulation>Simon Atanasyan2015-10-282-0/+4
| | | | | | | | | 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
* [elf2] Don't allocate VA space for TLS NOBITS sections.Michael J. Spencer2015-10-271-0/+93
| | | | | | Differential Revision: http://reviews.llvm.org/D13838 llvm-svn: 251454
OpenPOWER on IntegriCloud