+/* Read a width sized value from memory. */
+
+static bfd_vma
+read_value (abfd, buf, width)
+ bfd *abfd;
+ bfd_byte *buf;
+ int width;
+{
+ bfd_vma value;
+
+ switch (width)
+ {
+ case 2: value = bfd_get_16 (abfd, buf); break;
+ case 4: value = bfd_get_32 (abfd, buf); break;
+ case 8: value = bfd_get_64 (abfd, buf); break;
+ default: BFD_FAIL (); return 0;
+ }
+
+ return value;
+}
+
+/* Store a width sized value to memory. */
+
+static void
+write_value (abfd, buf, value, width)
+ bfd *abfd;
+ bfd_byte *buf;
+ bfd_vma value;
+ int width;
+{
+ switch (width)
+ {
+ case 2: bfd_put_16 (abfd, value, buf); break;
+ case 4: bfd_put_32 (abfd, value, buf); break;
+ case 8: bfd_put_64 (abfd, value, buf); break;
+ default: BFD_FAIL ();
+ }
+}
+