peachsim 0.1.1914 → 0.1.1916

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +23 -12
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +18 -7
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +23 -12
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +2 -2
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +23 -12
  68. package/dist-lib/swift-compile.cjs +16 -5
  69. package/dist-lib/swift-compile.mjs +16 -5
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +17 -6
  77. package/dist-lib/vite.cjs +1 -1
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  81. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
  82. package/package.json +1 -1
  83. package/sdk/ios/usr/include/MachO.modulemap +22 -0
  84. package/sdk/ios/usr/include/mach-o/arm/reloc.h +67 -0
  85. package/sdk/ios/usr/include/mach-o/arm64/reloc.h +254 -0
  86. package/sdk/ios/usr/include/mach-o/dyld.h +265 -11
  87. package/sdk/ios/usr/include/mach-o/fixup-chains.h +362 -0
  88. package/sdk/ios/usr/include/mach-o/ldsyms.h +133 -0
  89. package/sdk/ios/usr/include/mach-o/nlist.h +315 -29
  90. package/sdk/ios/usr/include/mach-o/ranlib.h +90 -0
  91. package/sdk/ios/usr/include/mach-o/reloc.h +203 -0
  92. package/sdk/ios/usr/include/mach-o/swap.h +284 -0
  93. package/sdk/ios/usr/include/mach-o/x86_64/reloc.h +191 -0
  94. package/sdk/ios/usr/include/module.modulemap +1 -0
  95. package/src/nitro-adapter.lock.json +277 -277
  96. package/src/nitro-superset.lock.json +4 -4
  97. package/src/swift-distribution.lock.json +11 -11
  98. package/src/swift-guest-image-ledger.ts +1 -1
  99. package/src/swift-shared-sdk.ts +12 -1
  100. package/src/turbo-runtime.lock.json +21 -21
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import {
@@ -4063,7 +4063,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
4063
4063
  const overlay = path8.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
4064
4064
  const overlayFiles = readdirSync4(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path8.join(entry.parentPath, entry.name)).sort();
4065
4065
  const key = JSON.stringify([
4066
- "v19",
4066
+ "v21",
4067
4067
  toolchainBin,
4068
4068
  sdk,
4069
4069
  frameworks,
@@ -4123,7 +4123,18 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
4123
4123
  "notify.h",
4124
4124
  "notify.modulemap",
4125
4125
  "module.modulemap",
4126
- "darwin.modulemap"
4126
+ "darwin.modulemap",
4127
+ "MachO.modulemap",
4128
+ "mach-o/arm/reloc.h",
4129
+ "mach-o/arm64/reloc.h",
4130
+ "mach-o/dyld.h",
4131
+ "mach-o/fixup-chains.h",
4132
+ "mach-o/ldsyms.h",
4133
+ "mach-o/nlist.h",
4134
+ "mach-o/ranlib.h",
4135
+ "mach-o/reloc.h",
4136
+ "mach-o/swap.h",
4137
+ "mach-o/x86_64/reloc.h"
4127
4138
  ].filter(
4128
4139
  (header) => fs3.existsSync(
4129
4140
  path8.join(
@@ -6917,7 +6928,7 @@ function createGuestImageLedger(input) {
6917
6928
  }
6918
6929
  preserveCanonical.add(name2);
6919
6930
  }
6920
- for (const name2 of ["dlsym", "dlerror", "__peach_dlsym_from_image"])
6931
+ for (const name2 of ["dlsym", "dlerror", "__peach_dlsym_from_image", "__peach_dlerror"])
6921
6932
  preserveCanonical.add(name2);
6922
6933
  for (const name2 of input.commandLineSymbols ?? []) preserveCanonical.add(name2);
6923
6934
  const bindingsByImage = /* @__PURE__ */ new Map();
@@ -12094,7 +12105,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
12094
12105
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
12095
12106
  var MULTI_MANIFEST_VERSION = 66;
12096
12107
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
12097
- var compilerSourceDigest = true ? "dd9b7281e6fb27ea99fc4217e0a0b65fcdfd8e6e508697850feee2e2b068ebbd" : swiftCompilerSourceDigest(import.meta.dirname);
12108
+ var compilerSourceDigest = true ? "e3dfed5d099f11621c3c0eec35a1e6029262dcada1d8972551bd952e593f9f2f" : swiftCompilerSourceDigest(import.meta.dirname);
12098
12109
  function swiftArtifactHash(input, release, moduleRoot) {
12099
12110
  const hash = createHash13("sha256");
12100
12111
  hash.update(`swift-compile
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function swiftManifestSettings(target) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -8470,7 +8470,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
8470
8470
  const overlay = import_node_path8.default.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
8471
8471
  const overlayFiles = (0, import_node_fs8.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path8.default.join(entry.parentPath, entry.name)).sort();
8472
8472
  const key2 = JSON.stringify([
8473
- "v19",
8473
+ "v21",
8474
8474
  toolchainBin,
8475
8475
  sdk,
8476
8476
  frameworks,
@@ -8530,7 +8530,18 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
8530
8530
  "notify.h",
8531
8531
  "notify.modulemap",
8532
8532
  "module.modulemap",
8533
- "darwin.modulemap"
8533
+ "darwin.modulemap",
8534
+ "MachO.modulemap",
8535
+ "mach-o/arm/reloc.h",
8536
+ "mach-o/arm64/reloc.h",
8537
+ "mach-o/dyld.h",
8538
+ "mach-o/fixup-chains.h",
8539
+ "mach-o/ldsyms.h",
8540
+ "mach-o/nlist.h",
8541
+ "mach-o/ranlib.h",
8542
+ "mach-o/reloc.h",
8543
+ "mach-o/swap.h",
8544
+ "mach-o/x86_64/reloc.h"
8534
8545
  ].filter(
8535
8546
  (header) => import_node_fs8.default.existsSync(
8536
8547
  import_node_path8.default.join(
@@ -11403,7 +11414,7 @@ function createGuestImageLedger(input) {
11403
11414
  }
11404
11415
  preserveCanonical.add(name3);
11405
11416
  }
11406
- for (const name3 of ["dlsym", "dlerror", "__peach_dlsym_from_image"])
11417
+ for (const name3 of ["dlsym", "dlerror", "__peach_dlsym_from_image", "__peach_dlerror"])
11407
11418
  preserveCanonical.add(name3);
11408
11419
  for (const name3 of input.commandLineSymbols ?? []) preserveCanonical.add(name3);
11409
11420
  const bindingsByImage = /* @__PURE__ */ new Map();
@@ -16431,7 +16442,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
16431
16442
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
16432
16443
  var MULTI_MANIFEST_VERSION = 66;
16433
16444
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
16434
- var compilerSourceDigest = true ? "dd9b7281e6fb27ea99fc4217e0a0b65fcdfd8e6e508697850feee2e2b068ebbd" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16445
+ var compilerSourceDigest = true ? "e3dfed5d099f11621c3c0eec35a1e6029262dcada1d8972551bd952e593f9f2f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16435
16446
  function swiftArtifactHash(input, release, moduleRoot) {
16436
16447
  const hash = (0, import_node_crypto12.createHash)("sha256");
16437
16448
  hash.update(`swift-compile
@@ -29576,7 +29587,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
29576
29587
  return hash.digest("hex");
29577
29588
  }
29578
29589
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
29579
- var STANDIN_SOURCE_DIGEST = true ? "423ea60c6f3b499ae216ea11ef0cc3f52b65d163fd1447fea98c49f0acf9ab9e" : standinSourceDigest();
29590
+ var STANDIN_SOURCE_DIGEST = true ? "d5d76acc93fcfd6400f9e2adbeff8970922933f271386242e2c6454fa646596f" : standinSourceDigest();
29580
29591
 
29581
29592
  // src/swift-standins.ts
29582
29593
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1914 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1916 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -20,6 +20,7 @@ export declare function disposeRenderSurfaceResources(surface: Surface): void;
20
20
  export declare function getBlurMaskFilter(ck: CanvasKit, sigma: number): ReturnType<CanvasKit['MaskFilter']['MakeBlur']>;
21
21
  export declare function setPaintContinuationRenderCallback(cb: ((node: SootSimNode) => void) | null): void;
22
22
  export declare function glassTakesAnimatedParameters(node: SootSimNode): boolean;
23
+ export declare function glassFoldsIntoPeers(node: SootSimNode): boolean;
23
24
  export declare function prewarmPaintBoundaries(root: SootSimNode, ctx: RenderContext, budgetMs: number, realizeInto?: Surface | null, reach?: PrewarmReach, requireProgress?: boolean, paintedNodeIds?: ReadonlySet<number>): {
24
25
  records: number;
25
26
  nodesCompleted: number;
@@ -405,6 +405,6 @@ export interface SceneLaneProgram {
405
405
  readonly glassRectIndexes: Readonly<Record<string, number>>;
406
406
  readonly glassOpacityIndex: number;
407
407
  }
408
- export declare function compileSceneLaneProgram(template: Record<string, unknown>, slotIds: readonly number[]): SceneLaneProgram | string;
408
+ export declare function compileSceneLaneProgram(template: Record<string, unknown>, slotIds: readonly number[], foldedGlassKeys?: readonly string[]): SceneLaneProgram | string;
409
409
  export declare const sceneTable: SceneTable;
410
410
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1914",
3
+ "version": "0.1.1916",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -0,0 +1,22 @@
1
+ module MachO [system] {
2
+ umbrella "mach-o"
3
+
4
+ module dyld {
5
+ header "mach-o/dyld.h"
6
+ export *
7
+
8
+ explicit module utils {
9
+ header "mach-o/utils.h"
10
+ export *
11
+ }
12
+ }
13
+
14
+ // All swap APIs are deprecated.
15
+ exclude header "mach-o/i386/swap.h"
16
+
17
+ // wasm32 takes the ILP32 branch of this header, whose signatures differ from
18
+ // native arm64; the MachO Swift overlay declares these functions as arm64 does.
19
+ exclude header "mach-o/getsect.h"
20
+
21
+ module * { export * }
22
+ }
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ #ifndef _MACHO_ARM_RELOC_H_
25
+ #define _MACHO_ARM_RELOC_H_
26
+
27
+ /*
28
+ * Relocation types used in the arm implementation. Relocation entries for
29
+ * things other than instructions use the same generic relocation as discribed
30
+ * in <mach-o/reloc.h> and their r_type is ARM_RELOC_VANILLA, one of the
31
+ * *_SECTDIFF or the *_PB_LA_PTR types. The rest of the relocation types are
32
+ * for instructions. Since they are for instructions the r_address field
33
+ * indicates the 32 bit instruction that the relocation is to be preformed on.
34
+ */
35
+
36
+ enum reloc_type_arm
37
+ {
38
+ ARM_RELOC_VANILLA, /* generic relocation as discribed above */
39
+ ARM_RELOC_PAIR, /* the second relocation entry of a pair */
40
+ ARM_RELOC_SECTDIFF, /* a PAIR follows with subtract symbol value */
41
+ ARM_RELOC_LOCAL_SECTDIFF, /* like ARM_RELOC_SECTDIFF, but the symbol
42
+ referenced was local. */
43
+ ARM_RELOC_PB_LA_PTR,/* prebound lazy pointer */
44
+ ARM_RELOC_BR24, /* 24 bit branch displacement (to a word address) */
45
+ ARM_THUMB_RELOC_BR22, /* 22 bit branch displacement (to a half-word
46
+ address) */
47
+ ARM_THUMB_32BIT_BRANCH, /* obsolete - a thumb 32-bit branch instruction
48
+ possibly needing page-spanning branch workaround */
49
+
50
+ /*
51
+ * For these two r_type relocations they always have a pair following them
52
+ * and the r_length bits are used differently. The encoding of the
53
+ * r_length is as follows:
54
+ * low bit of r_length:
55
+ * 0 - :lower16: for movw instructions
56
+ * 1 - :upper16: for movt instructions
57
+ * high bit of r_length:
58
+ * 0 - arm instructions
59
+ * 1 - thumb instructions
60
+ * the other half of the relocated expression is in the following pair
61
+ * relocation entry in the the low 16 bits of r_address field.
62
+ */
63
+ ARM_RELOC_HALF,
64
+ ARM_RELOC_HALF_SECTDIFF
65
+ };
66
+
67
+ #endif /* #ifndef _MACHO_ARM_RELOC_H_ */
@@ -0,0 +1,254 @@
1
+ /*
2
+ * Copyright (c) 2010 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ #ifndef _MACHO_ARM64_RELOC_H_
25
+ #define _MACHO_ARM64_RELOC_H_
26
+
27
+ /*
28
+ * Relocations for arm64 are a bit different than for other architectures in
29
+ * Mach-O: Scattered relocations are not used. Almost all relocations produced
30
+ * by the compiler are external relocations. An external relocation has the
31
+ * r_extern bit set to 1 and the r_symbolnum field contains the symbol table
32
+ * index of the target label.
33
+ *
34
+ * When the assembler is generating relocations, if the target label is a local
35
+ * label (begins with 'L'), then the previous non-local label in the same
36
+ * section is used as the target of the external relocation. An addend is used
37
+ * with the distance from that non-local label to the target label. Only when
38
+ * there is no previous non-local label in the section is an internal
39
+ * relocation used.
40
+ *
41
+ * The addend (i.e. the 4 in _foo+4) is encoded either in the instruction or
42
+ * in the r_symbolnum of ARM64_RELOC_ADDEND.
43
+ * For ARM64_RELOC_UNSIGNED and ARM64_RELOC_AUTHENTICATED_POINTER, the addend
44
+ * is stored in the instruction. ARM64_RELOC_PAGE21, ARM64_RELOC_PAGEOFF12 and
45
+ * ARM64_RELOC_BRANCH26 must be preceded by an ARM64_RELOC_ADDEND if they need
46
+ * an addend. No other relocations support addends.
47
+ *
48
+ * The relocation types are:
49
+ *
50
+ * ARM64_RELOC_UNSIGNED // For pointer sized fixups
51
+ * ARM64_RELOC_SUBTRACTOR // must be followed by a ARM64_RELOC_UNSIGNED
52
+ * ARM64_RELOC_BRANCH26 // a BL instruction with pc-relative +-128MB displacement
53
+ * ARM64_RELOC_PAGE21 // pc-rel distance to page of target
54
+ * ARM64_RELOC_PAGEOFF12 // offset within page, scaled by r_length
55
+ * ARM64_RELOC_GOT_LOAD_PAGE21 // load with a pc-rel distance to page of a GOT entry
56
+ * ARM64_RELOC_GOT_LOAD_PAGEOFF12 // load with an offset within page, scaled by r_length, of GOT entry
57
+ * ARM64_RELOC_POINTER_TO_GOT // 32-bit pc-rel (or 64-bit absolute) offset to a GOT entry
58
+ * ARM64_RELOC_TLVP_LOAD_PAGE21 // tlv load with a pc-rel distance to page of a GOT entry
59
+ * ARM64_RELOC_TLVP_LOAD_PAGEOFF12 // tlv load with an offset within page, scaled by r_length, of GOT entry
60
+ * ARM64_RELOC_ADDEND // must be followed by ARM64_RELOC_BRANCH26/ARM64_RELOC_PAGE21/ARM64_RELOC_PAGEOFF12
61
+ * ARM64_RELOC_AUTHENTICATED_POINTER // 64-bit pointer with authentication
62
+ *
63
+ * The following are sample assembly instructions, followed by the relocation
64
+ * and section content they generate in an object file:
65
+ *
66
+ * (arm64_32 only)
67
+ * .long _foo
68
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
69
+ * 00 00 00 00
70
+ *
71
+ * (arm64_32 only)
72
+ * .long _foo + 4
73
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
74
+ * 04 00 00 00
75
+ *
76
+ * .quad _foo
77
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
78
+ * 00 00 00 00 00 00 00 00
79
+ *
80
+ * .quad _foo + 16
81
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
82
+ * 10 00 00 00 00 00 00 00
83
+ *
84
+ * .quad L1
85
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
86
+ * 10 00 00 00 00 00 00 00
87
+ * // assumes _prev is the first non-local label 0x10 bytes before L1
88
+ * 10 00 00 00 00 00 00 00
89
+ *
90
+ * (arm64_32 only)
91
+ * .long _foo - _bar
92
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar
93
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
94
+ * 00 00 00 00
95
+ *
96
+ * (arm64_32 only)
97
+ * .long _foo - _bar + 4
98
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar
99
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
100
+ * 04 00 00 00
101
+ *
102
+ * .quad _foo - _bar
103
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar
104
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
105
+ * 00 00 00 00 00 00 00 00
106
+ *
107
+ * .quad _foo - _bar + 4
108
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar
109
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
110
+ * 04 00 00 00 00 00 00 00
111
+ *
112
+ * .long _foo - .
113
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_prev
114
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
115
+ * f8 ff ff ff
116
+ * // assumes _prev is the first non-local label 0x8 bytes before this
117
+ * // .quad
118
+ *
119
+ * .long _foo - L1
120
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_prev
121
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
122
+ * f8 ff ff ff
123
+ * // assumes _prev is the first non-local label 0x8 bytes before L1
124
+ *
125
+ * .quad _foo - .
126
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
127
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
128
+ * f8 ff ff ff ff ff ff ff
129
+ * // assumes _prev is the first non-local label 0x8 bytes before this
130
+ * // .quad
131
+ *
132
+ * .quad _foo - L1
133
+ * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
134
+ * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
135
+ * f8 ff ff ff ff ff ff ff
136
+ * // assumes _prev is the first non-local label 0x8 bytes before L1
137
+ *
138
+ * .long L1 - _prev
139
+ * // No relocations. This is an assembly time constant.
140
+ * 12 00 00 00 00 00 00 00
141
+ * // assumes _prev is the first non-local label 0x12 bytes before L1
142
+ *
143
+ * .quad L1 - _prev
144
+ * // No relocations. This is an assembly time constant.
145
+ * 12 00 00 00 00 00 00 00
146
+ * // assumes _prev is the first non-local label 0x12 bytes before L1
147
+ *
148
+ * bl _foo
149
+ * r_type=ARM64_RELOC_BRANCH26, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
150
+ * 0x14000000
151
+ *
152
+ * bl _foo + 4
153
+ * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000004
154
+ * r_type=ARM64_RELOC_BRANCH26, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
155
+ * 0x14000000
156
+ *
157
+ * adrp x0, _foo@PAGE
158
+ * r_type=ARM64_RELOC_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
159
+ * 0x90000000
160
+ *
161
+ * ldr x0, [x0, _foo@PAGEOFF]
162
+ * r_type=ARM64_RELOC_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
163
+ * 0xf9400000
164
+ *
165
+ * adrp x0, _foo@PAGE + 0x24
166
+ * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000024
167
+ * r_type=ARM64_RELOC_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
168
+ * 0x90000000
169
+ *
170
+ * ldr x0, [x0, _foo@PAGEOFF + 0x24]
171
+ * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000024
172
+ * r_type=ARM64_RELOC_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
173
+ * 0xf9400000
174
+ *
175
+ * adrp x0, _foo@GOTPAGE
176
+ * r_type=ARM64_RELOC_GOT_LOAD_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
177
+ * 0x90000000
178
+ *
179
+ * ldr x0, [x0, _foo@GOTPAGEOFF]
180
+ * r_type=ARM64_RELOC_GOT_LOAD_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
181
+ * 0xf9400000
182
+ *
183
+ * adrp x0, _foo@TLVPPAGE
184
+ * r_type=ARM64_RELOC_TLVP_LOAD_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
185
+ * 0x90000000
186
+ *
187
+ * ldr x0, [x0, _foo@TLVPPAGEOFF]
188
+ * r_type=ARM64_RELOC_TLVP_LOAD_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
189
+ * 0xf9400000
190
+ *
191
+ * .long _foo@GOT - .
192
+ * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
193
+ * 00 00 00 00
194
+ *
195
+ * (arm64_32 only)
196
+ * .long _foo@GOT
197
+ * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
198
+ * 00 00 00 00
199
+ *
200
+ * .quad _foo@GOT
201
+ * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
202
+ * 00 00 00 00 00 00 00 00
203
+ *
204
+ * (arm64e only)
205
+ * .quad _foo@AUTH(da,5,addr)
206
+ * r_type=ARM64_RELOC_AUTHENTICATED_POINTER, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
207
+ * 00 00 00 00 05 00 05 80
208
+ *
209
+ * (arm64e only)
210
+ * .quad (_foo + 0x10)@AUTH(da,5,addr)
211
+ * r_type=ARM64_RELOC_AUTHENTICATED_POINTER, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
212
+ * 10 00 00 00 05 00 05 80
213
+ *
214
+ *
215
+ */
216
+ enum reloc_type_arm64
217
+ {
218
+ ARM64_RELOC_UNSIGNED, // for pointers
219
+ ARM64_RELOC_SUBTRACTOR, // must be followed by a ARM64_RELOC_UNSIGNED
220
+ ARM64_RELOC_BRANCH26, // a B/BL instruction with 26-bit displacement
221
+ ARM64_RELOC_PAGE21, // pc-rel distance to page of target
222
+ ARM64_RELOC_PAGEOFF12, // offset within page, scaled by r_length
223
+ ARM64_RELOC_GOT_LOAD_PAGE21, // pc-rel distance to page of GOT slot
224
+ ARM64_RELOC_GOT_LOAD_PAGEOFF12, // offset within page of GOT slot,
225
+ // scaled by r_length
226
+ ARM64_RELOC_POINTER_TO_GOT, // for pointers to GOT slots
227
+ ARM64_RELOC_TLVP_LOAD_PAGE21, // pc-rel distance to page of TLVP slot
228
+ ARM64_RELOC_TLVP_LOAD_PAGEOFF12, // offset within page of TLVP slot,
229
+ // scaled by r_length
230
+ ARM64_RELOC_ADDEND, // must be followed by PAGE21 or PAGEOFF12
231
+
232
+ // An arm64e authenticated pointer.
233
+ //
234
+ // Represents a pointer to a symbol (like ARM64_RELOC_UNSIGNED).
235
+ // Additionally, the resulting pointer is signed. The signature is
236
+ // specified in the target location: the addend is restricted to the lower
237
+ // 32 bits (instead of the full 64 bits for ARM64_RELOC_UNSIGNED):
238
+ //
239
+ // |63|62|61-51|50-49| 48 |47 - 32|31 - 0|
240
+ // | 1| 0| 0 | key | addr | discriminator | addend |
241
+ //
242
+ // The key is one of:
243
+ // IA: 00 IB: 01
244
+ // DA: 10 DB: 11
245
+ //
246
+ // The discriminator field is used as extra signature diversification.
247
+ //
248
+ // The addr field indicates whether the target address should be blended
249
+ // into the discriminator.
250
+ //
251
+ ARM64_RELOC_AUTHENTICATED_POINTER,
252
+ };
253
+
254
+ #endif /* #ifndef _MACHO_ARM64_RELOC_H_ */