Skip to content

Commit

Permalink
Merge pull request #82 from p-x9/feature/dyld-chained-import-addend
Browse files Browse the repository at this point in the history
Add `addend` property to dyld chained import protocol
  • Loading branch information
p-x9 authored May 14, 2024
2 parents 0c93973 + 61cbabf commit ae9f332
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/MachOKit/Model/DyldChain/DyldChainedImport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public struct DyldChainedImportGeneral: DyldChainedImportProtocol {
public var nameOffset: Int {
numericCast(layout.name_offset)
}

public var addend: Int {
0
}
}

public struct DyldChainedImportAddend: DyldChainedImportProtocol {
Expand All @@ -55,6 +59,10 @@ public struct DyldChainedImportAddend: DyldChainedImportProtocol {
public var nameOffset: Int {
numericCast(layout.name_offset)
}

public var addend: Int {
numericCast(layout.addend)
}
}

public struct DyldChainedImportAddend64: DyldChainedImportProtocol {
Expand All @@ -72,6 +80,10 @@ public struct DyldChainedImportAddend64: DyldChainedImportProtocol {
public var nameOffset: Int {
numericCast(layout.name_offset)
}

public var addend: Int {
numericCast(layout.addend)
}
}

extension DyldChainedImportGeneral {
Expand Down
1 change: 1 addition & 0 deletions Sources/MachOKit/Protocol/DyldChainedImportProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public protocol DyldChainedImportProtocol: LayoutWrapper {
var libraryOrdinal: Int { get }
var isWeakImport: Bool { get }
var nameOffset: Int { get }
var addend: Int { get }
}

extension DyldChainedImportProtocol {
Expand Down

0 comments on commit ae9f332

Please sign in to comment.