summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Regroup code creates ELF relocations references ELFReference intoSimon Atanasyan2014-04-123-118/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a couple of new virtual functions. Follow-up to the rL203408. Two virtual functions `createRelocationReference()` responsible for creation of `ELFReference` have been replaced by a couple of new virtual functions `createRelocationReferences()` (plural). Each former function creates a //single// ELFReference for a specified `Elf_Rela` or `Elf_Rel` relocation records. The new functions responsible for creation of //all// relocation references for provided symbol. For all targets except MIPS there are no functional changes. MIPS ABI has a notion of //paired// relocations. An effective addend of such relocations are calculated using addends of both pair's members. Each `R_MIPS_HI16` and `R_MIPS_GOT16` (for local symbols) relocations must have an associated `R_MIPS_LO16` entry immediately following it in the list of relocations. Immediately does not mean "next record" in relocations section but "next record referenced the same symbol". Moreover a single `R_MIPS_LO16` relocation can be paired with multiple preceding `R_MIPS_HI16/R_MIPS_GOT16` relocations. The paired relocation can have offsets belong to the different symbols. That is why we need to have access to list of all relocations during construction of `ELFReference` for MIPS target. The patch reviewed by Shankar Easwaran. llvm-svn: 206102
* [Mips] Factor out MIPS relocation addend reading to the separateSimon Atanasyan2014-04-111-8/+12
| | | | | | | | function. No functional changes. llvm-svn: 206023
* [ELF] Remove redundant conversion of section content from ArrayRef toSimon Atanasyan2014-04-111-8/+3
| | | | | | | | | StringRef before calling the createSectionAtom() method and reverse conversion inside the method. No functional changes. llvm-svn: 206022
* [Mips] R_MIPS_PC32 relocation support.Simon Atanasyan2014-04-114-0/+12
| | | | llvm-svn: 206018
* Update to match changes made in r205955David Majnemer2014-04-102-0/+7
| | | | llvm-svn: 205956
* [PECOFF] Fix common symbol alignment.Rui Ueyama2014-04-091-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D3322 llvm-svn: 205826
* [ELF] Use typedefs to make class field declarations shorter.Simon Atanasyan2014-04-061-7/+4
| | | | | | No functional changes. llvm-svn: 205692
* [X86-64] Add missing relocation.Michael J. Spencer2014-04-041-1/+1
| | | | llvm-svn: 205645
* This is yet another case clang-modernize failed to add "override".Rui Ueyama2014-04-041-6/+3
| | | | llvm-svn: 205644
* Rename getInputGraph() and getNextFile().Rui Ueyama2014-04-041-1/+2
| | | | | | | | | Seems getSomething() is more common naming scheme than just a noun to get something, so renaming these members. Differential Revision: http://llvm-reviews.chandlerc.com/D3285 llvm-svn: 205589
* Fix comments.Rui Ueyama2014-04-035-6/+6
| | | | llvm-svn: 205568
* Add empty() to atom_collection.Rui Ueyama2014-04-031-1/+1
| | | | | | | | | "x.empty()" is more idiomatic than "x.size() == 0". This patch is to add such method and use it in LLD. Differential Revision: http://llvm-reviews.chandlerc.com/D3279 llvm-svn: 205558
* s/llvm::dyn_cast/dyn_cast/Rui Ueyama2014-04-023-4/+1
| | | | llvm-svn: 205404
* Rename insertOneElementAt -> insertElementAt.Rui Ueyama2014-04-011-2/+1
| | | | | | | insertElementsAt() is removed, so "One" in insertOneElementAt() no longer make much sense. Rename it for brevity. llvm-svn: 205372
* [core] support .gnu.linkonce sectionsShankar Easwaran2014-04-012-3/+4
| | | | | | | | | | | | | | | | | | .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-312-9/+4
| | | | | | | | | 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-312-4/+9
| | | | | | | | | | | .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
* [MachO] Remove "virtual" and add "override".Rui Ueyama2014-03-288-85/+81
| | | | llvm-svn: 205057
* [ELF] Add "override" and remove "virtual".Rui Ueyama2014-03-2818-281/+224
| | | | llvm-svn: 205056
* Attempt to unbreak buildbots.Rui Ueyama2014-03-281-1/+1
| | | | llvm-svn: 205034
* [ELF] Support --defsym option to define an absolute symbol.Rui Ueyama2014-03-282-3/+33
| | | | | | | | | | | | | | | | | This patch is to support --defsym option for ELF file format/GNU-compatible driver. Currently it takes a symbol name followed by '=' and a number. If such option is given, the driver sets up an absolute symbol with the specified address. You can specify multiple --defsym options to define multiple symbols. GNU LD's --defsym provides many more features. For example, it allows users to specify another symbol name instead of a number to define a symbol alias, or it even allows a symbol plus an offset (e.g. --defsym=foo+3) to define symbol- relative alias. This patch does not support that, but will be supported in subsequent patches. Differential Revision: http://llvm-reviews.chandlerc.com/D3208 llvm-svn: 205029
* Fix format.Rui Ueyama2014-03-281-1/+1
| | | | llvm-svn: 204989
* [ELF] Remove class declarations that do nothing.Rui Ueyama2014-03-281-76/+0
| | | | | | | These classes are declared in a .cpp file but not used in the same compliation unit. They seems to have been copy-and-pasted from ELFReader.h. llvm-svn: 204988
* Make anonymous namespace as small as possible.Rui Ueyama2014-03-272-27/+22
| | | | llvm-svn: 204982
* [core] add SectionGroup supportShankar Easwaran2014-03-263-10/+119
| | | | | | Review : http://llvm-reviews.chandlerc.com/D3182 llvm-svn: 204830
* [Mips] Fix formatting.Simon Atanasyan2014-03-241-1/+1
| | | | llvm-svn: 204607
* [Mips] Sort R_MIPS_LO16 / R_MIPS_HI16 / R_MIPS_GOT16 before findingSimon Atanasyan2014-03-241-9/+29
| | | | | | pairs and calculate AHL addend. llvm-svn: 204606
* [Mips] Emit LA25 MIPS stubs to call pic code from non-pic routines.Simon Atanasyan2014-03-212-22/+137
| | | | llvm-svn: 204503
* [Mips] Fix source code formatting. No functional changes.Simon Atanasyan2014-03-211-11/+11
| | | | llvm-svn: 204472
* [Mips] Reduce the number of 'const' casts.Simon Atanasyan2014-03-201-14/+14
| | | | llvm-svn: 204355
* [Mips] Join two for loops over defined atoms into the single one.Simon Atanasyan2014-03-201-4/+3
| | | | llvm-svn: 204354
* [Mips] Remove the dead code.Simon Atanasyan2014-03-201-4/+0
| | | | llvm-svn: 204353
* [Mips] Remove unused member function argument.Simon Atanasyan2014-03-201-4/+3
| | | | llvm-svn: 204352
* Revert "[ELF] Order DT_NEEDED entries by command line order."Rui Ueyama2014-03-201-22/+5
| | | | | | This reverts commit r204291 because it broke buildbots. llvm-svn: 204317
* [ELF] Order DT_NEEDED entries by command line order.Michael J. Spencer2014-03-201-5/+22
| | | | | | With this all test-suite tests pass with lld on x86-64 Linux. llvm-svn: 204291
* [Mips] Remove unused function.Simon Atanasyan2014-03-191-7/+0
| | | | llvm-svn: 204248
* [Mips] Fix handling of R_MIPS_GOT16 relocation and building local partSimon Atanasyan2014-03-195-9/+29
| | | | | | | | | of GOT. * Read addend for R_MIPS_GOT16 relocation. * Put only high 16 bits of symbol + addend into GOT entries for locally visible symbols. llvm-svn: 204247
* [Mips] Handle R_MIPS_GOT16 relocation for external and local symbols inSimon Atanasyan2014-03-194-9/+0
| | | | | | a uniform way. llvm-svn: 204246
* [Mips] Factor out the code creates GOT entry atoms into the twoSimon Atanasyan2014-03-191-16/+36
| | | | | | | functions. The first one is for local GOT entries. The second one is for global GOT entries. llvm-svn: 204245
* [Mips] Add 'const' qualifier to the function.Simon Atanasyan2014-03-191-2/+2
| | | | llvm-svn: 204244
* [Mips] Move AHL addends calculation to the RelocationPass class.Simon Atanasyan2014-03-193-67/+46
| | | | llvm-svn: 204243
* [Mips] Move RelocationPass class member function definitions out of theSimon Atanasyan2014-03-191-197/+215
| | | | | | class. llvm-svn: 204242
* [PECOFF] Fix -Wsign-compare warning.Simon Atanasyan2014-03-191-1/+1
| | | | llvm-svn: 204223
* [ELF] Remove unused fields (linking context references).Simon Atanasyan2014-03-195-15/+9
| | | | llvm-svn: 204222
* Fix warning 'enumeral and non-enumeral type in conditional expression'.Simon Atanasyan2014-03-191-1/+1
| | | | llvm-svn: 204221
* Remove extra semicolon for -WpedanticAlexey Samsonov2014-03-191-6/+6
| | | | llvm-svn: 204219
* [PECOFF] Support yet another new type of weak symbol.Rui Ueyama2014-03-182-1/+4
| | | | | | | | | | COMDAT_SELECT_LARGEST is a COMDAT type that make linker to choose the largest definition from among all of the definition of a symbol. If the size is the same, the choice is arbitrary. Differential Revision: http://llvm-reviews.chandlerc.com/D3011 llvm-svn: 204172
* Fix lld buildAlexey Samsonov2014-03-181-12/+8
| | | | llvm-svn: 204122
* [PECOFF] Data type of SectionNumber is now unsigned (r203986).Rui Ueyama2014-03-151-4/+2
| | | | | | So we don't need static_cast's to convert it from signed to unsigned. llvm-svn: 203992
* Remove redundant "virtual" keyword.Rui Ueyama2014-03-141-1/+1
| | | | llvm-svn: 203903
OpenPOWER on IntegriCloud