summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO
Commit message (Collapse)AuthorAgeFilesLines
* [lld][MachO] Recognize __thread_bss sections as zero-fill and set all theLang Hames2015-12-117-14/+39
| | | | | | | | | appropriate bits. This fixes the remaining clang regression test failures when linking clang with lld on Darwin. llvm-svn: 255390
* Verify that macho-o delta64 relocs have the same offset.Pete Cooper2015-12-102-21/+50
| | | | | | | | | | The delta64 relocation is represented as the pair ARM64_RELOC_SUBTRACTOR and ARM64_RELOC_UNSIGNED. Those should always have the same offset, so this adds a check and tests to ensure this is the case. Also updated the error printing in this case to shows both relocs when erroring on pair. llvm-svn: 255274
* [lld][MachO] Always reserve space for the empty string in the mach-o symbolLang Hames2015-12-101-1/+1
| | | | | | | | | | | | | table. The first entry in the MachO symbol table is always the empty string: make sure we reserve space for it, or we will overflow the symbol table by one byte. No test case - this manifests as an occasional memory error. In the near future I hope to set up a bot building and runnnig LLD with sanitizers - that should catch future instances of this issue. llvm-svn: 255178
* Don't bypass the GOT for delta32toGOT references.Pete Cooper2015-12-091-0/+6
| | | | | | | | | | | The gcc_except_tab was generating these references to point to the typeinfo in the data section. gcc_except_tab also had the DW_EH_PE_indirect flag set which means that at runtime we are going to dereference this entry as if it is in the GOT. Reviewed by Nick Kledzik in http://reviews.llvm.org/D15360. llvm-svn: 255085
* Fix Clang-tidy modernize-use-auto warnings, other minor fixes.Eugene Zelenko2015-11-107-82/+29
| | | | | | Differential revision: http://reviews.llvm.org/D14553 llvm-svn: 252661
* Fix Clang-tidy modernize-use-override warnings, other minor fixes.Eugene Zelenko2015-11-041-5/+4
| | | | | | Differential revision: http://reviews.llvm.org/D14310 llvm-svn: 252034
* [lld][MachO] Make sure LC_RPATH command size is a multiple of the pointer size.Lang Hames2015-10-291-2/+2
| | | | llvm-svn: 251637
* [lld][MachO] Use a std::string rather than a StringRef for the section name inLang Hames2015-10-291-1/+1
| | | | | | | | | MachODefinedCustomSectionAtom. The section names for these atoms are initialized from temporaries (e.g. segName + "/" + sectName), so we can't use StringRef here. llvm-svn: 251610
* [lld][Darwin] Add support for the -sectcreate option.Lang Hames2015-10-242-0/+109
| | | | llvm-svn: 251183
* [lld][MachO] Prune unused EH frames.Lang Hames2015-10-231-0/+51
| | | | llvm-svn: 251095
* [lld][MachO] Fix indentation.Lang Hames2015-10-201-2/+2
| | | | llvm-svn: 250863
* [lld][MachO] Fix typo in comment.Lang Hames2015-10-201-1/+1
| | | | llvm-svn: 250861
* [LLD] Fix Clang-tidy modernize-use-nullptr warnings; other minor cleanups.Rui Ueyama2015-10-022-17/+2
| | | | | | Patch from Eugene Zelenko! llvm-svn: 249111
* [lld][MachO] Fix a think-o to get the twolevel/dynamic_lookup test passing.Lang Hames2015-09-282-7/+5
| | | | llvm-svn: 248736
* [lld][MachO] Initial implementation of -flat_namespace and -undefined.Lang Hames2015-09-284-12/+111
| | | | | | | | | This is a basic initial implementation of the -flat_namespace and -undefined options for LLD-darwin. It ignores several subtlties, but the result is close enough that we can now link LLVM (but not clang) on Darwin and pass all regression tests. llvm-svn: 248732
* [LLD][MachO] Fix a FIXME: Subtract base address from atom address when buildingLang Hames2015-09-212-1/+4
| | | | | | export trie. llvm-svn: 248217
* Fix Clang-tidy misc-use-override warnings, other minor fixes.Rui Ueyama2015-09-106-44/+17
| | | | | | Patch from Eugene Zelenko! llvm-svn: 247323
* Update for llvm api change.Rafael Espindola2015-08-131-6/+5
| | | | llvm-svn: 244849
* Wdeprecated: Remove unnecessary user-defined dtor that was getting in the ↵David Blaikie2015-08-121-1/+0
| | | | | | way of the default ops (copy construction, assignment, etc) llvm-svn: 244836
* [lld] Add MachO thread-local storage support.Lang Hames2015-06-238-6/+223
| | | | | | | | This allows LLD to correctly link MachO objects that use thread-local storage. Differential Revision: http://reviews.llvm.org/D10578 llvm-svn: 240454
* [MachO] Initialize all fields of NormalizedFile.Benjamin Kramer2015-06-231-20/+14
| | | | | | | | | The ObjectFileYAML.roundTrip serializes a default-constructed NormalizedFile to YAML, triggering uninitialized memory reads. While there use in-class member initializers. llvm-svn: 240446
* Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&David Blaikie2015-06-196-30/+30
| | | | | | | | None of the implementations replace the SimpleFile with some other file, they just modify the SimpleFile in-place, so a direct reference to the file is sufficient. llvm-svn: 240167
* [lld] Allow LLD passes to return error codes.Lang Hames2015-06-196-10/+20
| | | | llvm-svn: 240147
* [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
* [LLD] Add support for the -stack_size option to Darwin ld.Lang Hames2015-05-205-4/+7
| | | | llvm-svn: 237841
* [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
* Use MemoryBufferRef instead of MemoryBuffer&. NFC.Rafael Espindola2015-04-273-9/+7
| | | | | | This just reduces the noise from another patch. llvm-svn: 235933
* Use MemoryBufferRef instead of MemoryBuffer&. NFC.Rafael Espindola2015-04-241-2/+2
| | | | | | This just reduces the noise from another patch. llvm-svn: 235776
* Simplify now that there is only one file. NFC.Rafael Espindola2015-04-241-6/+4
| | | | llvm-svn: 235747
* Return ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-241-3/+4
| | | | llvm-svn: 235744
* Return an ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-241-10/+12
| | | | llvm-svn: 235741
* Delete unnecessary generality in loadFile.Rafael Espindola2015-04-242-12/+13
| | | | | | | | | | | | | 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
* Rename ExecutableAtom.hpp to ExecutableAtom.hDavide Italiano2015-04-142-2/+2
| | | | | | This is for consistency with what's used elsewhere in lld tree. llvm-svn: 234943
* Define make_dynamic_error_code(const char *).Rui Ueyama2015-04-145-27/+26
| | | | | | | | | | | | The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
* Do s/_context/_ctx/g globally.Rui Ueyama2015-04-106-80/+72
| | | | | | | | I believe this patch eliminates all remaining uses of _context or _linkingContext variable names. Consistent naming improves readability. llvm-svn: 234645
* Rename atom_collection -> AtomVector.Rui Ueyama2015-04-081-5/+5
| | | | | | Type names should start with an uppercase letter in the LLVM coding style. llvm-svn: 234452
* Separate atom_collection type into two different types. NFC.Rui Ueyama2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | atom_collection is basically a wrapper for std::vector. The class provides begin and end member functions, so that it "hides" the other member functions provided by std::vector. However, you can still directly access _atoms member since the member is not protected. We cannot simply make the member private because we need that member when we are constructing atom vectors. This patch splits atom_collection into two types: std::vector<Atom *> and AtomRange. When we are constructing atom vectors, we use the former class. We return instances of the latter class from File objects so that callers cannot add or remove atoms from the lists. std::vector<Atom *> is automatically converted to AtomRange. llvm-svn: 234450
* Merge atom_collection_vector with atom_collection.Rui Ueyama2015-04-081-1/+1
| | | | | | | atom_collection_vector is the only derived class of atom_collection. This patch merges the two. llvm-svn: 234443
* Remove redundant virtual on member functions marked 'override'.David Blaikie2015-04-081-12/+6
| | | | llvm-svn: 234419
* MachO: Remove unused vectors from MachHeaderAliasFile. NFC.Rui Ueyama2015-04-071-6/+3
| | | | llvm-svn: 234369
* Merge MutableFile with SimpleFile.Rui Ueyama2015-04-076-25/+23
| | | | | | | | SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-062-5/+3
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* Remove a parameter for file extension from canParse.Rui Ueyama2015-04-041-11/+5
| | | | | | | | canParse took three parameters -- file magic, filename extension and memory buffer. All but YAMLReader ignored the second parameter. This patch removes the parameter. llvm-svn: 234080
* Remove Makefiles.Rui Ueyama2015-03-261-14/+0
| | | | | | | | Most developers prefer to not have them, and we agreed to remove them from LLD. http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html llvm-svn: 233313
* Rename align2 -> align.Rui Ueyama2015-03-262-8/+8
| | | | | | I believe "2" stands for log2. Just "align" would be appropriate now. llvm-svn: 233248
* Use arithmetic type to represent alignments (not in log2) everywhere.Rui Ueyama2015-03-264-28/+9
| | | | | | | This is the final step of conversion. Now log2 numbers are removed from everywhere! llvm-svn: 233246
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-269-26/+23
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
OpenPOWER on IntegriCloud