| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 192310
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change removes code in various places which was setting the File Ordinals.
This is because the file ordinals are assigned by the way files are resolved.
There was no other way than making the getNextFileAndOrdinal be set const and
change the _nextOrdinal to mutable.
There are so many places in code, that you would need to cleanup to make
LinkingContext non-const!
llvm-svn: 192280
|
|
|
|
| |
llvm-svn: 192277
|
|
|
|
| |
llvm-svn: 192261
|
|
|
|
| |
llvm-svn: 192183
|
|
|
|
| |
llvm-svn: 192154
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first step in how I plan to get mach-o object files support into
lld. We need to be able to test the mach-o Reader and Write on systems without
a mach-o tools. Therefore, we want to support a textual way (YAML) to represent
mach-o files.
MachONormalizedFile.h defines an in-memory abstraction of the content of mach-o
files. The in-memory data structures are always native endianess and always
use 64-bit sizes. That internal data structure can then be converted to or
from three different formats: 1) yaml (text) encoded mach-o, 2) binary mach-o
files, 3) lld Atoms.
This patch defines the internal model and uses YAML I/O to implement the
conversion to and from the model to yaml. The next patch will implement
the conversion from normalized to binary mach-o.
This patch includes unit tests to validate the yaml conversion APIs.
llvm-svn: 192147
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes :-
a) Functionality in InputGraph to insert Input elements at any position
b) Functionality in the Resolver to use nextFile
c) Move the functionality of assigning file ordinals to InputGraph
d) Changes all inputs to MemoryBuffers
e) Remove LinkerInput, InputFiles, ReaderArchive
llvm-svn: 192081
|
|
|
|
| |
llvm-svn: 191924
|
|
|
|
| |
llvm-svn: 191583
|
|
|
|
|
|
| |
Stop using some locally defined mach-o constants.
llvm-svn: 191581
|
|
|
|
|
|
|
|
| |
This will eventually need to be refactored to better handle COPY relocations,
as other relocations can also generate them. I'm not yet sure the exact
circumstances in which they are needed yet.
llvm-svn: 191567
|
|
|
|
| |
llvm-svn: 191566
|
|
|
|
| |
llvm-svn: 191467
|
|
|
|
| |
llvm-svn: 191466
|
|
|
|
| |
llvm-svn: 191403
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch inverts the return value of these functions, so that they return
"true" on success and "false" on failure. The meaning of boolean return value
was mixed in LLD; for example, InputGraph::validate() returns true on success.
With this patch they'll become consistent.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1748
llvm-svn: 191341
|
|
|
|
| |
llvm-svn: 191276
|
|
|
|
| |
llvm-svn: 191227
|
|
|
|
| |
llvm-svn: 191224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch changes WriterPECOFF to actually write down the address instead of ignoring it.
Also, it changes the order of adding the BaseReloc chunk as otherwise the address wasn't set yet.
I think a better way of doing it would be to change DataDirectoryAtom to create a Reference
instead of using a number, and to change IdataPass accordingly, but I'm not sure how to do that.
Reviewers: ruiu
Reviewed By: ruiu
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1743
llvm-svn: 191220
|
|
|
|
| |
llvm-svn: 191218
|
|
|
|
| |
llvm-svn: 191217
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This patch changes WritePECOFF to calculate the value of the SizeOfHeaders PE header field instead of just using 512.
Reviewers: rui314, ruiu
Reviewed By: ruiu
CC: llvm-commits, ruiu
Differential Revision: http://llvm-reviews.chandlerc.com/D1708
llvm-svn: 191212
|
|
|
|
| |
llvm-svn: 191207
|
|
|
|
|
|
|
|
|
|
| |
This adds an option --output-filetype that can be set to either
YAML/Native(case insensitive). The linker would create the outputs
associated with the type specified by the user.
Changes all the tests to use the new option.
llvm-svn: 191183
|
|
|
|
|
|
|
|
| |
Cleanup structure members that are not being used.
Also clang-format it.
llvm-svn: 191038
|
|
|
|
|
|
|
|
|
| |
This also makes it support debugging executables built with lld.
Initial patch done by Bigcheese. This is only a revised patch to
have the functionality in the Writer.
llvm-svn: 191032
|
|
|
|
| |
llvm-svn: 190986
|
|
|
|
|
|
| |
Test is coming after submitting http://llvm-reviews.chandlerc.com/D1719.
llvm-svn: 190983
|
|
|
|
|
|
|
|
|
|
|
| |
Base relocation block should be aligned on a 32-bit boundary. While the PECOFF
spec mentions only aligning the blocks, and not padding them, link.exe seems
to add an extra IMAGE_REL_I386_ABSOLUTE entry (just a zeroed WORD) in order to
pad the blocks.
Patch by Ron Ofir.
llvm-svn: 190951
|
|
|
|
| |
llvm-svn: 190949
|
|
|
|
| |
llvm-svn: 190903
|
|
|
|
|
|
|
|
|
| |
This sets the sectionChoice property for DefinedAtoms. The output section name
is derived by the property of the atom. This also decreases native file size.
Adds a test.
llvm-svn: 190840
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
header
This patch changes lld to go through all sections while calculating the size
for SizeOfCode, SizeOfInitializedData and SizeOfUninitializedData fields in the
PE header, instead of using only a small set of hard-coded sections.
This only really changes SizeOfInitializedData which didn't include .reloc
section before this patch.
Patch by Ron Ofir.
llvm-svn: 190799
|
|
|
|
|
|
|
|
|
| |
This patch sets the IMAGE_SCN_MEM_DISCARDABLE characteristic to the base
relocations section in order to match MS PECOFF specification.
Patch by Ron Ofir.
llvm-svn: 190798
|
|
|
|
| |
llvm-svn: 190772
|
|
|
|
| |
llvm-svn: 190758
|
|
|
|
| |
llvm-svn: 190753
|
|
|
|
|
|
| |
NetBSD need it.
llvm-svn: 190752
|
|
|
|
|
|
| |
This reverts r189881 because that patch caused dangling StringRefs.
llvm-svn: 190725
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a bug that if a section has an alignment requirement and there are
multiple symbols at offset 0 in the section, only the last atom at offset 0
would be aligned properly. That bug would move only the last symbol to an
alignment boundary, leaving other symbols unaligned, although they should be at
the same location. That caused a mysterious SEGV error of the resultant
executable.
With this patch, we manage all symbols at the same location properly, rather
than keeping the last one.
llvm-svn: 190724
|
|
|
|
|
|
|
|
| |
Alignment(1) does not mean that the atom should be aligned on a 1 byte
boundary but on a 2^1 boundary. So, atoms without any specific alignment
requirements should have Alignment(0).
llvm-svn: 190723
|
|
|
|
|
|
|
|
|
|
|
|
| |
This handles multiple weak symbols which appear back to back. This fix is needed
which otherwise will lead to symbols getting initialized to arbitrary values.
There was a constructor/destructor test that really triggered this to be fixed
on X86_64.
Adds a test.
llvm-svn: 190658
|
|
|
|
|
|
| |
Used the fallback mechanism to implement COFF weak external symbols.
llvm-svn: 190633
|
|
|
|
|
|
|
|
|
| |
So that we can determine what the target architecture is. Adding this
field does not mean that we are going to support non-i386 architectures
soon; there are many things to do to support them, and I'm focusing on
i386 now. But this is the first step toward multi architecture support.
llvm-svn: 190627
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In COFF, an undefined symbol can have up to one alternative name. If a symbol
is resolved by its regular name, then it's linked normally. If a symbol is not
found in any input files, all references to the regular name are resolved using
the alternative name. If the alternative name is not found, it's a link error.
This mechanism is called "weak externals".
To support this mechanism, I added a new member function fallback() to undefined
atom. If an undefined atom has the second name, fallback() returns a new undefined
atom that should be used instead of the original one to resolve undefines. If it
does not have the second name, the function returns nullptr.
Differential Revision: http://llvm-reviews.chandlerc.com/D1550
llvm-svn: 190625
|
|
|
|
|
|
| |
The first section in the output was not aligned to the alignment of the section.
llvm-svn: 190610
|
|
|
|
|
|
|
| |
This associates rodata and sections which just have the SHF_ALLOC flag
to be set to typeConstant.
llvm-svn: 190609
|
|
|
|
|
|
|
|
| |
Mangling scheme varies on platform, and prepending an underscore is valid only
on 32-bit x86. Added a method to mangle name to PECOFFLinkingContext and use
it to avoid hard coding mangled names.
llvm-svn: 190585
|