1
Description: fix alignment issue causing a readdir regression on sparc.
2
Origin: backport, https://sourceware.org/git/?p=glibc.git;h=75b4202ab03337edb37536e3d9470a48a04c9341
4
Index: eglibc-2.15/sysdeps/unix/dirstream.h
5
===================================================================
6
--- eglibc-2.15.orig/sysdeps/unix/dirstream.h 2014-07-25 13:21:06.726831895 -0400
7
+++ eglibc-2.15/sysdeps/unix/dirstream.h 2014-07-25 13:23:19.426831241 -0400
10
int errcode; /* Delayed error code. */
12
- /* Directory block. */
13
- char data[0] __attribute__ ((aligned (__alignof__ (void*))));
14
+ /* Directory block. We must make sure that this block starts
15
+ at an address that is aligned adequately enough to store
16
+ dirent entries. Using the alignment of "void *" is not
17
+ sufficient because dirents on 32-bit platforms can require
18
+ 64-bit alignment. We use "long double" here to be consistent
19
+ with what malloc uses. */
20
+ char data[0] __attribute__ ((aligned (__alignof__ (long double))));
23
#define _DIR_dirfd(dirp) ((dirp)->fd)