summaryrefslogtreecommitdiffstats
path: root/lld/ELF/EhFrame.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ELF] Wrap things in `namespace lld { namespace elf {`, NFCFangrui Song2019-10-071-5/+7
| | | | | | | | | | | This makes it clear `ELF/**/*.cpp` files define things in the `lld::elf` namespace and simplifies `elf::foo` to `foo`. Reviewed By: atanasyan, grimar, ruiu Differential Revision: https://reviews.llvm.org/D68323 llvm-svn: 373885
* [Coding style change] Rename variables so that they start with a lowercase ↵Rui Ueyama2019-07-101-65/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | letter This patch is mechanically generated by clang-llvm-rename tool that I wrote using Clang Refactoring Engine just for creating this patch. You can see the source code of the tool at https://reviews.llvm.org/D64123. There's no manual post-processing; you can generate the same patch by re-running the tool against lld's code base. Here is the main discussion thread to change the LLVM coding style: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130083.html In the discussion thread, I proposed we use lld as a testbed for variable naming scheme change, and this patch does that. I chose to rename variables so that they are in camelCase, just because that is a minimal change to make variables to start with a lowercase letter. Note to downstream patch maintainers: if you are maintaining a downstream lld repo, just rebasing ahead of this commit would cause massive merge conflicts because this patch essentially changes every line in the lld subdirectory. But there's a remedy. clang-llvm-rename tool is a batch tool, so you can rename variables in your downstream repo with the tool. Given that, here is how to rebase your repo to a commit after the mass renaming: 1. rebase to the commit just before the mass variable renaming, 2. apply the tool to your downstream repo to mass-rename variables locally, and 3. rebase again to the head. Most changes made by the tool should be identical for a downstream repo and for the head, so at the step 3, almost all changes should be merged and disappear. I'd expect that there would be some lines that you need to merge by hand, but that shouldn't be too many. Differential Revision: https://reviews.llvm.org/D64121 llvm-svn: 365595
* [ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h ↵Fangrui Song2019-03-291-1/+1
| | | | | | utilities. NFC llvm-svn: 357269
* 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
* Avoid unnecessary buffer allocation and memcpy for compressed sections.Rui Ueyama2018-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we uncompress all compressed sections before doing anything. That works, and that is conceptually simple, but that could results in a waste of CPU time and memory if uncompressed sections are then discarded or just copied to the output buffer. In particular, if .debug_gnu_pub{names,types} are compressed and if no -gdb-index option is given, we wasted CPU and memory because we uncompress them into newly allocated bufers and then memcpy the buffers to the output buffer. That temporary buffer was redundant. This patch changes how to uncompress sections. Now, compressed sections are uncompressed lazily. To do that, `Data` member of `InputSectionBase` is now hidden from outside, and `data()` accessor automatically expands an compressed buffer if necessary. If no one calls `data()`, then `writeTo()` directly uncompresses compressed data into the output buffer. That eliminates the redundant memory allocation and redundant memcpy. This patch significantly reduces memory consumption (20 GiB max RSS to 15 Gib) for an executable whose .debug_gnu_pub{names,types} are in total 5 GiB in an uncompressed form. Differential Revision: https://reviews.llvm.org/D52917 llvm-svn: 343979
* [ELF] Simplify read32. NFCFangrui Song2018-03-301-3/+2
| | | | llvm-svn: 328908
* Merge {COFF,ELF}/Strings.cpp to Common/Strings.cpp.Rui Ueyama2018-02-281-1/+1
| | | | | | | | | This should resolve the issue that lld build fails in some hosts that uses case-insensitive file system. Differential Revision: https://reviews.llvm.org/D43788 llvm-svn: 326339
* Consistent (non) use of empty lines in include blocksSam Clegg2018-02-201-1/+0
| | | | | | | | | The profailing style in lld seem to be to not include such empty lines. Clang-tidy/clang-format seem to handle this just fine. Differential Revision: https://reviews.llvm.org/D43528 llvm-svn: 325629
* De-template EhReader. NFC.Rui Ueyama2017-10-271-24/+13
| | | | llvm-svn: 316733
* De-template elf::getObjMsg. NFC.Rui Ueyama2017-10-271-1/+1
| | | | llvm-svn: 316732
* [lld] unified COFF and ELF error handling on new Common/ErrorHandlerBob Haarman2017-10-251-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The COFF linker and the ELF linker have long had similar but separate Error.h and Error.cpp files to implement error handling. This change introduces new error handling code in Common/ErrorHandler.h, changes the COFF and ELF linkers to use it, and removes the old, separate implementations. Reviewers: ruiu Reviewed By: ruiu Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D39259 llvm-svn: 316624
* Revert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."NAKAMURA Takumi2017-09-201-11/+6
| | | | | | | It broke selfhosting. http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/4896 llvm-svn: 313731
* Compact EhSectionPiece from 32 bytes to 16 bytes.Rui Ueyama2017-09-191-6/+11
| | | | | | | | | | | | | | EhSectionPiece used to have a pointer to a section, but that pointer was mostly redundant because we almost always know what the section is without using that pointer. This patch removes the pointer from the struct. This patch also use uint32_t/int32_t instead of size_t to represent offsets that are hardly be larger than 4 GiB. At the moment, I think it is OK even if we cannot handle .eh_frame sections larger than 4 GiB. Differential Revision: https://reviews.llvm.org/D38012 llvm-svn: 313697
* Rename EhSectionPiece::ID -> EhSectionPiece::Sec.Rui Ueyama2017-09-181-2/+1
| | | | | | ID sounds like an identifier, but this is actually a pointer to a section. llvm-svn: 313588
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Change the error format to report corrupted .eh_frame.Rui Ueyama2017-04-011-2/+2
| | | | llvm-svn: 299289
* Compute Config member function return values only once.Rui Ueyama2017-03-171-3/+3
| | | | | | | | | | | We had a few Config member functions that returns configuration values. For example, we had is64() which returns true if the target is 64-bit. The return values of these functions are constant and never change. This patch is to compute them only once to make it clear that they'll never change. llvm-svn: 298168
* Define Config::isLE and Config::wordsize.Rui Ueyama2017-03-171-1/+1
| | | | | | | isLE() return true if the target is little-endian. wordsize() returns 8 for 64-bit and 4 for 32-bit. llvm-svn: 298167
* Convert InputSectionBase to a class.Rafael Espindola2017-02-231-13/+10
| | | | | | | Removing this template is not a big win by itself, but opens the way for removing more templates. llvm-svn: 295923
* Add a comment about the copy relocation.Rui Ueyama2017-02-191-0/+1
| | | | llvm-svn: 295622
* Move getLocation from Relocations.cpp to InputSection.cpp.Rui Ueyama2016-11-251-2/+1
| | | | | | | | The function was used only within Relocations.cpp, but now we are using it in many places, so this patch moves it to a file that fits to the functionality. llvm-svn: 287943
* [ELF] Print error location in .eh_frame parserEugene Leviant2016-11-231-44/+88
| | | | | | Differential revision: https://reviews.llvm.org/D26914 llvm-svn: 287750
* Split getFdeEncoding.Rui Ueyama2016-11-191-10/+15
| | | | llvm-svn: 287452
* Fix typo in error message.Rui Ueyama2016-11-191-1/+1
| | | | llvm-svn: 287451
* [ELF] Allow arbitrary code alignment in .eh_framePetr Hosek2016-07-291-3/+2
| | | | | | | | | According to the specification, CIE code alignment factor is an arbitrary unsigned LEB128 encoded value. Differential revision: https://reviews.llvm.org/D22954 llvm-svn: 277105
* ELF: Handle empty CIE augmentation stringEd Maste2016-05-251-1/+1
| | | | | | | | | | | "A zero length string indicates that no augmentation data is present." The FreeBSD/mips toolchain (GCC 4.2.1) generates .debug_frame sections containing CIE records that have an empty augmentation string. Differential Revision: http://reviews.llvm.org/D19928 llvm-svn: 270706
* Create a new file EhFrame.cpp and move code to read .eh_frame there.Rui Ueyama2016-05-241-0/+167
llvm-svn: 270526
OpenPOWER on IntegriCloud