summaryrefslogtreecommitdiffstats
path: root/libunwind
Commit message (Collapse)AuthorAgeFilesLines
...
* [libunwind] Handle .ARM.exidx tables without sentinel last entryMomchil Velikov2017-07-241-2/+9
| | | | | | | | | | | | | | | | | | | UnwindCursor<A, R>::getInfoFromEHABISection assumes the last entry in the index table never corresponds to a real function. Indeed, GNU ld always inserts an EXIDX_CANTUNWIND entry, containing the end of the .text section. However, the EHABI specification (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf) does not seem to contain text that requires the presence of a sentinel entry. In that sense the libunwind implementation isn't compliant with the specification. This patch makes getInfoFromEHABISection examine the last entry in the index table if upper_bound returns the end iterator. Fixes https://bugs.llvm.org/show_bug.cgi?id=31091 Differential revision: https://reviews.llvm.org/D35265 llvm-svn: 308871
* Bump docs version to 6.0Hans Wennborg2017-07-191-2/+2
| | | | llvm-svn: 308465
* [CMake] Set library dir to be LLVM's intermediate output dirPetr Hosek2017-07-181-1/+9
| | | | | | | | | This matches the behavior of libc++abi and libc++ and ensures that we get a working toolchain when building libunwind as part of LLVM. Differential Revision: https://reviews.llvm.org/D34375 llvm-svn: 308380
* [libunwind][CMake] Add install path variable to allow overriding the destinationPetr Hosek2017-07-112-2/+9
| | | | | | | | | This is going to be used by the runtime build in the multi-target setup to allow using different install prefix for each target. Differential Revision: https://reviews.llvm.org/D33760 llvm-svn: 307606
* Add a test harnessJonathan Roelofs2017-07-068-0/+200
| | | | | | | | | | Mostly cargo-culted from libcxxabi, since the unwinder was forked from there in the first place. There may still be cruft that's only applicable to libcxxabi, but that can be addressed in-tree. https://reviews.llvm.org/D35038 llvm-svn: 307266
* [libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONSNico Weber2017-06-271-3/+8
| | | | | | | | | | | | It's useful to be able to disable visibility annotations entirely; for example, if we're building libunwind static to include in another library, and we don't want any libunwind functions getting exported out of that library. https://reviews.llvm.org/D34637 Patch from Thomas Anderson <thomasanderson@chromium.org>! llvm-svn: 306442
* Change -1LL to -1ULL to silence a gcc warning about left shifting a negative ↵Marshall Clow2017-06-211-3/+3
| | | | | | value. Fixes https://bugs.llvm.org/show_bug.cgi?id=33358 llvm-svn: 305924
* [libunwind] Fix executable stack directive on Linux.Manoj Gupta2017-05-161-2/+2
| | | | | | | | | | | | | | | | Summary: Disable executable stack on Linux. Also remove redundant Android check as it is covered by Android. Reviewers: phosek, compnerd, rs, rmaprath, EricWF, krytarowski Reviewed By: krytarowski Subscribers: srhines, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33217 llvm-svn: 303206
* [CMake][libunwind] Fix the -target and -gcc-toolchain flag handlingPetr Hosek2017-04-162-4/+4
| | | | | | | | | | | | | CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. The compile flag handling had a typo which caused these flag not to be properly include. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32071 llvm-svn: 300419
* Reland "[CMake][libunwind] Use -nodefaultlibs for CMake checks"Petr Hosek2017-04-123-2/+105
| | | | | | | | | | | | | This is a reland of commit r299796. Turned out that we need gcc_s or compiler-rt on ARM when checking the support for -funwind-tables which creates a dependency on __aeabi_unwind_cpp_pr0 symbol that's provided by the compiler runtime. Differential Revision: https://reviews.llvm.org/D31858 llvm-svn: 300020
* Revert "[CMake][libunwind] Use -nodefaultlibs for CMake checks"Petr Hosek2017-04-071-23/+2
| | | | | | This reverts commit r299796. llvm-svn: 299798
* [CMake][libunwind] Use -nodefaultlibs for CMake checksPetr Hosek2017-04-071-2/+23
| | | | | | | | | | | | Since libunwind is built with -nodefaultlibs, we should be using this option even for CMake checks to avoid any inconsistency and also to avoid dependency on a working C++ standard library just for the setting up the build itself. The implementation is largely similar to the one used by libc++. Differential Revision: https://reviews.llvm.org/D31640 llvm-svn: 299796
* Fix unused typedef. Follow up to r299575.Ivan Krasin2017-04-061-1/+1
| | | | llvm-svn: 299666
* AddressSpace: fix DWARF based unwinding handling on AndroidSaleem Abdulrasool2017-04-051-2/+5
| | | | | | | It is possible that there are no program headers in the module. Do not attempt to dereference nullptr as a program header. llvm-svn: 299591
* Fix invalid memory access on android x86Saleem Abdulrasool2017-04-051-0/+17
| | | | | | | | | | On certain versions of android x86, the main module `app_process` is not built as PIE. When accessing the PT_GNU_EH_FRAME_HDR in such a scenario, the `dlpi_addr` is 0, but the virtual address is not relocated. Manually rebase the address to avoid an invalid memory access. llvm-svn: 299575
* Try to trigger the new docs builder. NFCJonathan Roelofs2017-04-031-0/+1
| | | | llvm-svn: 299381
* [libunwind] Clean up macro usage.Ranjeet Singh2017-03-3114-103/+87
| | | | | | | | Convention in libunwind is to use !defined(FOOT) not !FOO. Differential Revision: https://reviews.llvm.org/D31078 llvm-svn: 299225
* [libunwind] Add sphinx docsJonathan Roelofs2017-03-286-0/+544
| | | | | | https://reviews.llvm.org/D31375 llvm-svn: 298922
* DarwinParser: include limitsSaleem Abdulrasool2017-03-141-0/+1
| | | | | | | | | | | In debug mode, we have assertions that the values do not exceed the limits of the type holding them. In order to account for the type being derived from the AddressSpace and thus a typedef, we use `std::numeric_limits`. Include the appropriate header. Thanks to Marshal Clow for pointing out the missing include! llvm-svn: 297744
* Fix up the places where AddressSpace.hpp is included.Ed Schouten2017-03-096-4/+2
| | | | | | | | | | | | | | | | The AddressSpace.hpp header declares two classes: LocalAddressSpace and RemoteAddressSpace. These classes are only used in a very small number of source files, but passed in as template arguments to many other classes. Let's go ahead and only include AddressSpace.hpp in source files where at least one of these two classes is mentioned. This gets rid of a cyclic header dependency that was already present, but only caused breakage on macOS until recently. Reported by: Marshall Clow llvm-svn: 297364
* DARWF: silence some warnings about conversionsSaleem Abdulrasool2017-03-082-4/+7
| | | | | | | Add a check for an overflow and explicitly cast the value. We would have silently overflowed previously. llvm-svn: 297291
* Tidy up the way we include EHHeaderParser.hpp.Ed Schouten2017-03-071-4/+1
| | | | | | | Other source files in the source tree tend to include this header file unconditionally. It also parses perfectly fine on ARM EHABI systems. llvm-svn: 297175
* Improve readability and correctness of the OS specific libunwind bits.Ed Schouten2017-03-071-26/+25
| | | | | | | | | | | | | | | | | | | | | | | All of the access to __exidx_*, dl_iterate_phdr(), etc. is specific to the findUnwindSections() function. Right now all of the includes and declarations related to them are scattered throughout the source file. For example, for <link.h>, we have a full list of operating systems guarding the #include, even though the code that uses dl_iterate_phdr() miraculously doesn't use the same list. Change the code so that findUnwindSections() is preceded by a block of #ifdefs that share the same structure as the function itself. First comes all of the macOS specific bits, followed by bare-metal ARM, followed by ELF EHABI + DWARF. This actually allows us to build a copy of libunwind without any specific ifdefs for NetBSD, CloudABI, etc. It likely also unbreaks the build of libunwind on FreeBSD/armv6, though I can't confirm. Reviewed by: compnerd Differential Revision: https://reviews.llvm.org/D30696 llvm-svn: 297174
* Let arm_section_length store the number of bytes.Ed Schouten2017-03-072-9/+5
| | | | | | | | | | | | | | | | Exception section data that we extract for DWARF gets stored as the offset and the number of bytes. For ARM exception info, we seem to deviate from this by storing the number of entries. Attempt to make this more consistent. By storing the number of bytes, we can get rid of the EHTEntry structure declared in AddressSpace.hpp. In UnwindCursor.hpp we already have another structure declared for the same purpose. Reviewed by: Keith Walker Differential Revision: https://reviews.llvm.org/D30681 llvm-svn: 297149
* Drop the dependency on dl_unwind_find_exidx().Ed Schouten2017-03-051-31/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While porting libunwind over to CloudABI for ARMv6, I observed that this source file doesn't build, as it depends on dl_unwind_find_exidx(), which CloudABI's C library was lacking. After I added that function, I still needed to patch up libunwind to define _Unwind_Ptr. Taking a step back, I wonder why we need to make use of this function anyway. The unwinder already has some nice code to use dl_iterate_phdr() to scan for a PT_GNU_EH_FRAME header. The dl_unwind_find_exidx() does the same thing, except matching PT_ARM_EXIDX instead. We could also do that ourselves. This change gets rid of the dl_unwind_find_exidx() call and extends the dl_iterate_phdr() loop. This approach has the advantage of getting rid of some of those OS-specific #ifdefs. This now means that if an operating system only provides dl_iterate_phdr(), it gets support for unwinding on all architectures. There is no need to add more stuff, just to get ARMv6 support. This change is identical to r295944, except that it now adds the necessary code to do bounds checking on PT_LOAD. The previous version of this change lacked this, which didn't cause any problems on CloudABI, but did break the Linux build bots. This is why I reverted it in r295948. Differential Revision: https://reviews.llvm.org/D30306 llvm-svn: 296991
* Fix the project name in the license file.Arnaud A. de Grandmaison2017-02-271-2/+2
| | | | llvm-svn: 296359
* Add libcxxabi's LICENSE.TXT to libunwind.Arnaud A. de Grandmaison2017-02-271-0/+76
| | | | | | | | | | | When libunwind was spinned off libcxxabi, most file were copied from libcxxabi to libunwind. However, libc++abi's toplevel LICENSE.TXT was forgotten in the copying. It's considered a good practice to have the license file at the root of the project, and making linunwind a separate project was not supposed to change its licensing. Besides, several header files refer to the LICENSE.TXT, so copy the one from libc++abi. llvm-svn: 296358
* [libunwind] Disable calls to fprintf for baremetal targets.Ranjeet Singh2017-02-241-0/+11
| | | | | | | | | | We've been having issues with using libcxxabi and libunwind for baremetal targets because fprintf is dependent on io functions, this patch disables calls to fprintf when building for baremetal in release mode. Differential Revision: https://reviews.llvm.org/D30340 llvm-svn: 296135
* Revert r295944.Ed Schouten2017-02-231-28/+33
| | | | | | | | | | | | Even though the change works perfectly fine on CloudABI, it fails to work on the libcxx-libcxxabi-libunwind-arm-linux-noexceptions build bot. Looking at the code, this may be attributed to the fact that the code doesn't take the PT_LOAD addresses into consideration. I will rework this change to fix that and send out an updated version for review in the nearby future. llvm-svn: 295948
* Drop the dependency on dl_unwind_find_exidx().Ed Schouten2017-02-231-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | | While porting libunwind over to CloudABI for ARMv6, I observed that this source file doesn't build, as it depends on dl_unwind_find_exidx(), which CloudABI's C library was lacking. After I added that function, I still needed to patch up libunwind to define _Unwind_Ptr. Taking a step back, I wonder why we need to make use of this function anyway. The unwinder already has some nice code to use dl_iterate_phdr() to scan for a PT_GNU_EH_FRAME header. The dl_unwind_find_exidx() does the same thing, except matching PT_ARM_EXIDX instead. We could also do that ourselves. This change gets rid of the dl_unwind_find_exidx() call and extends the dl_iterate_phdr() loop. In addition to making the code a bit shorter, it has the advantage of getting rid of some of those OS-specific #ifdefs. This now means that if an operating system only provides dl_iterate_phdr(), it gets support for unwinding on all architectures. There is no need to add more stuff, just to get ARMv6 support. Differential Revision: https://reviews.llvm.org/D28082 llvm-svn: 295944
* [libunwind][CMake] Use libc++ headers when availablePetr Hosek2017-02-161-0/+20
| | | | | | | | | libunwind depends on C++ library headers. When building libunwind as part of LLVM and libc++ is available, use its headers. Differential Revision: https://reviews.llvm.org/D29997 llvm-svn: 295285
* Revert "[libunwind][CMake] Use libc++ headers when available"Petr Hosek2017-02-151-20/+0
| | | | | | | | | This causing build failure on sanitizer bots because of the unused argument '-nostdinc++' during linking of libunwind. This reverts commit 0e14fd1a1d37b9c6d55a2d3bc7649e5b39ce74d3. llvm-svn: 295202
* [libunwind][CMake] Use libc++ headers when availablePetr Hosek2017-02-151-0/+20
| | | | | | | | | libunwind depends on C++ library headers. When building libunwind as part of LLVM and libc++ is available, use its headers. Differential Revision: https://reviews.llvm.org/D29800 llvm-svn: 295153
* Revert "[libunwind][CMake] Use libc++ headers when available"Petr Hosek2017-02-091-19/+0
| | | | | | | | This is causing build failure when building libc++abi with libunwind. This reverts commit 42bf29501dfa79f211841de060386d539933e811. llvm-svn: 294556
* [libunwind][CMake] Use libc++ headers when availablePetr Hosek2017-02-091-0/+19
| | | | | | | | | libunwind depends on C++ library headers. When building libunwind as part of LLVM and libc++ is available, use its headers. Differential Revision: https://reviews.llvm.org/D29573 llvm-svn: 294554
* Revert "DWARF: convert error logs to _LIBUNWIND_LOG"Saleem Abdulrasool2017-01-272-17/+31
| | | | | | | | This reverts SVN r292721. Avoid the use of the GNU extension as the preprocessor in C++11 mode requires at least one argument, and this warning cannot be disabled, resulting in failing -Werror builds. llvm-svn: 293257
* DWARF: fix -Asserts buildsSaleem Abdulrasool2017-01-252-8/+10
| | | | | | no-op the DWARF tracing macros in non-debug builds. llvm-svn: 293008
* DWARF: correct cast (NFC)Saleem Abdulrasool2017-01-211-1/+1
| | | | | | Change the case of a PRIu64 value from `long` to `uint64_t`. NFC. llvm-svn: 292728
* X86: swap EBP, ESP on !APPLESaleem Abdulrasool2017-01-212-5/+16
| | | | | | | | | | | | | | | | | | | | Restore the `libunwind.h` enumeration values back to the inverted values. This diverges from the DWARF definition of the register values. However, this allows our header to be compatible with other unwind implementations (e.g. HP, GNU Savannah, GCC). The register IDs are only swapped in the header and need to be unswapped when accessing the unwind register file. The flipped EBP and ESP only applies on non-Apple x86 targets. When optimizations were enabled, EBP and ESP would no longer be equivalent. As a result, the incorrect access on Linux would manifest as a failure to unwind the stack. We can now unwind the stack with and without FPO on Linux x86. Resolves PR30879! llvm-svn: 292723
* DWARF: allow enabling tracing at runtimeSaleem Abdulrasool2017-01-212-89/+80
| | | | | | | Introduce `logDWARF` and the associated environment variable `LIBUNWIND_PRINT_DWARF` to trace the CFI instructions. llvm-svn: 292722
* DWARF: convert error logs to _LIBUNWIND_LOGSaleem Abdulrasool2017-01-212-31/+17
| | | | | | | Use the `_LIBUNWIND_LOG` macro instead of the explicit `fprintf` call. NFC. llvm-svn: 292721
* config: clean up some of the macro definitionSaleem Abdulrasool2017-01-211-21/+25
| | | | | | | | Unify the definition of `_LIBUNWIND_LOG_NON_ZERO` to make it clear what it is defined to and make the definition unconditional. Reorder the debug and tracing macros to be defined in the same order. NFC. llvm-svn: 292720
* rename OtherAddressSpace to RemoteAddressSpace; NFCSaleem Abdulrasool2017-01-212-22/+23
| | | | llvm-svn: 292719
* Don't dump llvm-config --cmakedir output if command fails.Eric Fiselier2017-01-141-1/+2
| | | | | | | | This patch adjusts the out-of-tree CMake configuration so that the stderr output is ignored when an old llvm-config is found that doesn't support --cmakedir. llvm-svn: 291992
* Bump version to 5.0.0svnHans Wennborg2017-01-121-1/+1
| | | | llvm-svn: 291830
* [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if availableMichal Gorny2017-01-091-1/+12
| | | | | | | | Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from llvm-config. Fallback to local reconstruction if llvm-config does not support this option. llvm-svn: 291505
* EHABI: mark some functions as exportedSaleem Abdulrasool2016-11-171-24/+17
| | | | | | | These are part of the EHABI specification and are exported to be available to users. Mark them as `_LIBUNWIND_EXPORT` like the rest of the unwind interfaces. llvm-svn: 287283
* [CMake] Get libunwind building under LLVM/runtimesPetr Hosek2016-11-082-4/+11
| | | | | | | | | | | | | | | The new LLVM runtimes directory requires the same conventions to be followed across the runtime projects. These changes make libunwind build under the runtimes subdirectory. This patch contains the following changes: * Rename LLVM_CONFIG to LLVM_CONFIG_PATH * Check if compiler supports C++11 (required by libunwind) Differential Revision: https://reviews.llvm.org/D26360 llvm-svn: 286308
* Add support for old versions of MacOS to libunwind. Fixes PR22203. Thanks to ↵Marshall Clow2016-11-021-4/+18
| | | | | | Jeremy for the bug report and the patch. llvm-svn: 285845
* Add conditions for PPC to libunwind. Fixes PR22200. Thanks to Jeremy for the ↵Marshall Clow2016-11-021-1/+2
| | | | | | bug report and the patch. llvm-svn: 285831
OpenPOWER on IntegriCloud