summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [mach-o] parse multiple symbols on same address into aliasesNick Kledzik2014-06-091-2/+11
| | | | llvm-svn: 210502
* Remove dead parameter.Rui Ueyama2014-06-091-3/+3
| | | | llvm-svn: 210461
* [Mips] Handle Mips TLS relocations R_MIPS_TLS_GOTTPREL / R_MIPS_TLS_GD / ↵Simon Atanasyan2014-06-077-27/+168
| | | | | | R_MIPS_TLS_LDM etc. llvm-svn: 210394
* Revert "[PECOFF] Support COMDAT associative sections."Rui Ueyama2014-06-053-48/+11
| | | | | | This reverts accidental commit r210240. llvm-svn: 210243
* [PECOFF] Support COMDAT associative sections.Rui Ueyama2014-06-053-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | COFF supports a feature similar to ELF's section groups. This patch implements it. In ELF, section groups are identified by their names, and they are treated somewhat differently from regular symbols. In COFF, the feature is realized in a more straightforward way. A section can have an annotation saying "if Nth section is linked, link this section too." Implementing such feature is easy. We can add a reference from a target atom to an original atom, so that if the target is linked, the original atom is also linked. If not linked, both will be dead-stripped. So they are treated as a group. I added a new reference type, kindAssociate. It does nothing except preventing referenced atoms from being dead-stripped. No change to the Resolver is needed. Reviewers: Bigcheese, shankarke, atanasyan Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3946 llvm-svn: 210240
* Initial set of MakefilesIain Sandoe2014-06-0411-0/+169
| | | | | | | | This provides support for the autoconfing & make build style. The format, style and implementation follows that used within the llvm and clang projects. TODO: implement out-of-source documentation builds. llvm-svn: 210177
* Fix a wrong comment.Rui Ueyama2014-06-041-31/+28
| | | | | | | | | | | Previously FileArchive ctor comment said that only its subclasses can be instantiated, but the ctor is actually public and is instantiated by ArchiveReader. Remove the wrong comment and reorder the member functions so that public members appear before private ones. llvm-svn: 210175
* Add a comment, fix style.Rui Ueyama2014-06-041-7/+6
| | | | llvm-svn: 210174
* Fix format.Rui Ueyama2014-06-041-10/+3
| | | | llvm-svn: 210172
* [mach-o] Make anonymous atom out of section content before any symbolNick Kledzik2014-06-041-16/+20
| | | | | | | | In sections that are broken into atoms at symbols, if the first symbol in the section is not at the start of the section, then make an anonymous atom for the section content that is before the first symbol. llvm-svn: 210142
* [mach-o] Refactor sections -> atoms to be table driven.Nick Kledzik2014-06-031-373/+312
| | | | | | | | | | | | Previously each section kind had its own code to loop over the section and parse it into atoms. This refactoring has two tables. The first maps sections to ContentType. The second maps ContentType to information on how to find the atom boundaries. A few bugs in test cases were discovered as part of the refactoring. No change in functionality intended. llvm-svn: 210138
* Improve error message.Rui Ueyama2014-06-031-3/+3
| | | | | | | Previously the parser always printed out an error message followed by "Invalid file type" even if the file type is correct. llvm-svn: 210093
* This lambda returns a boolean, update the return statements.Rafael Espindola2014-06-031-7/+7
| | | | llvm-svn: 210071
* Remove group-parent references.Rui Ueyama2014-06-032-58/+13
| | | | | | | | | | | | | | | | | | | Previously section groups are doubly linked to their children. That is, an atom representing a group has group-child references to its group contents, and content atoms also have group-parent references to the group atom. That relationship was invariant; if X has a group-child edge to Y, Y must have a group-parent edge to X. However we were not using group-parent references at all. The resolver only needs group-child edges. This patch simplifies the section group by removing the unused reverse edge. No functionality change intended. Differential Revision: http://reviews.llvm.org/D3945 llvm-svn: 210066
* Run clang-format.Rui Ueyama2014-06-021-62/+61
| | | | llvm-svn: 210015
* s/vector/std::vector/Rui Ueyama2014-06-021-22/+21
| | | | llvm-svn: 210014
* [Mips] Implement .{ctors,dtors}.<priority> sections ordering.Simon Atanasyan2014-06-015-0/+119
| | | | | | | | | | | | | Arrange .ctors/.dtors sections in the following order: .ctors from crtbegin.o or crtbegin?.o .ctors from regular object files .ctors.* (sorted) from regular object files .ctors from crtend.o or crtend?.o This order is specific for MIPS traget. For example, on X86 the .ctors.* sections are merged into the .init_array section. llvm-svn: 209987
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-3129-95/+95
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [mach-o] Add support for custom sectionsNick Kledzik2014-05-304-12/+111
| | | | llvm-svn: 209928
* [ELF] Fix incorrect sorting of .init_array / .fini_array sections.Simon Atanasyan2014-05-301-15/+29
| | | | | | | | | | | | | | | | | | | | | | The main problem is in the predicate passed to the `std::stable_sort()`. This predicate always returns false if **both** section's names do not start with `.init_array` or `.fini_array` prefixes. In short, it does not define a strict weak orderng. Suppose we have the following sections: .A .init_array.1 .init_array.2 The predicate states that: not .init_array.1 < .A not .A < .init_array.2 but .init_array.1 < .init_array.2 !!! The second problem is that `.init_array` section without number should go last in the list. Not it has the lowest priority '0' and goes first. The patch fixes both of the problems. llvm-svn: 209875
* [mach-o] Wire up mach-o binary reader to reader registryNick Kledzik2014-05-301-0/+48
| | | | llvm-svn: 209868
* [mach-0] Add support for parsing compact unwind info sectionNick Kledzik2014-05-292-0/+28
| | | | llvm-svn: 209865
* [mach-o] Add support for parsing __eh_frame section. Generalize support for ↵Nick Kledzik2014-05-292-21/+107
| | | | | | whether symbols in a section are ignored or illegal llvm-svn: 209858
* [mach-o] Add support for parsing CFString sectionsNick Kledzik2014-05-292-25/+67
| | | | llvm-svn: 209844
* [Mips] Do not mix _gp and _gp_disp symbols in relocation handling.Simon Atanasyan2014-05-282-14/+22
| | | | | | No functional changes. llvm-svn: 209709
* [mach-o] Add support for parsing of weak-def symbolsNick Kledzik2014-05-281-2/+4
| | | | llvm-svn: 209707
* [mach-o] Support parsing of non-lazy-pointer sectionsNick Kledzik2014-05-284-19/+97
| | | | llvm-svn: 209704
* [mach-o] Add support for initializers and terminators in object filesNick Kledzik2014-05-273-2/+52
| | | | llvm-svn: 209700
* [mach-o] Add checks that string literals in object files are zero terminatedNick Kledzik2014-05-271-0/+15
| | | | llvm-svn: 209685
* [mach-o] Add support for reading utf16 string literal sectionsNick Kledzik2014-05-272-0/+20
| | | | llvm-svn: 209684
* Add make_dynamic_error_code().Nick Kledzik2014-05-271-3/+16
| | | | | | | | | | | This is a short-term fix to allow lld Readers to return error messages with dynamic content. The long term fix will be to enhance ErrorOr<> to work with errors other than error_code. Or to change the interface to Readers to pass down a diagnostics object through which all error messages are written. llvm-svn: 209681
* [Mips] Handle relocations against __gnu_local_gp symbol.Simon Atanasyan2014-05-271-0/+2
| | | | llvm-svn: 209644
* [Mips] Do not count global GOT entries using the separate variable. UseSimon Atanasyan2014-05-261-10/+4
| | | | | | size of global GOT entries map for that. llvm-svn: 209616
* [Mips] Reduce code duplication. Join relocation handling functions whichSimon Atanasyan2014-05-251-15/+6
| | | | | | perform calculations for R_MIPS_GOT16 and R_MIPS_CALL16 relocations. llvm-svn: 209594
* [Mips] Factor out the code assign a value to the absolute atom into theSimon Atanasyan2014-05-251-11/+9
| | | | | | separate function. llvm-svn: 209593
* [Mips] Factor out the code create Mips specific runtime file intoSimon Atanasyan2014-05-253-28/+13
| | | | | | the MipsELFWriters member function. llvm-svn: 209592
* [Mips] Remove unused class member declaration.Simon Atanasyan2014-05-251-3/+0
| | | | llvm-svn: 209591
* [Mips] Reduce code duplication. Join relocation handling functions whichSimon Atanasyan2014-05-251-18/+8
| | | | | | perform similar calculations. llvm-svn: 209590
* [Mips] Handle R_MIPS_TLS_TPREL_HI16 / R_MIPS_TLS_TPREL_LO16 relocations.Simon Atanasyan2014-05-244-20/+64
| | | | llvm-svn: 209582
* Use short identifier.Rui Ueyama2014-05-231-7/+7
| | | | llvm-svn: 209497
* [PECOFF] Make a separate pass for /alternatename symbols.Rui Ueyama2014-05-231-27/+44
| | | | | | | | | | | | | | | | | | | | | | | /alternatename is a command line option to define a weak alias. You can use it as /alternatename:foo=bar to define "foo" as a weak alias for "bar". Because it's a command line option, the weak alias mapping is in the LinkingContext object, and not in a object file being read. Previously, we looked up the mapping each time we read a new symbol from a file, to check if there is a weak alias defined for the symbol. That's not wrong, but had made function signature's a bit complicated -- we had to pass the mapping object to many functions. Now their parameter lists are much cleaner. This also has another (unrealized) benefit. parseFile() now read a file and then add alias symbols to the file. In the first pass a LinkingContext object is not used at all. That should make it easy to read files from archive files speculatively, as the first pass is free from side effect. llvm-svn: 209486
* Move alias symbols from ELFLinkingContext to LinkingContext.Rui Ueyama2014-05-221-75/+0
| | | | | | | | | | Alias symbols are SimpleDefinedAtoms and are platform neutral. They don't have to belong ELF. This patch is to make it available to all platforms. No functionality change intended. Differential Revision: http://reviews.llvm.org/D3862 llvm-svn: 209475
* [mach-o] Fix so that mach-o semantic errors return an error rather than assertNick Kledzik2014-05-222-8/+15
| | | | llvm-svn: 209469
* [mach-o] parse literal sections into atomsNick Kledzik2014-05-222-3/+69
| | | | llvm-svn: 209379
* [PECOFF] Fix unsafe memory access.Rui Ueyama2014-05-211-3/+5
| | | | llvm-svn: 209323
* [PECOFF] Check for a Characteristics field of a .debug section.Rui Ueyama2014-05-211-1/+3
| | | | llvm-svn: 209317
* [Mips] Simplify handling of R_MIPS_LO16 / R_MIPS_HI16 relocationsSimon Atanasyan2014-05-211-8/+8
| | | | | | against _gp_disp symbol. llvm-svn: 209315
* [PECOFF] Discard .debug sections.Rui Ueyama2014-05-211-0/+7
| | | | llvm-svn: 209274
* [PECOFF] Make COFFObjectReader thread-safe.Rui Ueyama2014-05-211-0/+3
| | | | llvm-svn: 209271
* [PECOFF] Acquire mutex before accessing shared objects.Rui Ueyama2014-05-201-0/+1
| | | | | | | | | | | addResolvableSymbols() queues input files, and readAllSymbols() reads from them. In practice it's currently safe because they are called from a single thread. But it's not guaranteed. Also, acquiring the same mutex is needed not to see inconsistent memory contents that is allowed in the C++ memory model. llvm-svn: 209254
OpenPOWER on IntegriCloud