summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/DefaultLayout.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Implement --rosegmentShankar Easwaran2014-09-081-1/+2
| | | | | | | | | By default linker would not create a separate segment to hold read only data. This option overrides that behavior by creating the a separate read only segment for read only data. llvm-svn: 217358
* Update for llvm api change.Rafael Espindola2014-06-131-2/+2
| | | | llvm-svn: 210919
* Quick fix for the windows build.Rafael Espindola2014-06-111-0/+1
| | | | | | We have to look for both std::make_error_code as well as our overloads. llvm-svn: 210704
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-1/+1
| | | | | | This is an update for a llvm api change. llvm-svn: 210689
* Fix comments.Rui Ueyama2014-04-031-2/+2
| | | | llvm-svn: 205568
* [ELF] Add "override" and remove "virtual".Rui Ueyama2014-03-281-7/+7
| | | | llvm-svn: 205056
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-131-1/+1
| | | | | | | | This results in some simplifications to the code where an OwningPtr had to be used with the previous api and then ownership moved to a unique_ptr for the rest of lld. llvm-svn: 203809
* [ELF] Dont generate PHDR when creating dynamic libraries.Shankar Easwaran2014-02-191-1/+1
| | | | llvm-svn: 201741
* [ELF] Customize a relocation table output format (rel / rela).Simon Atanasyan2014-01-241-2/+4
| | | | | | | | | | Add new virtual virtual function `isRelaOutputFormat` to the `ELFLinkingContext` class. Call this function everywhere we need to select a relocation table format. Patch reviewed by Shankar Easwaran and Rui Ueyama. llvm-svn: 199973
* [ELF] Fix type of the DefaultLayout::segments() return value. ThisSimon Atanasyan2014-01-141-1/+3
| | | | | | | | method returns the DefaultLayout::_segments field. The type of this field is a vector of Segment<ELFT>* pointers. This type cannot be implicitly casted to the range<ChunkIter>. llvm-svn: 199233
* Run clang-format on r197727.Rui Ueyama2013-12-201-8/+8
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix "don't" typos missed in previous commitAlp Toker2013-12-011-5/+5
| | | | llvm-svn: 196054
* Fix a variety of typos in function names and commentsAlp Toker2013-12-011-4/+4
| | | | | | No change in functionality. llvm-svn: 196053
* [ELF] Implement minimal support for .eh_frame_hdr.Michael J. Spencer2013-10-301-1/+3
| | | | llvm-svn: 193662
* [ELF] Implement .{init,fini}_array ordering.Michael J. Spencer2013-10-251-0/+2
| | | | llvm-svn: 193451
* [ELF] Initial design to handle Linker scripts for ELF.Shankar Easwaran2013-10-101-1/+11
| | | | llvm-svn: 192369
* [lld][ELF] Remove invalid commentShankar Easwaran2013-09-231-3/+1
| | | | llvm-svn: 191207
* [lld][ELF] Support non alloc sections in the Writer.Shankar Easwaran2013-09-191-17/+39
| | | | | | | | | 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] Assign sectionChoice properly to ELF atomsShankar Easwaran2013-09-171-27/+31
| | | | | | | | | 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
* [lld][ELF] Fix vaddr of the first sectionShankar Easwaran2013-09-121-0/+1
| | | | | | The first section in the output was not aligned to the alignment of the section. llvm-svn: 190610
* [lld][ELF] Change the order of the writable note sectionShankar Easwaran2013-09-051-1/+1
| | | | | | | Writable note sections if they exist should not appear before text they belong in the data segment llvm-svn: 190024
* [lld][ELF] Differentiate between Note sections(RW/RO)Shankar Easwaran2013-09-041-7/+24
| | | | | | | | | | 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/+3
| | | | | | | | Emit note sections if the input contains a note section. Also emit a note segment. llvm-svn: 189896
* [lld][ELF] Cleanup ELF writing, No change in functionalityShankar Easwaran2013-08-261-9/+5
| | | | | | | | | | The cleanup includes :- * Rename ambiguous Header class to ELFHeader * Convert Chunk contentype and kind to be a enumerated class * Remove functions that are not being used, avoids future confusion llvm-svn: 189209
* [lld][ELF] process fini_array sectionsShankar Easwaran2013-08-251-0/+1
| | | | | | | | This change processes fini_array section in addition to processing init_array sections. This also makes functions registered at compile time for initialization and finalization to be run during execution llvm-svn: 189196
* [lld][ELF] Rename typeTLV content type for ELFShankar Easwaran2013-08-231-2/+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
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-25/+25
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [ELF] Add more sections to the default section map.Shankar Easwaran2013-06-171-0/+8
| | | | | | | | | | | | | This change adds functionality to add more sections like .gcc_except_table, .data.rel.local, .data.rel.ro into the default section map, so that they are all merged into appropriate output sections. This also makes c++ static binaries comparable to what you get with the default linker. Adds a test for testing the functionality. llvm-svn: 184071
* [lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by ↵Rui Ueyama2013-06-161-7/+7
| | | | | | | | | | | | non-ELF writers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D977 llvm-svn: 184061
* [ELF] add NMAGIC/OMAGIC supportShankar Easwaran2013-06-161-7/+22
| | | | llvm-svn: 184055
* [ELF] TBSS section has to be special cased so that it doesnot occupy memory ↵Shankar Easwaran2013-06-121-0/+5
| | | | | | space llvm-svn: 183815
* Instrument things.Michael J. Spencer2013-05-281-0/+3
| | | | llvm-svn: 182789
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
* [ELF] order rela.dyn/rela.plt properlyShankar Easwaran2013-03-261-2/+6
| | | | llvm-svn: 177969
* [ELF] Order .got.plt properlyShankar Easwaran2013-03-201-1/+4
| | | | llvm-svn: 177482
* [lld] remove trailing whitespaceShankar Easwaran2013-03-141-16/+16
| | | | llvm-svn: 177079
* [ELF] Remove commentShankar Easwaran2013-03-051-2/+4
| | | | llvm-svn: 176482
* [ELF] Set header flags to 0 by defaultShankar Easwaran2013-02-281-2/+5
| | | | llvm-svn: 176279
* [lld][ELF] Order segmentsShankar Easwaran2013-02-271-26/+84
| | | | llvm-svn: 176207
* [ELF][Writer] Add dynamic relocation tables.Michael J. Spencer2013-02-271-13/+29
| | | | | | | This adds separate PLT and dynamic relocation tables. It also fills in the dynamic table entries for them. llvm-svn: 176150
* [ELF][Hexagon]add typeZeroFillFastShankar Easwaran2013-02-241-1/+3
| | | | llvm-svn: 175983
* [ELF][Writer] Add a PHDR program table entry for dynamic files.Michael J. Spencer2013-02-231-0/+2
| | | | llvm-svn: 175951
* sort quickdata for the hexagon targetShankar Easwaran2013-02-221-0/+5
| | | | llvm-svn: 175904
* add changes for typeDataFastShankar Easwaran2013-02-221-4/+5
| | | | llvm-svn: 175901
* [ELF] Fix memory leak by deleting BumpPtr allocated objects.Michael J. Spencer2013-02-191-6/+7
| | | | llvm-svn: 175558
* [ELF][Writer] Refactor Section to not have atoms. Move atoms into AtomSection.Michael J. Spencer2013-02-141-30/+38
| | | | | | | | | The purpose of this change is to simplify creating non-atom sections. Previously _contentType, _sectionKind and _order were used for multiple purposes and collided in places. This moves all of the Atom specific logic down into AtomSection and makes Section just have raw Elf_Shdr flags. llvm-svn: 175207
* [ELF][Layout] Provide a proper way to get the TLS segment size.Michael J. Spencer2013-02-051-0/+11
| | | | llvm-svn: 174427
* [ELF] Fix uninitialized variable.Michael J. Spencer2013-02-031-1/+1
| | | | llvm-svn: 174274
* [ELF][x86-64] Fix ifunc and add test.Michael J. Spencer2013-02-011-1/+1
| | | | | | | | | In an previous commit I managed to completely disable the IRELATIVE relocation writing code. I also used the wrong addend for the static relocation. Fix both these issues and add a test. This test is quite brittle because there's no way to do arithmetic on variables in FileCheck. llvm-svn: 174161
OpenPOWER on IntegriCloud