On Fri, Apr 27, 2007 at 08:26:10AM -0500, Eric Sandeen wrote: > >Yep. Padding rules on old-ABI ARM systems are 'special', but still > >spec-compliant. See: > > Thanks, I've read up a bit since, and I think I grok it now :) > > So, adding __attribute__((packed)) to xfs_dir2_sf_off_t, > xfs_dir2_sf_hdr_t, and perhaps also xfs_dir2_sf_entry_t might fix things?
It might, but it would likely also reduce performance on other platforms. I.e. on platforms that can't do unaligned accesses, if you access, say, an unsigned long long via a pointer to a struct that is __attribute__((packed)), the compiler might end up emitting 8 individual byte accesses, and combining those values together into a long long by hand. You'd probably want to do something like: #if defined(__arm__) && !defined(__ARM_EABI__) #define PACKED __attribute__((packed)) #else #define PACKED #endif typedef struct { int foo; char bar; long baz; } PACKED; Or something like that. > The xfstest suite is pretty good, if anyone would like to run > through it on arm with the above packed structures... I'll have a look. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]