summaryrefslogtreecommitdiff
path: root/binutils/patches/libiberty-md5.diff
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/patches/libiberty-md5.diff')
-rw-r--r--binutils/patches/libiberty-md5.diff32
1 files changed, 32 insertions, 0 deletions
diff --git a/binutils/patches/libiberty-md5.diff b/binutils/patches/libiberty-md5.diff
new file mode 100644
index 0000000..e0d912a
--- /dev/null
+++ b/binutils/patches/libiberty-md5.diff
@@ -0,0 +1,32 @@
+# DP: Fix alias warning building libiberty/md5.c
+
+--- a/include/md5.h
++++ a/include/md5.h
+@@ -86,7 +86,11 @@
+
+ md5_uint32 total[2];
+ md5_uint32 buflen;
+- char buffer[128] ATTRIBUTE_ALIGNED_ALIGNOF(md5_uint32);
++ union
++ {
++ char buffer[128];
++ md5_uint32 buffer32[32];
++ };
+ };
+
+ /*
+--- a/libiberty/md5.c
++++ b/libiberty/md5.c
+@@ -114,9 +114,9 @@
+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
+
+ /* Put the 64-bit file length in *bits* at the end of the buffer. */
+- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
+- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
+- (ctx->total[0] >> 29));
++ ctx->buffer32[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3);
++ ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3) |
++ (ctx->total[0] >> 29));
+
+ /* Process last bytes. */
+ md5_process_block (ctx->buffer, bytes + pad + 8, ctx);