summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/SectionChunks.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[ELF] Create input and output section names"Shankar Easwaran2014-11-191-27/+12
| | | | | | | | This reverts commit r222311. Reverting because of failure in the darwin bot. llvm-svn: 222329
* [ELF] Create input and output section namesShankar Easwaran2014-11-191-12/+27
| | | | | | No change in functionality. llvm-svn: 222311
* [ELF] Rename MergedSection to OutputSection.Shankar Easwaran2014-11-191-40/+38
| | | | | | No change in functionality. llvm-svn: 222310
* Silence inconsistent override warnings.Eric Christopher2014-11-141-3/+3
| | | | llvm-svn: 222021
* [ELF] Dynamic section was not aligned properly.Shankar Easwaran2014-11-141-4/+14
| | | | | | | The dynamic section was not aligned properly. The alignment of the section is determined by the word size of the architecture. llvm-svn: 221972
* [ELF] Fix DT_INIT_ARRAY{SZ} and DT_FINI_ARRAY{SZ}Shankar Easwaran2014-11-101-4/+26
| | | | | | | | | | The dynamic table was creating the entry DT_FINI_ARRAY{SZ} even when there was no .fini_array section. The entries should be creating in the dynamic section only if there are sections .init_array/.fini_array in the output. Fixes the tests that checked for errroneous outputs. llvm-svn: 221588
* [ELF] .dynamic should have SHT_DYNAMIC flagShankar Easwaran2014-11-101-0/+5
| | | | llvm-svn: 221586
* [ELF] Remove is64bits() and isLittlEndian().Shankar Easwaran2014-11-071-14/+3
| | | | | | | | | | ELFLinkingContext had these two functions, which is really not needed since the Writer uses a llvm::object template composed of Endianness, Alignment, Is32bit/64bit. We could just use that and not duplicate functionality. No Change In Functionality. llvm-svn: 221523
* [ELF] Fix program headers.Shankar Easwaran2014-11-041-6/+5
| | | | | | | | | The ELF writer creates a invalid binary for few cases with large filesize and memory size for segments. This patch addresses the functionality and updates the test. This patch also cleans up parts of the ELF writer for future enhancements to support Linker scripts. llvm-svn: 221233
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-3/+0
| | | | | | | | | This would permit the ELF reader to check the architecture that is being selected by the linking process. This patch also sorts the include files according to LLVM conventions. llvm-svn: 220129
* Remove dead code.Rui Ueyama2014-10-141-42/+34
| | | | | | | | | | | Because we use cast<> at the beginning of this function, it will abort there if a given atom is not a DefinedAtom. In the switch statement, we checked if a given atom is a DefinedAtom again by evaluating definition() == Atom::definitionRegular. This was always true. So we can remove the outer switch statement. llvm-svn: 219724
* [ELF] Emit DT_TEXTREL dynamic table flag.Simon Atanasyan2014-05-131-0/+16
| | | | | | | | | | | | | | If one or more dynamic relocation might modify a read-only section, dynamic table should contain DT_TEXTREL tag. The patch introduces new `RelocationTable::canModifyReadonlySection()` method. This method checks through the relocations to see if any modifies a read-only section. The DynamicTable class calls this method and emits the DT_TEXTREL tag if necessary. The patch reviewed by Rui Ueyama and Shankar Easwaran. llvm-svn: 208670
* [ELF] Fix GNU_RELRO section name.Rui Ueyama2014-04-181-1/+1
| | | | llvm-svn: 206560
* Fix comments.Rui Ueyama2014-04-031-1/+1
| | | | llvm-svn: 205568
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-131-1/+2
| | | | | | | | 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
* [Cleanup] Sort includes.Ahmed Charles2014-03-121-1/+1
| | | | llvm-svn: 203666
* Add "override" and remove "virtual" where appropriate.Rui Ueyama2014-03-061-2/+2
| | | | | | | For the record, I used clang-modernize to add "override" and perl to remove "virtual". llvm-svn: 203164
* [C++11] Replace LLVM_OVERRIDE with just "override" now that we're allChandler Carruth2014-03-021-3/+3
| | | | | | using MSVC 2012 or newer. llvm-svn: 202627
* [ELF] Fix alignment for dynamic relocation sections.Shankar Easwaran2014-02-191-2/+5
| | | | | | | | The sections .rela/.rel.(*) have a alignment of 2 in the final image created by the linker. This needs to be properly set to the right alignment depending on the architecture(32/64bits). llvm-svn: 201740
* [ELF] Customize dynamic table tag used for .got.plt section referencing.Simon Atanasyan2014-02-021-1/+5
| | | | | | The patch reviewed by Shankar Easwaran and Rui Ueyama. llvm-svn: 200630
* [ELF] Make private all DynamicTable class fields which are not used inSimon Atanasyan2014-01-301-0/+2
| | | | | | the descendant classes. llvm-svn: 200467
* [ELF][Hexagon] typeZeroFillQuick is not associated with bss section.Shankar Easwaran2014-01-291-1/+1
| | | | | | | We need to increase the memory and the filesize when we add a typeZeroFillQuick atom. llvm-svn: 200369
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-271-35/+43
| | | | | | | | X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
* [ELF] Customize a relocation table output format (rel / rela).Simon Atanasyan2014-01-241-29/+56
| | | | | | | | | | 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
* Run clang-format on r197727.Rui Ueyama2013-12-201-7/+7
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Linking of shared libraries for MIPS little-endian 32-bit target.Simon Atanasyan2013-12-151-15/+25
| | | | | | | | | | | | | | | | | | | | | The following are the most significant peculiarities of MIPS target: - MIPS ABI requires some special tags in the dynamic table. - GOT consists of two parts local and global. The local part contains entries refer locally visible symbols. The global part contains entries refer global symbols. - Entries in the .dynsym section which have corresponded entries in the GOT should be: * Emitted at the end of .dynsym section * Sorted accordingly to theirs GOT counterparts - There are "paired" relocations. One or more R_MIPS_HI16 and R_MIPS_GOT16 relocations should be followed by R_MIPS_LO16 relocation. To calculate result of R_MIPS_HI16 and R_MIPS_GOT16 relocations we need to combine addends from these relocations and paired R_MIPS_LO16 relocation. The patch reviewed by Michael Spencer, Shankar Easwaran, Rui Ueyama. http://llvm-reviews.chandlerc.com/D2156 llvm-svn: 197342
* Make anonymous namespace as small as possible.Rui Ueyama2013-12-101-3/+2
| | | | | | Use of static is recommended by the style guide. llvm-svn: 196877
* Fix "doesnot", "endsup" typos and "lets" grammar issuesAlp Toker2013-12-021-3/+3
| | | | llvm-svn: 196056
* Fix "don't" typos missed in previous commitAlp Toker2013-12-011-3/+3
| | | | llvm-svn: 196054
* Fix a variety of typos in function names and commentsAlp Toker2013-12-011-2/+2
| | | | | | No change in functionality. llvm-svn: 196053
* Re-submit r194551: Use empty() instead of size() == 0.Rui Ueyama2013-11-131-2/+1
| | | | llvm-svn: 194556
* Revert "Use empty() instead of size() == 0."Rui Ueyama2013-11-131-1/+1
| | | | | | This reverts commit r194551 because it broke the buildbot. llvm-svn: 194552
* Use empty() instead of size() == 0.Rui Ueyama2013-11-131-1/+1
| | | | llvm-svn: 194551
* Delete unused constructor.Rui Ueyama2013-11-111-1/+0
| | | | llvm-svn: 194364
* [ELF] Un-break undef-from-main-dso.test on MSVC 2012.Rui Ueyama2013-11-101-2/+2
| | | | | | | | | | | | | | | | The result of sizeof(SymbolTable<ELFT>::SymbolEntry) in DynamicSymbolTable <ELFT>::write() was different from the same expression in RelocationTable <ELFT>::write(), although the same template parameters were passed. They were 40 and 32, respectively. As a result, the same vector was treated as a vector of 40 byte values in some places and a vector of 32 values in other places. That caused an weird issue, resulting in collapse of the rela.dyn section. I suspect that this is a padding size calculation bug in MSVC 2012, but I may be wrong. Reordering the fields to eliminate padding seems to fix the issue. llvm-svn: 194349
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-051-3/+3
| | | | llvm-svn: 194037
* [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
* [ELF] Implement minimal support for .eh_frame_hdr.Michael J. Spencer2013-10-301-0/+47
| | | | llvm-svn: 193662
* [ELF] Implement .{init,fini}_array ordering.Michael J. Spencer2013-10-251-0/+11
| | | | llvm-svn: 193451
* [ELF] Add COPY relocations.Michael J. Spencer2013-09-261-1/+5
| | | | llvm-svn: 191467
* [lld][ELF] Support non alloc sections in the Writer.Shankar Easwaran2013-09-191-26/+43
| | | | | | | | | 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-2/+4
| | | | | | | | | | 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/+5
| | | | | | | | 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-21/+9
| | | | | | | | | | 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] Rename typeTLV content type for ELFShankar Easwaran2013-08-231-8/+8
| | | | | | | | | | | 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
* [lld] handle typeZeroFill atoms in ELF/Native/YAMLShankar Easwaran2013-08-231-2/+1
| | | | | | | | | | | | | BSS atoms dont take any file space in the Input file. They are associated with a contentType(typeZeroFill). Similiar zero fill types also exist which have the same meaning in terms of occupying file space in the Input. These atoms have to be handled seperately when writing to the lld's intermediate file or the lld test infrastructure. Also adds a test. llvm-svn: 189136
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-31/+31
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by ↵Rui Ueyama2013-06-161-13/+14
| | | | | | | | | | | | 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-0/+12
| | | | llvm-svn: 184055
OpenPOWER on IntegriCloud