summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_ia64.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mdk-stage1/insmod-modutils/obj/obj_ia64.c b/mdk-stage1/insmod-modutils/obj/obj_ia64.c
index 3b6156abf..a270e4a9c 100644
--- a/mdk-stage1/insmod-modutils/obj/obj_ia64.c
+++ b/mdk-stage1/insmod-modutils/obj/obj_ia64.c
@@ -266,6 +266,24 @@ obj_ia64_ins_imm64(Elf64_Xword v, Elf64_Addr *bundle, Elf64_Xword slot)
}
/*
+ * add a immediate 60 value to the instruction at slot in bundle
+ */
+enum obj_reloc
+obj_ia64_ins_pcrel60b(Elf64_Xword v, Elf64_Addr *bundle, Elf64_Xword slot)
+{
+ Elf64_Xword ins;
+
+ assert(slot == 2);
+
+ ins = obj_ia64_ins_extract_from_bundle(bundle, slot);
+ ins &= 0xffffffee00001fff;
+ ins |= ((v & 0x8000000000000000) >> 27) | ((v & 0x0000000000fffff0) << 9);
+ obj_ia64_ins_insert_in_bundle(bundle, slot, ins);
+ obj_ia64_ins_insert_in_bundle(bundle, --slot, ((v & 0x7fffffffff000000) >> 22));
+ return obj_reloc_ok;
+}
+
+/*
* create a plt entry
*/
enum obj_reloc
@@ -852,6 +870,10 @@ arch_apply_relocation(struct obj_file *f,
}
break;
+ case R_IA64_PCREL60B : /* @pcrel(sym + add), brl */
+ ret = obj_ia64_ins_pcrel60b(v - dot, bundle, slot);
+ break;
+
case R_IA64_PCREL32LSB : /* @pcrel(sym + add), data4 LSB */
COPY_32LSB(loc, v-dot);
break;