summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Implement .{init,fini}_array ordering.Michael J. Spencer2013-10-256-0/+86
| | | | llvm-svn: 193451
* [PECOFF] Fix use-after-return.Rui Ueyama2013-10-251-1/+1
| | | | llvm-svn: 193446
* [PECOFF] Fix XML output bug.Rui Ueyama2013-10-251-1/+1
| | | | | | | We really need a test for the manifest file output, but because it depends on external commands (CVTRES.EXE and RC.EXE), it's not very easy to write it. llvm-svn: 193445
* [PECOFF] Do not create a temporary std::string.Rui Ueyama2013-10-251-12/+10
| | | | llvm-svn: 193444
* Make sure the string is NUL-terminated.Rui Ueyama2013-10-251-2/+2
| | | | | | | | The internal byte array of the SmallString filled by createTemporaryFile() is not guaranteed to be NUL-terminated. We need to call c_str() to handle it safely. llvm-svn: 193442
* Fix spelling.Rui Ueyama2013-10-251-3/+3
| | | | llvm-svn: 193440
* Put missing license header.Rui Ueyama2013-10-252-0/+18
| | | | llvm-svn: 193435
* [PECOFF] Fix doublequote escaping.Rui Ueyama2013-10-251-4/+3
| | | | llvm-svn: 193424
* [PECOFF] Output error message to diagnostics.Rui Ueyama2013-10-251-1/+1
| | | | llvm-svn: 193387
* [PECOFF] Handle edge case where no section alignment is specified.Rui Ueyama2013-10-251-1/+11
| | | | llvm-svn: 193385
* Concatenate strings at compile time.Rui Ueyama2013-10-251-14/+16
| | | | llvm-svn: 193384
* [ELF] Refactor x86-64 relocation pass.Michael J. Spencer2013-10-245-441/+501
| | | | | | | This renames the GOTPLTPass to RelocationPass and refactors it to better represent the different types of relocations. llvm-svn: 193379
* [PECOFF] Fix spelling in manifest XML.Rui Ueyama2013-10-241-2/+2
| | | | llvm-svn: 193375
* [ELF][x86-64] Generate PLT for R_*_32S relocs.Michael J. Spencer2013-10-241-1/+4
| | | | llvm-svn: 193369
* Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver"Rui Ueyama2013-10-2414-133/+37
| | | | | | | The patch have completely broken COFF port and disabled many tests. This also reverts r193302 (comment fix). llvm-svn: 193362
* Fix Comments.Shankar Easwaran2013-10-242-7/+2
| | | | llvm-svn: 193302
* [Driver] Change UniversalDriver to use TD file.Shankar Easwaran2013-10-243-32/+97
| | | | | | | | Easier to add new options such as -version, and easy to parse. Now displays a help message with -help llvm-svn: 193301
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-2414-37/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable tests to be run with REQUIRES: disable. Note disable is not added to the config by the test runner Mkaefiles, so essentially disables the test. Code changes would be required to fix these tests :- test/darwin/hello-world.objtxt test/elf/check.test test/elf/phdr.test test/elf/ppc.test test/elf/undef-from-main-dso.test test/elf/X86_64/note-sections-ro_plus_rw.test test/pecoff/alignment.test test/pecoff/base-reloc.test test/pecoff/bss-section.test test/pecoff/drectve.test test/pecoff/dynamic.test test/pecoff/dynamicbase.test test/pecoff/entry.test test/pecoff/hello.test test/pecoff/imagebase.test test/pecoff/importlib.test test/pecoff/lib.test test/pecoff/multi.test test/pecoff/reloc.test test/pecoff/weak-external.test llvm-svn: 193300
* [PECOFF] Support embedding resource file into executable.Rui Ueyama2013-10-241-22/+168
| | | | | | | | | | | | Instead of making the linker to create a manifest XML file in the same directory as the resulting binary, you can embed the XML as a part of resource into the executable. In order to do that, the linker first creates a resource script file containing the XML file, compile it into a binary resource file with RC.EXE, and then convert it to a COFF file with CVTRES.EXE. llvm-svn: 193298
* Remove unused variable.Rui Ueyama2013-10-231-3/+0
| | | | llvm-svn: 193266
* [PECOFF] Resource file extension is .res, not .rc.Rui Ueyama2013-10-221-4/+4
| | | | | | | | This patch won't change LLD's behavior because it's a temporary file and LLD does not use the file extension to determine file type. But using the correct file extension is a good thing. llvm-svn: 193211
* [PECOFF] Emit the side-by-side manifest file.Rui Ueyama2013-10-221-0/+46
| | | | llvm-svn: 193207
* [PECOFF] Add /manifestdependency command line option.Rui Ueyama2013-10-222-0/+10
| | | | llvm-svn: 193201
* [PECOFF] Add /manifestfile command line option.Rui Ueyama2013-10-222-0/+13
| | | | | | | | /manifestfile:<path> specifies an alternative manifest file output path. Default is "<output-path>.manifest" where <output-path> is the executable's path. llvm-svn: 193195
* Factor out into a separate function. No functionality change.Rui Ueyama2013-10-221-4/+9
| | | | llvm-svn: 193186
* [PECOFF] /manifestuac option is case insensitive.Rui Ueyama2013-10-221-3/+10
| | | | llvm-svn: 193173
* [PECOFF] Fix /manifestuac handling.Rui Ueyama2013-10-221-10/+7
| | | | | | uiAccess argument's type is not really boolean. It's string. llvm-svn: 193171
* Fix typo in variable nameAlp Toker2013-10-221-4/+4
| | | | llvm-svn: 193155
* [PECOFF] Add /manifestuac command line option.Rui Ueyama2013-10-221-0/+48
| | | | | | This option is used for the manifest file too. llvm-svn: 193145
* [PECOFF] Better error handling for /manifest.Rui Ueyama2013-10-221-10/+8
| | | | llvm-svn: 193143
* [PECOFF] Return false on error. No functionality change.Rui Ueyama2013-10-221-11/+11
| | | | llvm-svn: 193142
* [PECOFF] Parse /manifest command line option.Rui Ueyama2013-10-222-0/+48
| | | | | | | | | | The manifest file is an XML file that conveys some information to the loader, such as whether the executable needs to run as Administrator or not. This patch is to parse command line option for manifest file. Actual XML file generation will be done in a separate patch. llvm-svn: 193141
* Revert "Initialize some members where they are declared."Rui Ueyama2013-10-213-15/+17
| | | | | | | Because MSVC11 doesn't like this new C++11 feature. The last commit broke the buildbot. llvm-svn: 193127
* Initialize some members where they are declared. No functionality change.Rui Ueyama2013-10-213-17/+15
| | | | llvm-svn: 193122
* Simplify WinLinkDriver. No functionality change.Rui Ueyama2013-10-191-10/+5
| | | | llvm-svn: 193030
* Fix bug that CompareAtoms::compare is not transitive.Rui Ueyama2013-10-191-23/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a bug in r190608. The results of a comparison function passed to std::sort must be transitive, which is, if a < b and b < c, and if a != b, a < c must be also true. CompareAtoms::compare did not actually guarantee the transitivity. As a result the sort results were sometimes just wrong. Consider there are three atoms, X, Y, and Z, whose file ordinals are 1, 2, 3, respectively. Z has a property "layout-after X". In this case, all the following conditionals become true: X < Y because X's ordinal is less than Y's Y < Z because Y's ordinal is less than Z's Z < X because of the layout-after relationship This is not of course transitive. The reason why this happened is because we used follow-on relationships for comparison if two atoms falls in the same follow-on chain, but we used each atom's properties if they did not. This patch fixes the issue by using follow-on root atoms for comparison to get consistent results. Differential Revision: http://llvm-reviews.chandlerc.com/D1980 llvm-svn: 193029
* [PECOFF] Only COMDAT symbols are allowed to be dead-stripped.Rui Ueyama2013-10-182-10/+23
| | | | | | | | | | | | | | | | | | We should dead-strip atoms only if they are created for COMDAT symbols. If we remove non-COMDAT atoms from a binary, it will no longer be guaranteed that the binary will work correctly. In COFF, you can manipulate the order of section contents in the resulting binary by section name. For example, if you have four sections .data$unique_prefix_{a,b,c,d}, it's guaranteed that the contents of A, B, C, and D will be consecutive in the resulting .data section in that order. Thus, you can access B's and C's contents by incrementing a pointer pointing to A until it reached to D. That's why we cannot dead-strip B or C even if no one is directly referencing to them. Some object files in the standard library actually use that technique. llvm-svn: 193017
* Fill the atom gap with INT 3 instead of NOP.Rui Ueyama2013-10-181-2/+2
| | | | | | | | INT 3 (machine code 0xCC) will raise an interrupt when executed. That is better for filling the gap than NOP because we want to stop the execution immediately when the control reached to non-code address. llvm-svn: 192945
* [Native] Fix fallback atoms when writing to Native file.Shankar Easwaran2013-10-181-0/+3
| | | | | | | | There is no test as currently there is no call to the NativeWriter. Future commits will add calls to the NativeWriter. llvm-svn: 192944
* Fix -Wunused-function warning of release build.Rui Ueyama2013-10-181-0/+2
| | | | llvm-svn: 192943
* Fix a layout pass debug message.Rui Ueyama2013-10-181-1/+1
| | | | llvm-svn: 192942
* Improve debug message of the layout pass.Rui Ueyama2013-10-181-29/+46
| | | | | | | | | | | | | | | | | | | | | Instead of showing multiple lines of debug messages, show only one message by CompareAtoms::operator(). Here is an example. Before: Sorting _main .text Sorting by sectionPos(2,2) Sorting by override Sorting _main .text Sorting by sectionPos(2,2) Sorting by override After: Layout: '_main' > '.text' (override (1, 0)) Layout: '_main' > '.text' (override (1, 0)) Differential Revision: http://llvm-reviews.chandlerc.com/D1964 llvm-svn: 192941
* [ELF] Set ordinals properly to all atoms.Shankar Easwaran2013-10-182-6/+6
| | | | llvm-svn: 192939
* Fill gap in .text with NOP.Rui Ueyama2013-10-171-0/+14
| | | | llvm-svn: 192930
* Make undefines check into an assertion.Rui Ueyama2013-10-162-13/+16
| | | | | | | | | Dead-strip root symbols can be undefined atoms, but should not really be nonexistent, because dead-strip root symbols should be added to initial undefined atoms at startup. Whenever you look up its name in the symbol table, some type of atom will always exist. llvm-svn: 192831
* Run CVTRES.EXE on resource files.Rui Ueyama2013-10-162-5/+113
| | | | llvm-svn: 192830
* Fix a bug that the empty string could be added to dead strip root.Rui Ueyama2013-10-161-1/+2
| | | | llvm-svn: 192772
* Propagate deadStripOptimize()'s failure to the caller.Rui Ueyama2013-10-161-5/+7
| | | | | | | We want to make the program to exit with non-zero exit code if there's an error during dead stripping. llvm-svn: 192771
* Bug 17569: add namespaces to work with gcc-4.7Nick Kledzik2013-10-141-7/+17
| | | | llvm-svn: 192627
* [cleanup] Remove single-statement if blocksShankar Easwaran2013-10-141-4/+2
| | | | llvm-svn: 192614
OpenPOWER on IntegriCloud