summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* 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] Report error if there's unknown flag in .drectveRui Ueyama2013-11-051-5/+6
| | | | | | Errors in .drectve section were silently ignored. This patch fixes the issue. llvm-svn: 194110
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-0515-52/+52
| | | | llvm-svn: 194037
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-0512-32/+32
| | | | | | 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-014-16/+0
| | | | llvm-svn: 193885
* Remove redundant std::move().Rui Ueyama2013-11-014-7/+7
| | | | llvm-svn: 193883
* [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
* 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
* [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-291-0/+1
| | | | llvm-svn: 193646
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-2914-38/+57
| | | | | | | | | | | | | 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
* [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-261-0/+53
| | | | | | | | /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
* [ELF] Implement .{init,fini}_array ordering.Michael J. Spencer2013-10-256-0/+86
| | | | llvm-svn: 193451
* 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] Handle edge case where no section alignment is specified.Rui Ueyama2013-10-251-1/+11
| | | | llvm-svn: 193385
* [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
* [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-245-26/+25
| | | | | | | The patch have completely broken COFF port and disabled many tests. This also reverts r193302 (comment fix). llvm-svn: 193362
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-245-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Revert "Initialize some members where they are declared."Rui Ueyama2013-10-212-13/+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-212-17/+13
| | | | llvm-svn: 193122
* [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
* [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
* Run CVTRES.EXE on resource files.Rui Ueyama2013-10-162-5/+113
| | | | llvm-svn: 192830
* Bug 17569: add namespaces to work with gcc-4.7Nick Kledzik2013-10-141-7/+17
| | | | llvm-svn: 192627
* [ELF] Fix Atoms in the same file had overlapping ordinals.Shankar Easwaran2013-10-111-2/+1
| | | | | | | This also reverts the LayoutPass to use std::sort as all files have an ordinal now. llvm-svn: 192409
* Fix typoRui Ueyama2013-10-101-1/+1
| | | | llvm-svn: 192401
* [ELF] Initial design to handle Linker scripts for ELF.Shankar Easwaran2013-10-103-3/+14
| | | | llvm-svn: 192369
OpenPOWER on IntegriCloud