summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [macho] Allow CPUSubtype to contribute to architecture identificationDaniel Sanders2019-11-181-2/+6
| | | | | | | | | | | | | | | Summary: Sometimes the CPUSubtype determines the Triple::ArchType that must be used. Add the subtype to the API's to allow targets that need this to correctly identify the contents of the binary. Reviewers: pete Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70345
* [NFC] Add { } to silence compiler warning [-Wmissing-braces].Huihui Zhang2019-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Object/MachOObjectFile.cpp:2731:7: warning: suggest braces around initialization of subobject [-Wmissing-braces] "i386", "x86_64", "x86_64h", "armv4t", "arm", "armv5e", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { 1 warning generated. /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:46: warning: suggest braces around initialization of subobject [-Wmissing-braces] return addMappingFromTable<1>(MI, MRI, { 0 }, Table); ^ {} 1 warning generated. /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp:400:57: warning: suggest braces around initialization of subobject [-Wmissing-braces] static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'}; ^~~~~~~~~~~~~~~~~~ { } 1 warning generated. llvm-svn: 372811
* [yaml2obj/obj2yaml][MachO] Allow setting custom section dataSeiya Nuta2019-08-201-1/+6
| | | | | | | | | | | | | | Reviewers: alexshap, jhenderson, rupprecht Reviewed By: alexshap, jhenderson Subscribers: abrachet, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65799 llvm-svn: 369348
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-2/+2
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return ↵George Rimar2019-08-141-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expected<>" Changes: no changes. A fix for the clang code will be landed right on top. Original commit message: SectionRef::getName() returns std::error_code now. Returning Expected<> instead has multiple benefits. For example, it forces user to check the error returned. Also Expected<> may keep a valuable string error message, what is more useful than having a error code. (Object\invalid.test was updated to show the new messages printed.) This patch makes a change for all users to switch to Expected<> version. Note: in a few places the error returned was ignored before my changes. In such places I left them ignored. My intention was to convert the interface used, and not to improve and/or the existent users in this patch. (Though I think this is good idea for a follow-ups to revisit such places and either remove consumeError calls or comment each of them to clarify why it is OK to have them). Differential revision: https://reviews.llvm.org/D66089 llvm-svn: 368826
* Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return ↵George Rimar2019-08-141-9/+6
| | | | | | | | Expected<>" It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455 llvm-svn: 368813
* [llvm/Object] - Convert SectionRef::getName() to return Expected<>George Rimar2019-08-141-6/+9
| | | | | | | | | | | | | | | | | | | | | | | SectionRef::getName() returns std::error_code now. Returning Expected<> instead has multiple benefits. For example, it forces user to check the error returned. Also Expected<> may keep a valuable string error message, what is more useful than having a error code. (Object\invalid.test was updated to show the new messages printed.) This patch makes a change for all users to switch to Expected<> version. Note: in a few places the error returned was ignored before my changes. In such places I left them ignored. My intention was to convert the interface used, and not to improve and/or the existent users in this patch. (Though I think this is good idea for a follow-ups to revisit such places and either remove consumeError calls or comment each of them to clarify why it is OK to have them). Differential revision: https://reviews.llvm.org/D66089 llvm-svn: 368812
* Switch LLVM to use 64-bit offsets (2/5)Igor Kudrin2019-08-061-1/+1
| | | | | | | | | This updates all libraries and tools in LLVM Core to use 64-bit offsets which directly or indirectly come to DataExtractor. Differential Revision: https://reviews.llvm.org/D65638 llvm-svn: 368014
* Remove the static initialize introduced in r365099Steven Wu2019-07-181-9/+11
| | | | | | | | | | | | | | | | | | Summary: Some polish for r365099 which adds a static initializer to MachOObjectFile. Remove it by moving it to file scope. Reviewers: smeenai, alexshap, compnerd, mtrent, anushabasana Reviewed By: smeenai Subscribers: hiraditya, jkorous, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64873 llvm-svn: 366496
* [MachO] Add valid architecture functionShoaib Meenai2019-07-041-19/+10
| | | | | | | | | | | Added array of valid architectures and function returning array. Modified llvm-lipo to include list of valid architectures in error message for invalid arch. Patch by Anusha Basana <anusha.basana@gmail.com> Differential Revision: https://reviews.llvm.org/D63735 llvm-svn: 365099
* [MACHO] Replaced calls to getStruct with getStructOrErr in functions ↵Alex Brachet2019-06-041-33/+88
| | | | | | returning Error or Expected or similar llvm-svn: 362526
* AArch64: support binutils-like things on arm64_32.Tim Northover2019-05-141-2/+20
| | | | | | | | This adds support for the arm64_32 watchOS ABI to LLVM's low level tools, teaching them about the specific MachO choices and constants needed to disassemble things. llvm-svn: 360663
* [Object] Change ObjectFile::getSectionContents to return ↵Fangrui Song2019-05-141-4/+3
| | | | | | | | | | | | | | | | | | | Expected<ArrayRef<uint8_t>> Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef<uint8_t> as the underlying type, which is generally better than StringRef to represent binary data, so change the type to decrease the number of type conversions. Reviewed By: ruiu, sbc100 Differential Revision: https://reviews.llvm.org/D61781 llvm-svn: 360648
* [Object] Change getSectionName() to return Expected<StringRef>Fangrui Song2019-05-021-7/+4
| | | | | | | | | | Summary: It currently receives an output parameter and returns std::error_code. Expected<StringRef> fits for this purpose perfectly. Differential Revision: https://reviews.llvm.org/D61421 llvm-svn: 359774
* Remove duplicate line. NFCI.Simon Pilgrim2019-04-291-1/+0
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359483
* Fix Mach-O bind and rebase validation errors in libObjectMichael Trent2019-03-201-116/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump (via libObject) validates DYLD_INFO rebase and bind entries against the basic structure found in the Mach-O file before evaluating the contents of those entries. Certain malformed Mach-Os can defeat the validation check and force llvm-objdump (libObject) to crash. The previous logic verified a rebase or bind started in a valid Mach-O section, but did not verify that the section wholely contained the fixup. It also generally allows rebases or binds to start immediately after a valid section even if that range is not itself part of a valid section. Finally, bind and rebase opcodes that indicate more than one fixup (apply N times...) are not completely validated: only the first and final fixups are checked. The previous logic also rejected certain binaries as false positives. Some bind and rebase opcodes can modify the state machine such that the next bind or rebase will fail. libObject will reject these opcodes as invalid in order to be helpful and print an error message associated with the instruction that caused the problem, even though the binary is not actually illegal until it consumes the invalid state in the state machine. In other words, libObject may reject a Mach-O binary that Apple's dynamic linker may consider legal. The original version of macho-rebase-add-addr-uleb-too-big is an example of such a binary. I have replaced the existing checkSegAndOffset and checkCountAndSkip functions with a single function, checkSegAndOffsets, which validates all of the fixups realized by a DYLD_INFO opcode. checkSegAndOffsets verifies that a Mach-O section fully contains each fixup. Every fixup realized by an opcode is validated, and some (but not all!) inconsistencies in the state machine are allowed until a fixup is realized. This means that libObject may fail on an opcode that realizes a fixup, not on the opcode that introduced the arithmetic error. Existing test cases have been modified to reflect the changes in error messages returned by libObject. What's more, the test case for macho-rebase-add-addr-uleb-too-big has been modified so that it actually triggers the error condition; the new code in libObject considers the original test binary "legal". rdar://47797757 Reviewers: lhames, pete, ab Reviewed By: pete Subscribers: rupprecht, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59574 llvm-svn: 356629
* Detect malformed LC_LINKER_COMMANDs in Mach-O binariesMichael Trent2019-03-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump can be tricked into reading beyond valid memory and segfaulting if LC_LINKER_COMMAND strings are not null terminated. libObject does have code to validate the integrity of the LC_LINKER_COMMAND struct, but this validator improperly assumes linker command strings are null terminated. The solution is to report an error if a string extends beyond the end of the LC_LINKER_COMMAND struct. Reviewers: lhames, pete Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59179 llvm-svn: 355851
* objdump fails to parse Mach-O binaries with n_desc bearing stabsMichael Trent2019-02-231-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The objdump Mach-O parser uses MachOObjectFile::checkSymbolTable() to verify the symbol table is in a legal state before dereferencing the offsets in the table. This routine missed a test for N_STAB symbols when validating the two-level name space library ordinal for undefined symbols. If the binary in question contained a value in the n_desc high byte that is larger than the list of loaded dylibs, checkSymbolTable() will flag the library ordinal as being out of range. Most of the time the n_desc field is set to 0 or to small values, but old final linked binaries exist with N_STAB symbols bearing non-trivial n_desc fields. The change here is simply to verify a symbol is not an N_STAB symbol before consulting the values of n_other or n_desc. rdar://44977336 Reviewers: lhames, pete, ab Reviewed By: pete Subscribers: llvm-commits, rupprecht Tags: #llvm Differential Revision: https://reviews.llvm.org/D58568 llvm-svn: 354722
* Limit dyld image suffixes guessed by guessLibraryShortName()Michael Trent2019-01-241-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: guessLibraryShortName() separates a full Mach-O dylib install name path into a short name and a dyld image suffix. The short name is the name of the dylib without its path or extension. The dyld image suffix is a string used by dyld to load variants of dylibs if available at runtime; for example, "when binding this process, load 'debug' variants of all required dylibs." dyld knows exactly what the image suffix is, but by convention diagnostic tools such as llvm-nm attempt to guess suffix names by looking at the install name path. These dyld image suffixes are separated from the short name by a '_' character. Because the '_' character is commonly used to separate words in filenames guessLibraryShortName() cannot reliably separate a dylib's short name from an arbitrary image suffix; imagine if both the short name and the suffix contains an '_' character! To better deal with this ambiguity, guessLibraryShortName() will recognize only "_debug" and "_profile" as valid Suffix values. Calling code needs to be tolerant of guessLibraryShortName() guessing incorrectly. The previous implementation of guessLibraryShortName() did not allow '_' characters to appear in short names. When present, the short name would be truncated, e.g., "libcompiler_rt" => "libcompiler". This change allows "libcompiler_rt" and "libcompiler_rt_debug" to both be recognized as "libcompiler_rt". rdar://47412244 Reviewers: kledzik, lhames, pete Reviewed By: pete Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56978 llvm-svn: 352104
* 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
* [Object] Return a symbol_iterator, rather than a basic_symbol_iterator, fromLang Hames2019-01-141-1/+1
| | | | | | | | | | | | | | MachOObjectFile::getSymbolByIndex. ObjectFile derivatives should prefer symbol_iterator/SymbolRef over basic_symbol_iterator/BasicSymbolRef where possible, as the former retain their link to the ObjectFile (rather than a SymbolicFile) and provide more functionality. No test for this: Existing code is working, and we don't have (m)any libObject unit tests. I'll think about how we can test more systematically going forward. llvm-svn: 351128
* [MachO] Fix inconsistency between error messages when validating LC_DYSYMTABFrancis Visoiu Mistrih2018-09-041-2/+2
| | | | llvm-svn: 341379
* [MachO] Fix LC_DYSYMTAB validation for external symbolsFrancis Visoiu Mistrih2018-09-041-1/+1
| | | | | | | We were validating the same index (ilocalsym) twice, while iextdefsym was never validated. llvm-svn: 341378
* [llvm-readobj] Add -hex-dump (-x) optionPaul Semel2018-07-111-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D48281 llvm-svn: 336782
* [MachO] Add out-of-bounds check to MachOObjectFile.cppSam Clegg2018-06-041-0/+1
| | | | | | | | This is a followup to rL333496. Differential Revision: https://reviews.llvm.org/D47544 llvm-svn: 333929
* MC: Remove redundant substr() callSam Clegg2018-05-301-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D47047 llvm-svn: 333496
* [llvm-objdump] Print "..." instead of random data for virtual sectionsFrancis Visoiu Mistrih2018-04-191-2/+4
| | | | | | | | | | | | | | | | | When disassembling with -D, skip virtual sections by printing "..." for each symbol. This patch also implements `MachOObjectFile::isSectionVirtual`. Test case comes from: ``` .zerofill __DATA,__common,_data64unsigned,472,3 ``` Differential Revision: https://reviews.llvm.org/D45824 llvm-svn: 330342
* For llvm-objdump and Mach-O files, update the printing of some thread statesKevin Enderby2018-03-081-1/+49
| | | | | | | | | | | from core files. I tested this against the couple of core files that were getting errors about unknown thread flavors and it now produce the same output as the Xcode otool-classic(1) tool. Since the core files are huge I didn’t include them as test cases. rdar://38216356 llvm-svn: 327077
* Do not look up symbol names when n_strx == 0Michael Trent2018-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: Historical tools for working with mach-o binaries verify the nlist field n_strx has a non-zero value before using that value to retrieve symbol names. Under some cirumstances, llvm-nm will attempt to display the symbol name at position 0, even though symbol names at that position are not well defined. This change addresses this problem by returning an empty string when n_strx is zero. rdar://problem/35750548 Reviewers: enderby, davide Reviewed By: enderby, davide Subscribers: davide, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D41657 llvm-svn: 321773
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-151-1/+23
| | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. All tests are passing for llvm, clang, and lld. llvm-objdump builds without compiler warnings. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41199 llvm-svn: 320832
* Fix many -Wsign-compare and -Wtautological-constant-compare warnings.Zachary Turner2017-12-141-1/+1
| | | | | | | | | | | | Most of the -Wsign-compare warnings are due to the fact that enums are signed by default in the MS ABI, while the tautological comparison warnings trigger on x86 builds where sizeof(size_t) is 4 bytes, so N > numeric_limits<unsigned>::max() is always false. Differential Revision: https://reviews.llvm.org/D41256 llvm-svn: 320750
* reverting out -r320532 because a warning is breaking the lld buildMichael Trent2017-12-131-23/+1
| | | | llvm-svn: 320534
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-121-1/+23
| | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41061 llvm-svn: 320532
* Reverting r320166 to fix test failures.Michael Trent2017-12-081-23/+1
| | | | llvm-svn: 320174
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-081-1/+23
| | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40867 llvm-svn: 320166
* Untabify.NAKAMURA Takumi2017-10-181-3/+3
| | | | llvm-svn: 316079
* Fix typo in checkTwoLevelHintsCommandJessica Paquette2017-10-171-1/+1
| | | | | | BigSize had a copy/paste typo in it. This fixes that. llvm-svn: 316027
* [dwarfdump] Skip 'stripped' sectionsJonas Devlieghere2017-09-261-0/+6
| | | | | | | | | | | | | | | | | | | When dsymutil generates the companion file, its strips all unnecessary sections by omitting their body and setting the offset in their corresponding load command to zero. One such section is the .eh_frame section, as it contains runtime information rather than debug information and is part of the __TEXT segment. When reading this section, we would just read the number of bytes specified in the load command, starting from offset 0 (i.e. the beginning of the file). Rather than trying to parse this obviously invalid section, dwarfdump now skips this. Differential revision: https://reviews.llvm.org/D38135 llvm-svn: 314208
* [MachO] Prevent heap overflow when load command extends past EOFJonas Devlieghere2017-09-131-1/+4
| | | | | | | | | | | This patch fixes a heap-buffer-overflow when a malformed Mach-O has a load command who's size extends past the end of the binary. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3225 Differential revision: https://reviews.llvm.org/D37439 llvm-svn: 313145
* Untabify.NAKAMURA Takumi2017-08-281-12/+12
| | | | llvm-svn: 311875
* [MachO] Use Twines more efficiently.Benjamin Kramer2017-08-201-183/+229
| | | | llvm-svn: 311291
* [llvm] Update MachOObjectFile::exports interfaceAlexander Shaposhnikov2017-07-291-3/+2
| | | | | | | | | | This diff removes the second argument of the method MachOObjectFile::exports. In all in-tree uses this argument is equal to "this" and without this argument the interface seems to be cleaner. Test plan: make check-all llvm-svn: 309462
* Small tweak to one check in error handling to the dyld compact exportKevin Enderby2017-07-241-2/+2
| | | | | | | | | | entries in libObject (done in r308690). In the case when the last node has no children setting State.Current = Children + 1; where that would be past Trie.end() is actually ok since the pointer is not used with zero children. rdar://33490512 llvm-svn: 308924
* Add error handling to the dyld compact export entries in libObject.Kevin Enderby2017-07-201-22/+154
| | | | | | | | | | | | | | | | | | | | | lld needs a matching change for this will be my next commit. Expect it to fail build until that matching commit is picked up by the bots. Like the changes in r296527 for dyld bind entires and the changes in r298883 for lazy bind, weak bind and rebase entries the export entries are the last of the dyld compact info to have error handling added. This follows the model of iterators that can fail that Lang Hanes designed when fixing the problem for bad archives r275316 (or r275361). So that iterating through the exports now terminates if there is an error and returns an llvm::Error with an error message in all cases for malformed input. This change provides the plumbing for the error handling, all the needed testing of error conditions and test cases for all of the unique error messages. llvm-svn: 308690
* Updated llvm-objdump symbolic disassembly with x86_64 Mach-O MH_KEXT_BUNDLEKevin Enderby2017-06-221-9/+30
| | | | | | | | | file types so it symbolically disassembles operands using the external relocation entries. rdar://31521343 llvm-svn: 306037
* 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
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* [DWARF] Adding support for the DWARF v5 string offsets table ↵Wolfgang Pieb2017-06-061-0/+6
| | | | | | | | | | (consumer/reader part only). Reviewers: dblaikie, aprantl Differential Revision: https://reviews.llvm.org/D32779 llvm-svn: 304759
* [MachOObject] Fix bind opcode parser error on valid opcode sequenceSteven Wu2017-05-311-1/+1
| | | | | | | BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(0) is a valid way to setp library ordinal. MachOObject should set LibraryOrdinalSet even when IMM is zero. llvm-svn: 304362
* Recommit "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | addition to Low/High PC" With fix of uninitialized variable. Original commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304078
OpenPOWER on IntegriCloud