#
bb94611d |
| 03-Jun-2022 |
Alvin Wong <alvin@alvinhc.com> |
[COFF] Check table ptr more thoroughly and ignore empty sections
When loading split debug files for PE/COFF executables (produced with `objcopy --only-keep-debug`), the tables or directories in such
[COFF] Check table ptr more thoroughly and ignore empty sections
When loading split debug files for PE/COFF executables (produced with `objcopy --only-keep-debug`), the tables or directories in such files may point to data inside sections that may have been stripped. COFFObjectFile shall detect and gracefully handle this, to allow the object file be loaded without considering these tables or directories. This is required for LLDB to load these files for use as debug symbols.
COFFObjectFile shall also check these pointers more carefully to account for cases in which the section contains less raw data than the size given by VirtualSize, to prevent going out of bounds.
This commit also changes COFFDump in llvm-objdump to reuse the pointers that are already range-checked in COFFObjectFile. This fixes a crash when trying to dump the TLS directory from a stripped file.
Fixes https://github.com/mstorsjo/llvm-mingw/issues/284
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D126898
show more ...
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
#
6ec18aaf |
| 28-Feb-2022 |
Martin Storsjö <martin@martin.st> |
[Object] [COFF] Improve error messages
This aids debugging when working with possibly broken files, instead of just flat out erroring out without telling what's wrong.
Differential Revision: https:
[Object] [COFF] Improve error messages
This aids debugging when working with possibly broken files, instead of just flat out erroring out without telling what's wrong.
Differential Revision: https://reviews.llvm.org/D120679
show more ...
|
#
e72c195f |
| 10-Feb-2022 |
serge-sans-paille <sguelton@redhat.com> |
Cleanup LLVMObject headers
Most notably,
llvm/Object/Binary.h no longer includes llvm/Support/MemoryBuffer.h llvm/Object/MachOUniversal*.h no longer include llvm/Object/Archive.h llvm/Object/TapiUn
Cleanup LLVMObject headers
Most notably,
llvm/Object/Binary.h no longer includes llvm/Support/MemoryBuffer.h llvm/Object/MachOUniversal*.h no longer include llvm/Object/Archive.h llvm/Object/TapiUniversal.h no longer includes llvm/Object/TapiFile.h
llvm-project preprocessed size: before: 1068185081 after: 1068324320
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D119457
show more ...
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
#
bf809cd1 |
| 26-May-2021 |
Esme-Yi <esme.yi@ibm.com> |
[NFC][object] Change the input parameter of the method isDebugSection.
Summary: This is a NFC patch to change the input parameter of the method SectionRef::isDebugSection(), by replacing the StringR
[NFC][object] Change the input parameter of the method isDebugSection.
Summary: This is a NFC patch to change the input parameter of the method SectionRef::isDebugSection(), by replacing the StringRef SectionName with DataRefImpl Sec. This allows us to determine if a section is debug type in more ways than just by section name.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D102601
show more ...
|
Revision tags: llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2 |
|
#
352fcfc6 |
| 17-Jan-2021 |
Kazu Hirata <kazu@google.com> |
[llvm] Use llvm::sort (NFC)
|
Revision tags: llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6 |
|
#
22cf54a7 |
| 23-Mar-2020 |
Arthur O'Dwyer <arthur.j.odwyer@gmail.com> |
Replace `T(x)` with `reinterpret_cast<T>(x)` everywhere it means reinterpret_cast. NFC.
Differential Revision: https://reviews.llvm.org/D76572
|
#
2980ce98 |
| 18-Oct-2020 |
Hubert Tong <hubert.reinterpretcast@gmail.com> |
Fix various format specifier mismatches
Format specifiers of incorrect length are replaced with format specifier macros from `<cinttypes>` matching the typedefs used to declare the type of the value
Fix various format specifier mismatches
Format specifiers of incorrect length are replaced with format specifier macros from `<cinttypes>` matching the typedefs used to declare the type of the value being printed.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D89637
show more ...
|
#
568035ac |
| 08-Oct-2020 |
Luqman Aden <me@luqman.ca> |
[llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.
Akin to dumpbin's /TLS option, this will print out the TLS directory, if present, in the image.
Example output: ``` > llv
[llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.
Akin to dumpbin's /TLS option, this will print out the TLS directory, if present, in the image.
Example output: ``` > llvm-readobj --coff-tls-directory test.exe File: test.exe Format: COFF-x86-64 Arch: x86_64 AddressSize: 64bit TLSDirectory { StartAddressOfRawData: 0x140004000 EndAddressOfRawData: 0x140004040 AddressOfIndex: 0x140002000 AddressOfCallBacks: 0x0 SizeOfZeroFill: 0x0 Characteristics [ (0x0) ] } ```
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D88635
show more ...
|
#
1c03389c |
| 11-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Re-land "Migrate the rest of COFFObjectFile to Error"
This reverts commit 101fbc01382edd89ea7b671104c68b30b2446cc0.
Remove leftover debugging attribute.
Update LLDB as well, which was missed befor
Re-land "Migrate the rest of COFFObjectFile to Error"
This reverts commit 101fbc01382edd89ea7b671104c68b30b2446cc0.
Remove leftover debugging attribute.
Update LLDB as well, which was missed before.
show more ...
|
#
101fbc01 |
| 06-Jun-2020 |
Nico Weber <thakis@chromium.org> |
Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b865d2a73cf90819e20a96fb8414ab0b. __attribute__((optnone)) doesn't build with msvc, see http://lab.llvm.org:8011/buil
Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b865d2a73cf90819e20a96fb8414ab0b. __attribute__((optnone)) doesn't build with msvc, see http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/16326
show more ...
|
#
b5289656 |
| 05-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Migrate the rest of COFFObjectFile to Error
|
#
e03a135b |
| 05-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Re-land "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 38f3ba591e3a64fa5bbe684b3171c7bda6c5b527.
Fix the XCOFF error handling. Unlike std::error_code, Error must be
Re-land "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 38f3ba591e3a64fa5bbe684b3171c7bda6c5b527.
Fix the XCOFF error handling. Unlike std::error_code, Error must be consumed or handled.
show more ...
|
#
38f3ba59 |
| 05-Jun-2020 |
Nico Weber <thakis@chromium.org> |
Revert "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 74bd98829d82312676a60c5c2d142e20691b2f13. Breaks LLVM::section-headers.test everywhere, see e.g. http://lab.llv
Revert "Migrate Binary::checkOffset from error_code to Error, NFC"
This reverts commit 74bd98829d82312676a60c5c2d142e20691b2f13. Breaks LLVM::section-headers.test everywhere, see e.g. http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29940/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Asection-headers.test
show more ...
|
#
74bd9882 |
| 05-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Migrate Binary::checkOffset from error_code to Error, NFC
In my use case, this saved 100ms of time doing one-time-initialization for std::error_code().
|
#
0ea52537 |
| 28-May-2020 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
SymbolicFile.h - removed unused FileSystem.h include. NFC.
Exposes a number of implicit dependencies that needs fixing in source files and XCOFFObjectFile.h.
|
#
39772063 |
| 08-May-2020 |
Reid Kleckner <rnk@google.com> |
[COFF] Use Expected in COFFObjectFile creation
The constructor error out parameter was a bit awkward. Wrap it in a factory method which can return an error. Make the constructor private.
|
#
77ecf90c |
| 08-May-2020 |
Reid Kleckner <rnk@google.com> |
[COFF] Migrate COFFObjectFile to Expected<T>
I noticed that std::error_code() does one-time initialization. Avoid that overhead with Expected<T> and llvm::Error. Also, it is consistent with the virt
[COFF] Migrate COFFObjectFile to Expected<T>
I noticed that std::error_code() does one-time initialization. Avoid that overhead with Expected<T> and llvm::Error. Also, it is consistent with the virtual interface and ELF, and generally cleaner.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D79643
show more ...
|
#
ff6a0b6a |
| 02-May-2020 |
Xing GUO <higuoxing@gmail.com> |
[Object] Change ObjectFile::getSymbolValue() return type to Expected<uint64_t>
Summary: In D77860, we have changed `getSymbolFlags()` return type to `Expected<uint32_t>`. This change helps bubble th
[Object] Change ObjectFile::getSymbolValue() return type to Expected<uint64_t>
Summary: In D77860, we have changed `getSymbolFlags()` return type to `Expected<uint32_t>`. This change helps bubble the error further up the stack.
Reviewers: jhenderson, grimar, JDevlieghere, MaskRay
Reviewed By: jhenderson
Subscribers: hiraditya, MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79075
show more ...
|
#
ac00376a |
| 10-Apr-2020 |
vgxbj <higuoxing@gmail.com> |
[Object] Change uint32_t getSymbolFlags() to Expected<uint32_t> getSymbolFlags().
This change enables getSymbolFlags() to return errors which benefit error reporting in clients.
Differential Revisi
[Object] Change uint32_t getSymbolFlags() to Expected<uint32_t> getSymbolFlags().
This change enables getSymbolFlags() to return errors which benefit error reporting in clients.
Differential Revision: https://reviews.llvm.org/D77860
show more ...
|
#
29d253c4 |
| 02-Apr-2020 |
Djordje Todorovic <djordje.todorovic@syrmia.com> |
[Object] Add the method for checking if a section is a debug section
Different file formats have different naming style for the debug sections. The method is implemented for ELF, COFF and Mach-O for
[Object] Add the method for checking if a section is a debug section
Different file formats have different naming style for the debug sections. The method is implemented for ELF, COFF and Mach-O formats.
Differential Revision: https://reviews.llvm.org/D76276
show more ...
|
Revision tags: llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3 |
|
#
400b6c08 |
| 24-Feb-2020 |
serge-sans-paille <sguelton@redhat.com> |
[NFC] Fix typo in error message
|
Revision tags: llvmorg-10.0.0-rc2 |
|
#
c55cf4af |
| 10-Feb-2020 |
Bill Wendling <isanbard@gmail.com> |
Revert "Remove redundant "std::move"s in return statements"
The build failed with
error: call to deleted constructor of 'llvm::Error'
errors.
This reverts commit 1c2241a7936bf85aa68aef94bd40c3b
Revert "Remove redundant "std::move"s in return statements"
The build failed with
error: call to deleted constructor of 'llvm::Error'
errors.
This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
show more ...
|
#
1c2241a7 |
| 10-Feb-2020 |
Bill Wendling <isanbard@gmail.com> |
Remove redundant "std::move"s in return statements
|
Revision tags: llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3 |
|
#
94382217 |
| 30-Aug-2019 |
Martin Storsjo <martin@martin.st> |
[COFF] Add a ResourceSectionRef method for getting resource contents
This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like i
[COFF] Add a ResourceSectionRef method for getting resource contents
This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like it already does for plain .res files.
This requires providing the whole COFFObjectFile to ResourceSectionRef.
This supports both object files and executables. For executables, the DataRVA field is used as is to look up the right section.
For object files, ideally we would need to complete linking of them and fix up all relocations to know what the DataRVA field would end up being. In practice, the only thing that makes sense for an RVA field is an ADDR32NB relocation. Thus, find a relocation pointing at this field, verify that it has the expected type, locate the symbol it points at, look up the section the symbol points at, and read from the right offset in that section.
This works both for GNU windres object files (which use one single .rsrc section, with all relocations against the base of the .rsrc section, with the original value of the DataRVA field being the offset of the data from the beginning of the .rsrc section) and cvtres object files (with two separate .rsrc$01 and .rsrc$02 sections, and one symbol per data entry, with the original pre-relocated DataRVA field being set to zero).
Differential Revision: https://reviews.llvm.org/D66820
llvm-svn: 370433
show more ...
|
#
7ba81d95 |
| 29-Aug-2019 |
Martin Storsjo <martin@martin.st> |
[COFF] Add a ResourceSectionRef method for getting the data entry, print it in llvm-readobj
Differential Revision: https://reviews.llvm.org/D66819
llvm-svn: 370311
|