summaryrefslogtreecommitdiff
path: root/compiler/linker/linker_patch.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/linker/linker_patch.h')
-rw-r--r--compiler/linker/linker_patch.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h
index 4000fc2523..7da1e82d91 100644
--- a/compiler/linker/linker_patch.h
+++ b/compiler/linker/linker_patch.h
@@ -47,6 +47,7 @@ class LinkerPatch {
kDataBimgRelRo,
kMethodRelative,
kMethodBssEntry,
+ kJniEntrypointRelative,
kCallRelative,
kTypeRelative,
kTypeBssEntry,
@@ -96,6 +97,16 @@ class LinkerPatch {
return patch;
}
+ static LinkerPatch RelativeJniEntrypointPatch(size_t literal_offset,
+ const DexFile* target_dex_file,
+ uint32_t pc_insn_offset,
+ uint32_t target_method_idx) {
+ LinkerPatch patch(literal_offset, Type::kJniEntrypointRelative, target_dex_file);
+ patch.method_idx_ = target_method_idx;
+ patch.pc_insn_offset_ = pc_insn_offset;
+ return patch;
+ }
+
static LinkerPatch RelativeCodePatch(size_t literal_offset,
const DexFile* target_dex_file,
uint32_t target_method_idx) {
@@ -208,6 +219,7 @@ class LinkerPatch {
MethodReference TargetMethod() const {
DCHECK(patch_type_ == Type::kMethodRelative ||
patch_type_ == Type::kMethodBssEntry ||
+ patch_type_ == Type::kJniEntrypointRelative ||
patch_type_ == Type::kCallRelative);
return MethodReference(target_dex_file_, method_idx_);
}
@@ -245,6 +257,7 @@ class LinkerPatch {
patch_type_ == Type::kDataBimgRelRo ||
patch_type_ == Type::kMethodRelative ||
patch_type_ == Type::kMethodBssEntry ||
+ patch_type_ == Type::kJniEntrypointRelative ||
patch_type_ == Type::kTypeRelative ||
patch_type_ == Type::kTypeBssEntry ||
patch_type_ == Type::kPublicTypeBssEntry ||