From: Keith Owens <kaos@ocs.com.au>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Patch modutils-2.4.22 for brl in modules
Date: Thu, 13 Mar 2003 05:53:34 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590709806075@msgid-missing> (raw)
While testing spin_lock() using brl, I realised that modutils does not
support R_IA64_PCREL60B, so brl from a module to ia64_spinlock_contention
does not work. This patch against modutils 2.4.22 will appear in
2.4.23, I am making it available now for people who want to test the
new spinlock code in modules.
Do not panic if kdb shows the wrong target address for brl. ia64-dis.c
in kdb v3.0 incorrectly decodes brl, kdb v4.0 decodes it correctly.
Index: 23.9/obj/obj_ia64.c
--- 23.9/obj/obj_ia64.c Wed, 31 Jul 2002 10:41:48 +1000 kaos (modutils-2.4/c/0_obj_ia64.c 1.8 644)
+++ 23.10/obj/obj_ia64.c Thu, 13 Mar 2003 14:39:45 +1100 kaos (modutils-2.4/c/0_obj_ia64.c 1.9 644)
@@ -266,6 +266,24 @@ obj_ia64_ins_imm64(Elf64_Xword v, Elf64_
}
/*
+ * 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;
reply other threads:[~2003-03-13 5:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590709806075@msgid-missing \
--to=kaos@ocs.com.au \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox