[all-commits] [llvm/llvm-project] ec05cc: [libunwind] [sparc] Add SPARCv9 support

Koakuma via All-commits all-commits at lists.llvm.org
Mon Feb 7 11:32:11 PST 2022

  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: ec05ccbc47156314217916b963d8bd9f664c37f8
  Author: Koakuma <koachan at protonmail.com>
  Date:   2022-02-07 (Mon, 07 Feb 2022)

  Changed paths:
    M libunwind/include/__libunwind_config.h
    M libunwind/src/DwarfInstructions.hpp
    M libunwind/src/DwarfParser.hpp
    M libunwind/src/Registers.hpp
    M libunwind/src/UnwindCursor.hpp
    M libunwind/src/UnwindRegistersRestore.S
    M libunwind/src/UnwindRegistersSave.S
    M libunwind/src/libunwind.cpp

  Log Message:
  [libunwind] [sparc] Add SPARCv9 support

Adds libunwind support for SPARCv9 (aka sparc64). This is a rebase of @kettenis' patch D32450, which I created (with his permission) because the original review has become inactive.
The changes are of a cosmetic nature to make it fit better with the new code style, and to reuse the existing SPARCv8 code, whenever possible.

Please let me know if I posted this on the wrong place. Also, the summary of the original review is reproduced below:

> This adds unwinder support for 64-bit SPARC (aka SPARCv9). The implementation was done on OpenBSD/sparc64, so it takes StackGhost into account:
> https://www.usenix.org/legacy/publications/library/proceedings/sec01/full_papers/frantzen/frantzen_html/index.html
> Since StackGhost xor's return addresses with a random cookie before storing them on the stack, the unwinder has to do some extra work to recover those. This is done by introducing a new kRegisterInCFADecrypt "location" type that is used to implement the DW_CFA_GNU_window_save opcode. That implementation is SPARC-specific, but should work for 32-bit SPARC as well. DW_CFA_GNU_window_save is only ever generated on SPARC as far as I know.

Co-authored-by: Mark Kettenis
Reviewed By: #libunwind, thesamesam, MaskRay, Arfrever

Differential Revision: https://reviews.llvm.org/D116857

(cherry picked from commit 2b9554b8850192bdd86c02eb671de1d866df8d87)

More information about the All-commits mailing list