- if (RELOC_MEMORY_SUB_P(p))
- relocation -= mask & *(short *) (data + addr);
- else if (RELOC_MEMORY_ADD_P(p))
- relocation += mask & *(short *) (data + addr);
- *(short *) (data + addr) &= ~mask;
- *(short *) (data + addr) |= relocation;
+#ifdef tahoe
+ if (((int) data + addr & 1) == 0)
+ {
+#endif
+ if (RELOC_MEMORY_SUB_P(p))
+ relocation -= mask & *(short *) (data + addr);
+ else if (RELOC_MEMORY_ADD_P(p))
+ relocation += mask & *(short *) (data + addr);
+ *(short *) (data + addr) &= ~mask;
+ *(short *) (data + addr) |= relocation;
+#ifdef tahoe
+ }
+ /*
+ * The CCI Power 6 (aka Tahoe) architecture has byte-aligned
+ * instruction operands but requires data accesses to be aligned.
+ * Brain-damage...
+ */
+ else
+ {
+ unsigned char *da = (unsigned char *) (data + addr);
+ unsigned short s = da[0] << 8 | da[1];
+
+ if (RELOC_MEMORY_SUB_P(p))
+ relocation -= mask & s;
+ else if (RELOC_MEMORY_ADD_P(p))
+ relocation += mask & s;
+ s &= ~mask;
+ s |= relocation;
+ da[0] = s >> 8;
+ da[1] = s;
+ }
+#endif