summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/DefinedAtom.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [MachO/Core] Remove (now) unused static member function. NFCI.Davide Italiano2016-08-041-12/+0
| | | | llvm-svn: 277760
* Delete more ELF bits from the old linker.Rafael Espindola2016-02-281-7/+0
| | | | llvm-svn: 262181
* Use __nl_symbol_ptr instead of __got in the stubs pass on x86 archs.Pete Cooper2016-02-091-0/+1
| | | | | | | | | | The non lazy atoms generated in the stubs pass use an image cache to hold all of the pointers. On arm archs, this is the __got section, but on x86 archs it should be __nl_symbol_ptr. rdar://problem/24572729 llvm-svn: 260271
* Fix handling of mach header and DSO handle symbols.Pete Cooper2016-02-021-0/+1
| | | | | | | | | | | | | | | | | The magic file which contained these symbols inherited from archive which meant that the resolver didn't add the required atoms as archive members only get added when referenced. Instead we now inherit from SimpleFile which always links in the atoms needed. The second issue was in the handling of these symbols when we emit the MachO. The mach header symbol needs to be in the atom list as it gets an offset (0), and being in the atom list makes sure it is emitted to the symbol table. DSO handles are not emitted to the symbol table. rdar://problem/24450654 llvm-svn: 259574
* Add ObjC method list atom type. NFC.Pete Cooper2016-02-011-0/+1
| | | | | | | | | | An upcoming patch will use this to create lists of ObjC methods. Adding it now to reduce the amount of code in that patch. Test cases will follow in the other patch too. llvm-svn: 259440
* Add an ObjCPass to the MachO linker.Pete Cooper2016-01-191-0/+1
| | | | | | | | | This pass currently emits an objc image info section if one is required. This section contains the aggregated version and flags for all of the input files. llvm-svn: 258197
* [lld][Darwin] Add support for the -sectcreate option.Lang Hames2015-10-241-0/+1
| | | | llvm-svn: 251183
* [ARM] Move out .ARM.exidx related things to ARM backendDenis Protivensky2015-05-261-1/+0
| | | | llvm-svn: 238191
* [ARM] Generation of .ARM.exidx/.ARM.extab sectionsLeny Kholodov2015-05-081-0/+1
| | | | | | | | | | | | This patch provides generation of .ARM.exidx & .ARM.extab sections which are used for unwinding. The patch adds new content type typeARMExidx for atoms from .ARM.exidx section and integration of atoms with such type to the ELF ReaderWriter. exidx.test has been added with checking of contents of .ARM.exidx section and .ARM.extab section. Differential Revision: http://reviews.llvm.org/D9324 llvm-svn: 236873
* Style cleanup in compareByPosition().Davide Italiano2015-02-041-7/+2
| | | | | | | | Differential Revision: D7394 Reported by: ruiu Reviewed by: ruiu llvm-svn: 228094
* Avoid two function calls of file() when not needed. Davide Italiano2015-02-031-2/+5
| | | | | | Reported by: ruiu llvm-svn: 228069
* Remove trailing whitespace introduced in r227709.Davide Italiano2015-02-011-1/+1
| | | | | | Reported by: shankarke llvm-svn: 227710
* [ELF] Don't compare an atom with itself in compareByPosition().Davide Italiano2015-02-011-0/+4
| | | | | | | | | | | | This caused some tests to fail on FreeBSD, and Mac OS X. Some std::sort() implementations will check for strict-weak-ordering by comparing with the same element, or will compare an element to itself for 1-element sequence. Take care of this case. Thanks to chandlerc for explaning that to me. Reviewed by: ruiu llvm-svn: 227709
* ELF: Don't use LayoutPass.Rui Ueyama2015-01-311-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we applied the LayoutPass to order atoms and then apply elf::ArrayOrderPass to sort them again. The first pass is basically supposed to sort atoms in the normal fashion (which is to sort symbols in the same order as the input files). The second pass sorts atoms in {init,fini}_array.<priority> by priority. The problem is that the LayoutPass is overkill. It analyzes references between atoms to make a decision how to sort them. It's slow, hard to understand, and above all, it doesn't seem that we need its feature for ELF in the first place. This patch remove the LayoutPass from ELF pass list. Now all reordering is done in elf::OrderPass. That pass sorts atoms by {init,fini}_array, and if they are not in the special section, they are ordered as the same order as they appear in the command line. The new code is far easier to understand, faster, and still able to create valid executables. Unlike the previous layout pass, elf::OrderPass doesn't count any attributes of an atom (e.g. permissions) except its position. It's OK because the writer takes care of them if we have to. This patch changes the order of final output, although that's benign. Tests are updated. http://reviews.llvm.org/D7278 llvm-svn: 227666
* [mach-o] Support linker synthesized mach_header symbols.Nick Kledzik2014-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | On darwin in final linked images, the __TEXT segment covers that start of the file. That means in memory a process can see the mach_header (and load commands) for every loaded image in a process. There are APIs that take and return the mach_header addresses as a way to specify a particular loaded image. For completeness, any code can get the address of the mach_header of the image it is in by using &__dso_handle. In addition there are mach-o type specific symbols like __mh_execute_header. The linker needs to supply a definition for any of these symbols if used. But the address the symbol it resolves to is not in any section. Instead it is the address of the start of the __TEXT segment. I needed to make a small change to SimpleFileNode to not override resetNextIndex() because the Driver creates a SimpleFileNode to hold the internal/implicit files that the context/writer can create. For some reason SimpleFileNode overrode resetNextIndex() to do nothing instead of reseting the index (which mach-o needs if the internal file is an archive). llvm-svn: 221822
* [mach-o] Add support for interposing tuples sectionNick Kledzik2014-11-061-0/+1
| | | | | | | | | | Darwin uses two-level-namespace lookup for symbols which means the static linker records where each symbol must be found at runtime. Thus defining a symbol in a dylib loaded earlier will not effect where symbols needed by later dylibs will be found. Instead overriding is done through a section of type S_INTERPOSING which contains tuples of <interposer, interposee>. llvm-svn: 221421
* Sort include files according to convention.Shankar Easwaran2014-10-181-1/+0
| | | | llvm-svn: 220131
* [mach-o] create __unwind_info section on x86_64Tim Northover2014-09-301-0/+1
| | | | | | | | | | | This is a minimally useful pass to construct the __unwind_info section in a final object from the various __compact_unwind inputs. Currently it doesn't produce any compressed pages, only works for x86_64 and will fail if any function ends up without __compact_unwind. rdar://problem/18208653 llvm-svn: 218703
* [core] support .gnu.linkonce sectionsShankar Easwaran2014-04-011-0/+1
| | | | | | | | | | | | | | | | | | .gnu.linkonce sections are similar to section groups. They were supported before section groups existed and provided a way to resolve COMDAT sections using a different design. There are few implementations that use .gnu.linkonce sections to store simple floating point constants which doesnot require complex section group support but need a way to store only one copy of the floating point constant in a binary. .gnu.linkonce based symbol resolution achieves that. Review : http://llvm-reviews.chandlerc.com/D3242 llvm-svn: 205280
* Revert "[core] support .gnu.linkonce sections"Shankar Easwaran2014-03-311-1/+0
| | | | | | | | | This reverts commit 5d5ca72a7876c3dd3dd1db83dc6a0d74be9e2cd1. Discuss on a better design to raise error when there is a similar group with Gnu linkonce sections and COMDAT sections. llvm-svn: 205224
* [core] support .gnu.linkonce sectionsShankar Easwaran2014-03-311-0/+1
| | | | | | | | | | | .gnu.linkonce sections are similar to section groups. They were supported before section groups existed and provided a way to resolve COMDAT sections using a different design. There are few implementations that use .gnu.linkonce sections to store simple floating point constants which doesnot require complex section group support but need a way to store only one copy of the floating point constant. .gnu.linkonce based symbol resolution achieves that. llvm-svn: 205163
* [core] add SectionGroup supportShankar Easwaran2014-03-261-0/+1
| | | | | | Review : http://llvm-reviews.chandlerc.com/D3182 llvm-svn: 204830
* [PECOFF] Refactor IdataPass.Rui Ueyama2013-12-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is to basically move the functionality to construct Data Directory from IdataPass to WriterPECOFF. Data Directory is a part of the PE/COFF header and contains the addresses of the import tables. We used to represent the link from Data Directory to the import tables as relocation references. The idea behind it is that, because relocation references are processed by the Writer, we wouldn't have to do anything special to fill the addresses of the import tables. I thought that the addresses would be set "automatically". But it turned out that that design made the pass and the writer rather complicated. In order to make relocation references between Data Directory to the import tables, these data structures needed to be represented as Atom. However, because Data Directory is not a section content but a part of the PE/COFF header, it did not fit well as an Atom. So we ended up having complicated code both in IdataPass and the writer. This patch simplifies it. One side effect of this patch is that we now have ".idata.a", ".idata.d" and "idata.t" sections for the import address table, the import directory table, and the import lookup table. The writer looks for the sections by name to find the start addresses of the sections. We probably should have a better way to find a specific atom from the core linking result, but currently using the section name seems to be the easiest way to do that. The Windows loader do not care about the import table's section layout. llvm-svn: 197016
* [lld][ELF] Support non alloc sections in the Writer.Shankar Easwaran2013-09-191-0/+1
| | | | | | | | | 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
* [lld][ELF] Differentiate between Note sections(RW/RO)Shankar Easwaran2013-09-041-1/+2
| | | | | | | | | | It looks like there is a possibility of seeing RO/RW note sections and we would need to create an appropriate RO/RW segment associated with them. Adds a test too. llvm-svn: 189907
* [lld][ELF] Emit note sectionsShankar Easwaran2013-09-041-0/+1
| | | | | | | | Emit note sections if the input contains a note section. Also emit a note segment. llvm-svn: 189896
* [lld][ELF] Rename typeTLV content type for ELFShankar Easwaran2013-08-231-0/+2
| | | | | | | | | | | typeTLV content type is used by Darwin to represent thread local storage. A new contentType has to be made to represent ELF thread local storage data. These have been set to - typeThreadZeroFill (represents TBSS storage) - typeThreadData (represents TDATA storage) llvm-svn: 189137
* [PECOFF] Support linking against DLL.Rui Ueyama2013-07-111-0/+1
| | | | | | | | | | | | | | | This patch adds a new pass, IdataPass, to transform shared atom references to real references and to construct the .idata section data. With this patch lld can produce a working Hello World program by linking it against kernel32.dll and user32.dll. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1096 llvm-svn: 186071
* [lld] remove trailing whitespaceShankar Easwaran2013-03-141-2/+2
| | | | llvm-svn: 177079
* [ELF][Hexagon]add typeZeroFillFastShankar Easwaran2013-02-241-0/+1
| | | | llvm-svn: 175983
* add changes for typeDataFastShankar Easwaran2013-02-221-0/+1
| | | | llvm-svn: 175901
* Add SectionPosition and OrderPassNick Kledzik2013-01-231-2/+0
| | | | llvm-svn: 173300
* Better tie together ContentType and Permissions. Nick Kledzik2013-01-091-0/+78
Since most content types (e.g. typeCode) have a preferred Permission, add a function to do that mapping. Then hook up to YAML Reader and Writer such that the 'permissions:' key does not need to be specified unless overriding what the content type prefers. llvm-svn: 171929
OpenPOWER on IntegriCloud