summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Un-break undef-from-main-dso.test on MSVC 2012.Rui Ueyama2013-11-101-2/+2
| | | | | | | | | | | | | | | | The result of sizeof(SymbolTable<ELFT>::SymbolEntry) in DynamicSymbolTable <ELFT>::write() was different from the same expression in RelocationTable <ELFT>::write(), although the same template parameters were passed. They were 40 and 32, respectively. As a result, the same vector was treated as a vector of 40 byte values in some places and a vector of 32 values in other places. That caused an weird issue, resulting in collapse of the rela.dyn section. I suspect that this is a padding size calculation bug in MSVC 2012, but I may be wrong. Reordering the fields to eliminate padding seems to fix the issue. llvm-svn: 194349
* Remove empty namespace.Rui Ueyama2013-11-091-2/+0
| | | | llvm-svn: 194322
* [mach-o] Use LEB128 stuff from llvm/Support. No functionality change.Nick Kledzik2013-11-091-67/+29
| | | | llvm-svn: 194305
* [mach-o] reduce duplicate source code by using a templated method. No ↵Nick Kledzik2013-11-091-113/+43
| | | | | | functionality change. llvm-svn: 194299
* [mach-o] fix uninitialized variableNick Kledzik2013-11-081-0/+1
| | | | llvm-svn: 194290
* Add explictly exported atoms and export R_*_COPY'ed atoms.Michael J. Spencer2013-11-086-2/+30
| | | | llvm-svn: 194278
* Hopefully fix latent bug where lldCore dependency on lldYAML was not in ↵Nick Kledzik2013-11-061-1/+4
| | | | | | CMake files llvm-svn: 194177
* [mach-o] add llvm_unreachableNick Kledzik2013-11-061-0/+1
| | | | llvm-svn: 194172
* [mach-o] fix DEBUG_WITH_TYPE to compile without warnings in non-debug caseNick Kledzik2013-11-061-17/+15
| | | | llvm-svn: 194171
* [mach-o] binary reader and writer Nick Kledzik2013-11-068-1547/+2620
| | | | | | | | | | This patch adds support for converting normalized mach-o to and from binary mach-o. It also changes WriterMachO (which previously directly wrote a mach-o binary given a set of Atoms) to instead do it in two steps. The first step uses normalizedFromAtoms() to convert Atoms to normalized mach-o, and the second step uses writeBinary() which to generate the mach-o binary file. llvm-svn: 194167
* rename local variable to avoid shadowing warningNick Kledzik2013-11-061-4/+4
| | | | llvm-svn: 194166
* [PECOFF] Rename getSectionAlignment -> getSectionDefaultAlignment.Rui Ueyama2013-11-063-4/+4
| | | | | | | | These fields are for /align option. Section alignment can be set per-section basis with /section option too. In order to avoid name conflicts, rename the existing identifiers to become more specific. No functionality change. llvm-svn: 194160
* [PECOFF] Add /section option.Rui Ueyama2013-11-062-0/+71
| | | | | | | | | | | /section command line option is to set/reset attributes of the Characteristics field in the section header. You can set non-default values with this option. You can make .data section executable with this, for example. This patch implements the parser of the command line option. The code to use the parsed values will be committed in a separate patch. llvm-svn: 194133
* [PECOFF] Make /disallowlib an alias for /nodefaultlib.Rui Ueyama2013-11-061-1/+1
| | | | | | | I'm not sure if it is really an alias for /nodefaultlib, but I can say that they are at least similar. Making it an alias would be better than ignoring it. llvm-svn: 194131
* [PECOFF] Do not expose _noDefaultLibs. No functionality change.Rui Ueyama2013-11-061-2/+1
| | | | llvm-svn: 194130
* [PECOFF] Do not add the same library to the input graph more than once.Rui Ueyama2013-11-061-7/+11
| | | | | | | | /defaultlib options can be specified implicitly via the .drectve section, and it's pretty common that multiple object files add the same library, such as user32.lib, to the input. We shouldn't add the same library multiple times. llvm-svn: 194129
* Undef a local macro after use.Rui Ueyama2013-11-061-8/+7
| | | | llvm-svn: 194128
* [PECOFF] Do not wrap the linker internal file with an archive file.Rui Ueyama2013-11-061-61/+2
| | | | | | | | | | | | | | | | | | We wrapped the linker internal file with a virtual archive file, so that the linker internal file was linked only when it's actually used. This was to avoid __ImageBase being included to the resulting executable. __ImageBase used to occupy four bytes when emitted to executable. And then it turned out that the implementation of __ImageBase was wrong -- it shouldn't have been a regular atom but an absolute atom. Absolute atoms point to some memory location, but they don't occupy disk space themselves. So it wouldn't increase executable size (except the symbol table.) That means that it's OK to link the linker internal file unconditionally. So this patch does that, removing the wrapper archive file. Doing this simplifies the code. llvm-svn: 194127
* [PECOFF] Ignore /disallowlib.Rui Ueyama2013-11-061-0/+1
| | | | | | | | msvcrt.lib contains "/disallowlib" command line option in its .drectve section. I couldn't spot any documentation for the option. Ignore it for now so that we can link the library without error. llvm-svn: 194114
* [PECOFF] Report error if there's unknown flag in .drectveRui Ueyama2013-11-052-7/+8
| | | | | | Errors in .drectve section were silently ignored. This patch fixes the issue. llvm-svn: 194110
* Remove extraneous parentheses.Rui Ueyama2013-11-051-5/+3
| | | | llvm-svn: 194089
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-0522-68/+68
| | | | llvm-svn: 194037
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-0514-34/+34
| | | | | | It was never transporting any value in addition to the error_code. llvm-svn: 194028
* [ELF] Fix typo in the expression calculates an absolute atom offset.Simon Atanasyan2013-11-041-1/+1
| | | | | | Patch reviewed by Shankar Easwaran. llvm-svn: 194010
* [ELF] Simplify SectionTable::getSymbolTableIndex. No functionality change.Rui Ueyama2013-11-041-7/+4
| | | | | | | MSVC 2012 raises an error in the lambda passed to vector::find_if, while it seems valid code. Rewrote without high-order functions. llvm-svn: 193975
* [MachO] Fix uninitialized field bug found on Windows.Rui Ueyama2013-11-021-0/+2
| | | | | | | | | | n_desc field in MachO string table was not initialized. On Unix, test/darwin/hello-world.objtxt did not fail because I think an nlist object is always allocated to a fresh heap initialized with zeros. On Windows, uninitialized fields are filled with 0xCC when compiled with /GZ. Because of that the test was failing on Windows. llvm-svn: 193909
* [PECOFF] Remove unnecessary assertion.Rui Ueyama2013-11-011-14/+0
| | | | | | | | Bugs that would be caught by this assertion would also be caught by RoundTripYAMLPass test. We've enabled the pass for PECOFF, so we can remove this. llvm-svn: 193886
* Remove duplicate calls of pm.add() for RoundTrip tests.Rui Ueyama2013-11-015-20/+2
| | | | llvm-svn: 193885
* Remove redundant std::move().Rui Ueyama2013-11-016-11/+11
| | | | llvm-svn: 193883
* WhitespaceRui Ueyama2013-11-011-1/+1
| | | | llvm-svn: 193882
* [PECOFF] Enable RoundTrip{YAML,Native}Pass.Rui Ueyama2013-11-011-3/+9
| | | | llvm-svn: 193881
* [PECOFF] Change data directory atom structure.Rui Ueyama2013-11-013-44/+48
| | | | | | | | | | | | The data directory in the PE/COFF header consisted of list of data directory atoms. This patch changes it -- now there's only one data directory entry that contains former data directories. That's easier to handle in the writer as well as to write to/read from YAML/Native files. The main purpose of this refactoring is to enable RoundTrip tests for PE/COFF. There's no functionality change. llvm-svn: 193854
* [PECOFF] File extension is case-insensitive on Windows.Rui Ueyama2013-10-311-2/+2
| | | | llvm-svn: 193797
* Revert "[PECOFF] Add atoms to the PassManager file"Rui Ueyama2013-10-312-11/+17
| | | | | | | | | | | | | | | This reverts commit r193479. The atoms are already added to the file, so re-adding them caused the YAML writer to write the same atoms twice. That made the YAML reader to fail with "duplicate atom name" error. This is not the only error we've got for RoundTripYAMLPass for PECOFF, so we cannot enable the test yet. More fixes will come. Differential Revision: http://llvm-reviews.chandlerc.com/D2069 llvm-svn: 193762
* Use StringRef::startswith_lower().Rui Ueyama2013-10-301-17/+9
| | | | llvm-svn: 193712
* [ELF] Implement minimal support for .eh_frame_hdr.Michael J. Spencer2013-10-303-1/+60
| | | | llvm-svn: 193662
* [PECOFF] Suppress startup message of background processes.Rui Ueyama2013-10-292-0/+2
| | | | llvm-svn: 193646
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-2924-53/+172
| | | | | | | | | | | | | Enable this for the following flavors a) core b) gnu c) darwin Its disabled for the flavor PECOFF. Convenient markers are added with FIXME comments in the Driver that would be removed and code removed from each flavor. llvm-svn: 193585
* [PECOFF] Fix __ImageBase symbol.Rui Ueyama2013-10-291-36/+12
| | | | | | | | | __ImageBase is an absolute symbol whose address is the same as the image base address. What we did before this patch was to create __ImageBase symbol as a symbol whose *contents* (not location) is the image base address, which is clearly wrong. llvm-svn: 193565
* [PECOFF] Set section name for BSS atoms.Rui Ueyama2013-10-281-1/+1
| | | | | | | This change has no effect now, but will be needed to emit BSS atoms to .bss section. llvm-svn: 193556
* [MachO] pointer align linker generated (non)lazy pointersNick Kledzik2013-10-282-1/+16
| | | | llvm-svn: 193551
* Rather than rendering an argument to a std::string (which is primarilyChandler Carruth2013-10-271-1/+1
| | | | | | | | | | | | | | intended for debugging and diagnostic output), just inspect the spelling to check for specific prefixes in drectve section flags. In addition to being significantly cheaper and not relying on a debugging interface, this also avoids creating a temporary string and binding it to StringRef variable. We then went on to access it after the memory had been deallocated. This bug too was caught by ASan. I love ASan so much. =] llvm-svn: 193487
* [ELF] Fix RO/RW note sections.Shankar Easwaran2013-10-261-2/+2
| | | | llvm-svn: 193482
* [X86_64] Fix the atom that need to be exported.Shankar Easwaran2013-10-261-1/+2
| | | | llvm-svn: 193481
* [X86] Add more relocation types.Shankar Easwaran2013-10-261-3/+6
| | | | llvm-svn: 193480
* [PECOFF] Add atoms to the PassManager fileShankar Easwaran2013-10-261-1/+13
| | | | llvm-svn: 193479
* [PECOFF] Add COFF relocations to encode/decode to/from YAML filesShankar Easwaran2013-10-261-1/+23
| | | | llvm-svn: 193478
* [PECOFF] Add dataDirectoryEntry as a recognized ContentTypeShankar Easwaran2013-10-261-0/+2
| | | | llvm-svn: 193477
* [Darwin] Fix Reference to nullptr.Shankar Easwaran2013-10-262-64/+64
| | | | | | | | | | | | | | | | | | On discussing this with Nick, it looks like the StubAtoms that contain a lazyImmediate reference kind should be null and the location needs to be fixed up later with some value that is an offset into the __LINKEDIT segment. The drawback is that it allows yaml files with references that expect a target to be considered without one. This results in bad yaml files that would need to be handled in the YAML Reader. Inorder to fix this, the Stub Atoms use a dummy target such as itself. llvm-svn: 193476
* [PECOFF] Parse /merge command line option.Rui Ueyama2013-10-263-0/+68
| | | | | | | | /merge:<from>=<to> option makes the linker to combine "from" section to "to" section. This patch is to parse the option. The actual feature will be implemented in a subsequent patch. llvm-svn: 193454
OpenPOWER on IntegriCloud