[PATCH] D154815: [BOLT] Add reading support for Linux ORC sections

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 9 22:24:45 PDT 2023


maksfb created this revision.
maksfb added reviewers: Elvina, treapster, jobnoorman, yota9, Amir, ayermolo, rafauler.
Herald added a project: All.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Read ORC (oops rewind capability) info used for unwinding the stack by
Linux Kernel. The info is stored in .orc_unwind and .orc_unwind_ip
sections. There is also a related .orc_lookup section that is being
populated by the kernel during runtime. Contents of the sections are
sorted for quicker lookup by a post-link objtool.

Unless we modify stack access instructions, we don't have to change ORC
info attributed to instructions in the binary. However, we need to
update instruction addresses and sort both sections based on the new
layout.

For pretty printing, we add "--print-orc" option that prints ORC info
next to instructions in code dumps.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154815

Files:
  bolt/include/bolt/Core/BinaryFunction.h
  bolt/lib/Rewrite/LinuxKernelRewriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154815.538507.patch
Type: text/x-patch
Size: 8764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230710/ab0945b8/attachment.bin>


More information about the llvm-commits mailing list