summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [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-205-4/+7
| | | | 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-086-21/+122
| | | | | | | | | | | | 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
* Use MemoryBufferRef instead of MemoryBuffer&. NFC.Rafael Espindola2015-04-279-15/+13
| | | | | | This just reduces the noise from another patch. llvm-svn: 235933
* 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-246-7/+7
| | | | | | This just reduces the noise from another patch. llvm-svn: 235776
* Simplify now that there is only one file. NFC.Rafael Espindola2015-04-242-10/+5
| | | | llvm-svn: 235747
* Return ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-242-6/+8
| | | | llvm-svn: 235744
* Return an ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-246-35/+36
| | | | llvm-svn: 235741
* Delete unnecessary generality in loadFile.Rafael Espindola2015-04-247-44/+44
| | | | | | | | | | | | | 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] 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
* [Mips] Assign .MIPS.options section to the PT_LOAD segmentSimon Atanasyan2015-04-222-2/+7
| | | | llvm-svn: 235488
* [ELF] Allow TargetLayout descendants to control assignment sections to segmentsSimon Atanasyan2015-04-223-10/+23
| | | | | | | | | | | | | | | | The TargetLayout class puts two sections into the same segment if they have equal segment types and the same section flags (SHF_xxx). To be able to merge some sort of sections into the same segment we drop some flags before comparison. For example to merge string sections into Data segment we drop SHF_STRINGS and SHF_MERGE flags. The patch allows TargetLayout descendants to drop some target specific section flags. MIPS target needs that to merge .MIPS.options section which has SHF_MIPS_NOSTRIP flag into the LOAD segment. http://reviews.llvm.org/D9160 llvm-svn: 235487
* [ARM] Implement veneers for dynamic executable linkingDenis Protivensky2015-04-221-2/+8
| | | | llvm-svn: 235486
* [ARM] Move veneer generators to base class. NFCDenis Protivensky2015-04-221-38/+52
| | | | llvm-svn: 235485
* [ARM] Rename static veneer atoms to absolute code veneer atomsDenis Protivensky2015-04-221-28/+28
| | | | | | No functional changes. llvm-svn: 235484
* [ELF] Change return type of the OutputSection::flags() methodSimon Atanasyan2015-04-212-2/+2
| | | | | | | This method returns _flags field which has `uint64_t` type. Now the field's type and the method's return type are consistent. llvm-svn: 235393
* [ELF] Narrow down the type of OutputSection::_sections containerSimon Atanasyan2015-04-213-92/+88
| | | | | | | | | | The `OutputSection::appendSection()` method always gets a pointer to the `Section` class descendants. So it is not necessary to keep them in the vector of `Chunk` pointers. No functional changes. llvm-svn: 235392
* [Mips] Write .reginfo section into the separate PT_MIPS_REGINFO segmentSimon Atanasyan2015-04-213-2/+20
| | | | llvm-svn: 235391
* [ELF] Simplify class memeber function declarationSimon Atanasyan2015-04-211-2/+1
| | | | | | No functional changes. llvm-svn: 235390
* --discard-locals should be --discard-all here.Davide Italiano2015-04-201-1/+1
| | | | | | Sorry for the mistake/confusion. llvm-svn: 235359
* [GNU/ELF] Add support for -X/--discard-locals.Davide Italiano2015-04-201-0/+5
| | | | | | | | | | | There's (almost) never need to keep .L symbols around for production builds. In fact, the FreeBSD kernel explicitly specify -X beacuse the size impact (and the subsequent performance impact) might be significant, because we keep symbols in memory. I was tempted to make this the default, but I haven't (yet). PR: 23232 llvm-svn: 235357
OpenPOWER on IntegriCloud