0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. From 43dfe54ce017c8d37eaec480a2f13a492bbc4203 Mon Sep 17 00:00:00 2001
  2. From: serge-sans-paille <sguelton@redhat.com>
  3. Date: Thu, 25 Feb 2021 14:24:14 +0100
  4. Subject: [PATCH 2/2] [PATCH][lld] Import compact_unwind_encoding.h from
  5. libunwind
  6. This avoids an implicit cross package dependency
  7. ---
  8. lld/include/mach-o/compact_unwind_encoding.h | 477 +++++++++++++++++++++++++++
  9. 1 file changed, 477 insertions(+)
  10. create mode 100644 lld/include/mach-o/compact_unwind_encoding.h
  11. diff --git a/lld/include/mach-o/compact_unwind_encoding.h b/lld/include/mach-o/compact_unwind_encoding.h
  12. new file mode 100644
  13. index 0000000..5301b10
  14. --- /dev/null
  15. +++ b/lld/include/mach-o/compact_unwind_encoding.h
  16. @@ -0,0 +1,477 @@
  17. +//===------------------ mach-o/compact_unwind_encoding.h ------------------===//
  18. +//
  19. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  20. +// See https://llvm.org/LICENSE.txt for license information.
  21. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  22. +//
  23. +//
  24. +// Darwin's alternative to DWARF based unwind encodings.
  25. +//
  26. +//===----------------------------------------------------------------------===//
  27. +
  28. +
  29. +#ifndef __COMPACT_UNWIND_ENCODING__
  30. +#define __COMPACT_UNWIND_ENCODING__
  31. +
  32. +#include <stdint.h>
  33. +
  34. +//
  35. +// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section
  36. +// of object files. Or compilers can emit compact unwind information in
  37. +// the __LD,__compact_unwind section.
  38. +//
  39. +// When the linker creates a final linked image, it will create a
  40. +// __TEXT,__unwind_info section. This section is a small and fast way for the
  41. +// runtime to access unwind info for any given function. If the compiler
  42. +// emitted compact unwind info for the function, that compact unwind info will
  43. +// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
  44. +// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset
  45. +// of the FDE in the __TEXT,__eh_frame section in the final linked image.
  46. +//
  47. +// Note: Previously, the linker would transform some DWARF unwind infos into
  48. +// compact unwind info. But that is fragile and no longer done.
  49. +
  50. +
  51. +//
  52. +// The compact unwind endoding is a 32-bit value which encoded in an
  53. +// architecture specific way, which registers to restore from where, and how
  54. +// to unwind out of the function.
  55. +//
  56. +typedef uint32_t compact_unwind_encoding_t;
  57. +
  58. +
  59. +// architecture independent bits
  60. +enum {
  61. + UNWIND_IS_NOT_FUNCTION_START = 0x80000000,
  62. + UNWIND_HAS_LSDA = 0x40000000,
  63. + UNWIND_PERSONALITY_MASK = 0x30000000,
  64. +};
  65. +
  66. +
  67. +
  68. +
  69. +//
  70. +// x86
  71. +//
  72. +// 1-bit: start
  73. +// 1-bit: has lsda
  74. +// 2-bit: personality index
  75. +//
  76. +// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF
  77. +// ebp based:
  78. +// 15-bits (5*3-bits per reg) register permutation
  79. +// 8-bits for stack offset
  80. +// frameless:
  81. +// 8-bits stack size
  82. +// 3-bits stack adjust
  83. +// 3-bits register count
  84. +// 10-bits register permutation
  85. +//
  86. +enum {
  87. + UNWIND_X86_MODE_MASK = 0x0F000000,
  88. + UNWIND_X86_MODE_EBP_FRAME = 0x01000000,
  89. + UNWIND_X86_MODE_STACK_IMMD = 0x02000000,
  90. + UNWIND_X86_MODE_STACK_IND = 0x03000000,
  91. + UNWIND_X86_MODE_DWARF = 0x04000000,
  92. +
  93. + UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF,
  94. + UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000,
  95. +
  96. + UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000,
  97. + UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000,
  98. + UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
  99. + UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
  100. +
  101. + UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF,
  102. +};
  103. +
  104. +enum {
  105. + UNWIND_X86_REG_NONE = 0,
  106. + UNWIND_X86_REG_EBX = 1,
  107. + UNWIND_X86_REG_ECX = 2,
  108. + UNWIND_X86_REG_EDX = 3,
  109. + UNWIND_X86_REG_EDI = 4,
  110. + UNWIND_X86_REG_ESI = 5,
  111. + UNWIND_X86_REG_EBP = 6,
  112. +};
  113. +
  114. +//
  115. +// For x86 there are four modes for the compact unwind encoding:
  116. +// UNWIND_X86_MODE_EBP_FRAME:
  117. +// EBP based frame where EBP is push on stack immediately after return address,
  118. +// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current
  119. +// EPB value, then EBP is restored by popping off the stack, and the return
  120. +// is done by popping the stack once more into the pc.
  121. +// All non-volatile registers that need to be restored must have been saved
  122. +// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4
  123. +// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved
  124. +// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
  125. +// Each entry contains which register to restore.
  126. +// UNWIND_X86_MODE_STACK_IMMD:
  127. +// A "frameless" (EBP not used as frame pointer) function with a small
  128. +// constant stack size. To return, a constant (encoded in the compact
  129. +// unwind encoding) is added to the ESP. Then the return is done by
  130. +// popping the stack into the pc.
  131. +// All non-volatile registers that need to be restored must have been saved
  132. +// on the stack immediately after the return address. The stack_size/4 is
  133. +// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).
  134. +// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.
  135. +// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
  136. +// saved and their order.
  137. +// UNWIND_X86_MODE_STACK_IND:
  138. +// A "frameless" (EBP not used as frame pointer) function large constant
  139. +// stack size. This case is like the previous, except the stack size is too
  140. +// large to encode in the compact unwind encoding. Instead it requires that
  141. +// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
  142. +// encoding contains the offset to the nnnnnnnn value in the function in
  143. +// UNWIND_X86_FRAMELESS_STACK_SIZE.
  144. +// UNWIND_X86_MODE_DWARF:
  145. +// No compact unwind encoding is available. Instead the low 24-bits of the
  146. +// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
  147. +// This mode is never used in object files. It is only generated by the
  148. +// linker in final linked images which have only DWARF unwind info for a
  149. +// function.
  150. +//
  151. +// The permutation encoding is a Lehmer code sequence encoded into a
  152. +// single variable-base number so we can encode the ordering of up to
  153. +// six registers in a 10-bit space.
  154. +//
  155. +// The following is the algorithm used to create the permutation encoding used
  156. +// with frameless stacks. It is passed the number of registers to be saved and
  157. +// an array of the register numbers saved.
  158. +//
  159. +//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])
  160. +//{
  161. +// uint32_t renumregs[6];
  162. +// for (int i=6-registerCount; i < 6; ++i) {
  163. +// int countless = 0;
  164. +// for (int j=6-registerCount; j < i; ++j) {
  165. +// if ( registers[j] < registers[i] )
  166. +// ++countless;
  167. +// }
  168. +// renumregs[i] = registers[i] - countless -1;
  169. +// }
  170. +// uint32_t permutationEncoding = 0;
  171. +// switch ( registerCount ) {
  172. +// case 6:
  173. +// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]
  174. +// + 6*renumregs[2] + 2*renumregs[3]
  175. +// + renumregs[4]);
  176. +// break;
  177. +// case 5:
  178. +// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]
  179. +// + 6*renumregs[3] + 2*renumregs[4]
  180. +// + renumregs[5]);
  181. +// break;
  182. +// case 4:
  183. +// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]
  184. +// + 3*renumregs[4] + renumregs[5]);
  185. +// break;
  186. +// case 3:
  187. +// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]
  188. +// + renumregs[5]);
  189. +// break;
  190. +// case 2:
  191. +// permutationEncoding |= (5*renumregs[4] + renumregs[5]);
  192. +// break;
  193. +// case 1:
  194. +// permutationEncoding |= (renumregs[5]);
  195. +// break;
  196. +// }
  197. +// return permutationEncoding;
  198. +//}
  199. +//
  200. +
  201. +
  202. +
  203. +
  204. +//
  205. +// x86_64
  206. +//
  207. +// 1-bit: start
  208. +// 1-bit: has lsda
  209. +// 2-bit: personality index
  210. +//
  211. +// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF
  212. +// rbp based:
  213. +// 15-bits (5*3-bits per reg) register permutation
  214. +// 8-bits for stack offset
  215. +// frameless:
  216. +// 8-bits stack size
  217. +// 3-bits stack adjust
  218. +// 3-bits register count
  219. +// 10-bits register permutation
  220. +//
  221. +enum {
  222. + UNWIND_X86_64_MODE_MASK = 0x0F000000,
  223. + UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000,
  224. + UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000,
  225. + UNWIND_X86_64_MODE_STACK_IND = 0x03000000,
  226. + UNWIND_X86_64_MODE_DWARF = 0x04000000,
  227. +
  228. + UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF,
  229. + UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000,
  230. +
  231. + UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000,
  232. + UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000,
  233. + UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
  234. + UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
  235. +
  236. + UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
  237. +};
  238. +
  239. +enum {
  240. + UNWIND_X86_64_REG_NONE = 0,
  241. + UNWIND_X86_64_REG_RBX = 1,
  242. + UNWIND_X86_64_REG_R12 = 2,
  243. + UNWIND_X86_64_REG_R13 = 3,
  244. + UNWIND_X86_64_REG_R14 = 4,
  245. + UNWIND_X86_64_REG_R15 = 5,
  246. + UNWIND_X86_64_REG_RBP = 6,
  247. +};
  248. +//
  249. +// For x86_64 there are four modes for the compact unwind encoding:
  250. +// UNWIND_X86_64_MODE_RBP_FRAME:
  251. +// RBP based frame where RBP is push on stack immediately after return address,
  252. +// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
  253. +// EPB value, then RBP is restored by popping off the stack, and the return
  254. +// is done by popping the stack once more into the pc.
  255. +// All non-volatile registers that need to be restored must have been saved
  256. +// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
  257. +// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
  258. +// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
  259. +// Each entry contains which register to restore.
  260. +// UNWIND_X86_64_MODE_STACK_IMMD:
  261. +// A "frameless" (RBP not used as frame pointer) function with a small
  262. +// constant stack size. To return, a constant (encoded in the compact
  263. +// unwind encoding) is added to the RSP. Then the return is done by
  264. +// popping the stack into the pc.
  265. +// All non-volatile registers that need to be restored must have been saved
  266. +// on the stack immediately after the return address. The stack_size/8 is
  267. +// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
  268. +// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
  269. +// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
  270. +// saved and their order.
  271. +// UNWIND_X86_64_MODE_STACK_IND:
  272. +// A "frameless" (RBP not used as frame pointer) function large constant
  273. +// stack size. This case is like the previous, except the stack size is too
  274. +// large to encode in the compact unwind encoding. Instead it requires that
  275. +// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
  276. +// encoding contains the offset to the nnnnnnnn value in the function in
  277. +// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
  278. +// UNWIND_X86_64_MODE_DWARF:
  279. +// No compact unwind encoding is available. Instead the low 24-bits of the
  280. +// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
  281. +// This mode is never used in object files. It is only generated by the
  282. +// linker in final linked images which have only DWARF unwind info for a
  283. +// function.
  284. +//
  285. +
  286. +
  287. +// ARM64
  288. +//
  289. +// 1-bit: start
  290. +// 1-bit: has lsda
  291. +// 2-bit: personality index
  292. +//
  293. +// 4-bits: 4=frame-based, 3=DWARF, 2=frameless
  294. +// frameless:
  295. +// 12-bits of stack size
  296. +// frame-based:
  297. +// 4-bits D reg pairs saved
  298. +// 5-bits X reg pairs saved
  299. +// DWARF:
  300. +// 24-bits offset of DWARF FDE in __eh_frame section
  301. +//
  302. +enum {
  303. + UNWIND_ARM64_MODE_MASK = 0x0F000000,
  304. + UNWIND_ARM64_MODE_FRAMELESS = 0x02000000,
  305. + UNWIND_ARM64_MODE_DWARF = 0x03000000,
  306. + UNWIND_ARM64_MODE_FRAME = 0x04000000,
  307. +
  308. + UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001,
  309. + UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002,
  310. + UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004,
  311. + UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008,
  312. + UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010,
  313. + UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100,
  314. + UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200,
  315. + UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400,
  316. + UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800,
  317. +
  318. + UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000,
  319. + UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
  320. +};
  321. +// For arm64 there are three modes for the compact unwind encoding:
  322. +// UNWIND_ARM64_MODE_FRAME:
  323. +// This is a standard arm64 prolog where FP/LR are immediately pushed on the
  324. +// stack, then SP is copied to FP. If there are any non-volatile registers
  325. +// saved, then are copied into the stack frame in pairs in a contiguous
  326. +// range right below the saved FP/LR pair. Any subset of the five X pairs
  327. +// and four D pairs can be saved, but the memory layout must be in register
  328. +// number order.
  329. +// UNWIND_ARM64_MODE_FRAMELESS:
  330. +// A "frameless" leaf function, where FP/LR are not saved. The return address
  331. +// remains in LR throughout the function. If any non-volatile registers
  332. +// are saved, they must be pushed onto the stack before any stack space is
  333. +// allocated for local variables. The stack sized (including any saved
  334. +// non-volatile registers) divided by 16 is encoded in the bits
  335. +// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
  336. +// UNWIND_ARM64_MODE_DWARF:
  337. +// No compact unwind encoding is available. Instead the low 24-bits of the
  338. +// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
  339. +// This mode is never used in object files. It is only generated by the
  340. +// linker in final linked images which have only DWARF unwind info for a
  341. +// function.
  342. +//
  343. +
  344. +
  345. +
  346. +
  347. +
  348. +////////////////////////////////////////////////////////////////////////////////
  349. +//
  350. +// Relocatable Object Files: __LD,__compact_unwind
  351. +//
  352. +////////////////////////////////////////////////////////////////////////////////
  353. +
  354. +//
  355. +// A compiler can generated compact unwind information for a function by adding
  356. +// a "row" to the __LD,__compact_unwind section. This section has the
  357. +// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
  358. +// It is removed by the new linker, so never ends up in final executables.
  359. +// This section is a table, initially with one row per function (that needs
  360. +// unwind info). The table columns and some conceptual entries are:
  361. +//
  362. +// range-start pointer to start of function/range
  363. +// range-length
  364. +// compact-unwind-encoding 32-bit encoding
  365. +// personality-function or zero if no personality function
  366. +// lsda or zero if no LSDA data
  367. +//
  368. +// The length and encoding fields are 32-bits. The other are all pointer sized.
  369. +//
  370. +// In x86_64 assembly, these entry would look like:
  371. +//
  372. +// .section __LD,__compact_unwind,regular,debug
  373. +//
  374. +// #compact unwind for _foo
  375. +// .quad _foo
  376. +// .set L1,LfooEnd-_foo
  377. +// .long L1
  378. +// .long 0x01010001
  379. +// .quad 0
  380. +// .quad 0
  381. +//
  382. +// #compact unwind for _bar
  383. +// .quad _bar
  384. +// .set L2,LbarEnd-_bar
  385. +// .long L2
  386. +// .long 0x01020011
  387. +// .quad __gxx_personality
  388. +// .quad except_tab1
  389. +//
  390. +//
  391. +// Notes: There is no need for any labels in the the __compact_unwind section.
  392. +// The use of the .set directive is to force the evaluation of the
  393. +// range-length at assembly time, instead of generating relocations.
  394. +//
  395. +// To support future compiler optimizations where which non-volatile registers
  396. +// are saved changes within a function (e.g. delay saving non-volatiles until
  397. +// necessary), there can by multiple lines in the __compact_unwind table for one
  398. +// function, each with a different (non-overlapping) range and each with
  399. +// different compact unwind encodings that correspond to the non-volatiles
  400. +// saved at that range of the function.
  401. +//
  402. +// If a particular function is so wacky that there is no compact unwind way
  403. +// to encode it, then the compiler can emit traditional DWARF unwind info.
  404. +// The runtime will use which ever is available.
  405. +//
  406. +// Runtime support for compact unwind encodings are only available on 10.6
  407. +// and later. So, the compiler should not generate it when targeting pre-10.6.
  408. +
  409. +
  410. +
  411. +
  412. +////////////////////////////////////////////////////////////////////////////////
  413. +//
  414. +// Final Linked Images: __TEXT,__unwind_info
  415. +//
  416. +////////////////////////////////////////////////////////////////////////////////
  417. +
  418. +//
  419. +// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
  420. +// The header of the section contains a coarse index that maps function address
  421. +// to the page (4096 byte block) containing the unwind info for that function.
  422. +//
  423. +
  424. +#define UNWIND_SECTION_VERSION 1
  425. +struct unwind_info_section_header
  426. +{
  427. + uint32_t version; // UNWIND_SECTION_VERSION
  428. + uint32_t commonEncodingsArraySectionOffset;
  429. + uint32_t commonEncodingsArrayCount;
  430. + uint32_t personalityArraySectionOffset;
  431. + uint32_t personalityArrayCount;
  432. + uint32_t indexSectionOffset;
  433. + uint32_t indexCount;
  434. + // compact_unwind_encoding_t[]
  435. + // uint32_t personalities[]
  436. + // unwind_info_section_header_index_entry[]
  437. + // unwind_info_section_header_lsda_index_entry[]
  438. +};
  439. +
  440. +struct unwind_info_section_header_index_entry
  441. +{
  442. + uint32_t functionOffset;
  443. + uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page
  444. + uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range
  445. +};
  446. +
  447. +struct unwind_info_section_header_lsda_index_entry
  448. +{
  449. + uint32_t functionOffset;
  450. + uint32_t lsdaOffset;
  451. +};
  452. +
  453. +//
  454. +// There are two kinds of second level index pages: regular and compressed.
  455. +// A compressed page can hold up to 1021 entries, but it cannot be used
  456. +// if too many different encoding types are used. The regular page holds
  457. +// 511 entries.
  458. +//
  459. +
  460. +struct unwind_info_regular_second_level_entry
  461. +{
  462. + uint32_t functionOffset;
  463. + compact_unwind_encoding_t encoding;
  464. +};
  465. +
  466. +#define UNWIND_SECOND_LEVEL_REGULAR 2
  467. +struct unwind_info_regular_second_level_page_header
  468. +{
  469. + uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
  470. + uint16_t entryPageOffset;
  471. + uint16_t entryCount;
  472. + // entry array
  473. +};
  474. +
  475. +#define UNWIND_SECOND_LEVEL_COMPRESSED 3
  476. +struct unwind_info_compressed_second_level_page_header
  477. +{
  478. + uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
  479. + uint16_t entryPageOffset;
  480. + uint16_t entryCount;
  481. + uint16_t encodingsPageOffset;
  482. + uint16_t encodingsCount;
  483. + // 32-bit entry array
  484. + // encodings array
  485. +};
  486. +
  487. +#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF)
  488. +#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF)
  489. +
  490. +
  491. +
  492. +#endif
  493. +
  494. --
  495. 1.8.3.1