summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes are in: include/lld/Core/Reference.h include/lld/ReaderWriter/Reader.h Everything else is details to support the main change. 1) Registration based Readers Previously, lld had a tangled interdependency with all the Readers. It would have been impossible to make a streamlined linker (say for a JIT) which just supported one file format and one architecture (no yaml, no archives, etc). The old model also required a LinkingContext to read an object file, which would have made .o inspection tools awkward. The new model is that there is a global Registry object. You programmatically register the Readers you want with the registry object. Whenever you need to read/parse a file, you ask the registry to do it, and the registry tries each registered reader. For ease of use with the existing lld code base, there is one Registry object inside the LinkingContext object. 2) Changing kind value to be a tuple Beside Readers, the registry also keeps track of the mapping for Reference Kind values to and from strings. Along with that, this patch also fixes an ambiguity with the previous Reference::Kind values. The problem was that we wanted to reuse existing relocation type values as Reference::Kind values. But then how can the YAML write know how to convert a value to a string? The fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and a 16-bit value. This tuple system allows conversion to and from strings with no ambiguities. llvm-svn: 197727
* [PECOFF] Rename lld::coff -> lld::pecoff.Rui Ueyama2013-12-131-2/+2
| | | | | | We had lld::coff and lld::pecoff namespaces for no reason. Unify them. llvm-svn: 197201
* [PECOFF] Give a better name to the linker generated file.Rui Ueyama2013-11-151-1/+1
| | | | llvm-svn: 194847
* [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] 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
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-1/+0
| | | | | | | | | | | | 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
* Do not hard code the leading underscore.Rui Ueyama2013-09-121-11/+15
| | | | | | | | 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
* [lld][LinkingContext] Atoms created from command line options should be ↵Shankar Easwaran2013-08-311-18/+0
| | | | | | | | | | | | available in YAML This adds an API to the LinkingContext for flavors to add Internal files containing atoms that need to appear in the YAML output as well, when -emit-yaml switch is used. Flavors can add more internal files for other options that are needed. llvm-svn: 189718
* Rename ti -> ctx.Rui Ueyama2013-08-271-3/+3
| | | | | | | This should have been done in r187823 when I renamed LinkingContext from TargetInfo. I missed a few files. llvm-svn: 189298
* [PECOFF] Add a note about underscore symbol prefix.Rui Ueyama2013-08-091-1/+6
| | | | llvm-svn: 188090
* [PECOFF] Create __ImageBase symbol.Rui Ueyama2013-08-091-0/+128
__ImageBase is a symbol having 4 byte integer equal to the image base address of the resultant executable. The linker is expected to create the symbol as if it were read from a file. In order to emit the symbol contents only when the symbol is actually referenced, we created a pseudo library file to wrap the linker generated symbol. The library file member is emitted to the output only when the member is actually referenced, which is suitable for our purpose. llvm-svn: 188052
OpenPOWER on IntegriCloud