summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Remove redundant unique_ptr moves found by -Wpessimizing-move.Benjamin Kramer2015-05-224-6/+6
| | | | llvm-svn: 238030
* [ELF] Fix shared CMake build.Benjamin Kramer2015-05-221-0/+1
| | | | llvm-svn: 238029
* [ARM] report_fatal_error for not implemented functionalityDenis Protivensky2015-05-221-5/+5
| | | | llvm-svn: 238017
* [ARM] Ability to add GOT and PLTGOT entries for same symbolDenis Protivensky2015-05-221-6/+14
| | | | | | | | | | | | | | | | | These two serve different purpose: PLTGOT entries are (usually) lazily resolved and serve as trampolines to correctly call dynamically linked functions. They often have R_*_JUMP_SLOT dynamic relocation type used. Simple GOT entries hold other things, one of them may be R_*_GLOB_DAT to correctly reference global and static data. This is also used to hold dynamically linked function's address. To properly handle cases when shared object's function is called and at the same time its address is taken, we need to be able to have both GOT and PLTGOT entries bearing different dynamic relocation types for the same symbol. llvm-svn: 238015
* [ARM] Implement R_ARM_GLOB_DAT for GOT entriesDenis Protivensky2015-05-223-2/+10
| | | | | | | | This is used when referencing global or static data in shared objects. This is also used when function's address is taken and function call is made indirectly. llvm-svn: 238014
* [lld] Make the MachO -stack_size default '0', add a test case.Lang Hames2015-05-222-2/+2
| | | | | | Addresses some review comments for r237841. llvm-svn: 237979
* [ELF] Simplify dynamic table entry creation.Davide Italiano2015-05-214-99/+45
| | | | | | | Differential Revision: http://reviews.llvm.org/D9921 Reviewed by: atanasyan llvm-svn: 237973
* [ARM] Add dynamic symbols to the dynamic library writerDenis Protivensky2015-05-211-1/+8
| | | | llvm-svn: 237898
* [ARM] Remove useless file with writer's instantiation stubDenis Protivensky2015-05-212-19/+0
| | | | llvm-svn: 237896
* [ARM] Remove unused field in executable writerDenis Protivensky2015-05-211-2/+1
| | | | llvm-svn: 237892
* [ARM] Move out common Writer functionality to ARMELFWriterDenis Protivensky2015-05-216-83/+149
| | | | llvm-svn: 237891
* [ELF] Move start/end atom method assignment to OutputELFWriter. NFCDenis Protivensky2015-05-213-25/+28
| | | | llvm-svn: 237886
* [ARM] Remove unused fields in dynamic library writerDenis Protivensky2015-05-211-5/+1
| | | | llvm-svn: 237883
* [ARM] Add skeleton implementation of DSO linkingDenis Protivensky2015-05-213-0/+49
| | | | llvm-svn: 237881
* [LLD] Add support for the -stack_size option to Darwin ld.Lang Hames2015-05-207-5/+29
| | | | llvm-svn: 237841
* [ARM] Add needed symbols during dynamic executable linkingDenis Protivensky2015-05-201-0/+15
| | | | | | These include _GLOBAL_OFFSET_TABLE_ and _DYNAMIC. llvm-svn: 237791
* [LLD] Make sure MachO FDEs read their augmentation data strings from the rightLang Hames2015-05-161-18/+28
| | | | | | CIE, not just the most recently encountered one. llvm-svn: 237491
* [LLD] Properly relocate the LSDA field of MachO eh-frames.Lang Hames2015-05-131-40/+153
| | | | | | | Previously the LSDA field was not being relocated during linking, leading to failures for some EH tests. llvm-svn: 237222
* [LLD] Add support for MachO ripRel32MinusNAnon relocations.Lang Hames2015-05-131-2/+48
| | | | llvm-svn: 237219
* [LLD] Add a mutex to prevent concurrent modification of the dylib maps inLang Hames2015-05-131-0/+1
| | | | | | MachOLinkingContext. llvm-svn: 237217
* [ARM] Use the correct variable name and unbreak buildbot.Davide Italiano2015-05-081-1/+1
| | | | llvm-svn: 236880
* [ARM] Generation of .ARM.exidx/.ARM.extab sectionsLeny Kholodov2015-05-087-21/+123
| | | | | | | | | | | | This patch provides generation of .ARM.exidx & .ARM.extab sections which are used for unwinding. The patch adds new content type typeARMExidx for atoms from .ARM.exidx section and integration of atoms with such type to the ELF ReaderWriter. exidx.test has been added with checking of contents of .ARM.exidx section and .ARM.extab section. Differential Revision: http://reviews.llvm.org/D9324 llvm-svn: 236873
* [ARM] Check overflow of R_ARM_THM_JUMP11Denis Protivensky2015-05-081-1/+4
| | | | llvm-svn: 236842
* [ARM] Check overflow of R_ARM_CALL/JUMP24Denis Protivensky2015-05-081-0/+6
| | | | llvm-svn: 236841
* [ARM] Check overflow of R_ARM_THM_CALL/JUMP24Denis Protivensky2015-05-081-0/+4
| | | | llvm-svn: 236839
* [ARM] Check overflow of R_ARM_PREL31Denis Protivensky2015-05-071-1/+4
| | | | llvm-svn: 236729
* [ARM] llvm_unreachable => make_dynamic_error in R_ARM_BASE_PRELDenis Protivensky2015-05-071-1/+2
| | | | llvm-svn: 236727
* [ARM] llvm_unreachable => make_*_reloc_error in group relocsDenis Protivensky2015-05-071-9/+8
| | | | llvm-svn: 236726
* [ARM] Return directly from switch in relocation handlerDenis Protivensky2015-05-071-47/+28
| | | | llvm-svn: 236724
* [ARM] Add return codes to relocation handlersDenis Protivensky2015-05-071-76/+95
| | | | llvm-svn: 236723
* Revert unrelated chunk committed by accident in r236334.Davide Italiano2015-05-011-1/+1
| | | | | | | The change is likely to be correct, but unrelated to the aforementioned commit and needs a test to gets shipped. Sorry. llvm-svn: 236336
* [ELF] Fix test for .init_array.Davide Italiano2015-05-011-1/+1
| | | | | | | | Change the test so that it tests the right functionality. Also put a description with the code from which the test was generated. Reported by Simon Atanasysan. llvm-svn: 236334
* [ELF] Mark linker defined symbols as .hidden when needed.Davide Italiano2015-05-013-9/+12
| | | | | | | | | | I noticed that gold mark these as hidden. While at it I rewrote the test for this feature to use yaml rather than an object file as input. Differential Revision: http://reviews.llvm.org/D9418 Reviewed by: ruiu llvm-svn: 236291
* [GNU] Remove -x/-X from the list of options to be implemented.Davide Italiano2015-04-291-2/+0
| | | | llvm-svn: 236149
* Use MemoryBufferRef instead of MemoryBuffer&. NFC.Rafael Espindola2015-04-279-15/+13
| | | | | | This just reduces the noise from another patch. llvm-svn: 235933
* ELF: Simplify LinkerScript detection. NFC.Rui Ueyama2015-04-271-19/+3
| | | | llvm-svn: 235895
* Add missing snippets from r235880Adhemerval Zanella2015-04-271-0/+3
| | | | llvm-svn: 235890
* ELF/ARM: Ignore R_ARM_V4BX for ARMv4 but allow linkingAdhemerval Zanella2015-04-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allow the ARM relocation R_ARM_V4BX to be processed by lld, although it is not really handled in the static relocation code. The relocation is in the form: Relocation section '.rel.text' at offset 0x428 contains 4 entries: Offset Info Type Sym.Value Sym. Name 00000014 00000028 R_ARM_V4BX Meaning it does have a direct target, but rather references to an absolute section *ABS* (in this exemple to the .text segment itself). It makes the target Atom after file parse to not have a associated pointer and thus generating a derrefence NULL point in ELFFile<ELFT>::findAtom. Current approach is just ignore and return nullptr in such cases. The problem relies that default GCC configuration for arm-linux-gnueabi{hf} emits the relocation for the asm: -- .syntax unified .arm .p2align 2 .type fn, %function fn: ldr r3, .LGOT ldr r2, .LGOT+4 .LPIC: add r3, pc, r3 ldr r2, [r3, r2] cmp r2, #0 bxeq lr b __start__ .LGOT: .word _GLOBAL_OFFSET_TABLE_-(.LPIC+8) .word __start__(GOT) -- But only with the option -march=armv4 (which is the default GCC configuration). For arm5 and forward the relocation is not created. This a special relocation (defined miscellaneous for ARM) that instruct the linker to replace the bx instruction into a mov. GNU linker has some options related to which substitution it can create for such cases. With this patch I can dynamically link an application against a GLIBC arm-linux-gnueabi system configured with default GCC. llvm-svn: 235880
* Use MemoryBufferRef instead of MemoryBuffer&. NFC.Rafael Espindola2015-04-247-8/+8
| | | | | | This just reduces the noise from another patch. llvm-svn: 235776
* Simplify parseMemberFiles to take a single file.Rafael Espindola2015-04-242-13/+12
| | | | llvm-svn: 235751
* Simplify now that there is only one file. NFC.Rafael Espindola2015-04-243-20/+15
| | | | llvm-svn: 235747
* Return ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-245-21/+19
| | | | llvm-svn: 235744
* Remove unused enum value. NFC.Rafael Espindola2015-04-241-2/+0
| | | | llvm-svn: 235742
* Return an ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-247-36/+40
| | | | llvm-svn: 235741
* Delete unnecessary generality in loadFile.Rafael Espindola2015-04-2410-51/+55
| | | | | | | | | | | | | loadFile could load mulitple files just because yaml has a feature for putting multiple documents in one file. Designing a linker around what yaml can do seems like a bad idea to me. This patch changes it to read a single file. There are further improvements to be done to the api and they will follow shortly. llvm-svn: 235724
* [Mips] Simplify the code a bit using early returnSimon Atanasyan2015-04-241-14/+6
| | | | | | No functional changes. llvm-svn: 235708
* [ARM] Update TODO notesDenis Protivensky2015-04-241-6/+7
| | | | llvm-svn: 235706
* [ARM] Implement R_ARM_COPY relocationDenis Protivensky2015-04-242-2/+41
| | | | | | This adds support of copying objects from shared libraries. llvm-svn: 235705
* [ARM] Update R_ARM_TARGET1 command line option names (remove prefix 'arm-')Leny Kholodov2015-04-222-13/+18
| | | | | | | | | | | Command line options --arm-target1-rel and --arm-target1-abs have been renamed to be compatible with GNU linkers. Two tests have been updated: test/elf/options/target-specific-args.test test/elf/ARM/rel-arm-target1.test Differential Revision: http://reviews.llvm.org/D9037 llvm-svn: 235499
* [ARM] Replace branches to undefined weak functions with NOPLeny Kholodov2015-04-221-0/+39
| | | | | | | | | According to the code model (ARM, Thumb, Thumb2) this patch updates the b/bl/blx 0 instructions with NOP. test/elf/ARM/weak-branch.test has been added with tests for all available NOP (A1, T1, T2 encodings). Differential Revision: http://reviews.llvm.org/D8807 llvm-svn: 235498
OpenPOWER on IntegriCloud