Fixing the unfixable autofs ABI
Posted May 3, 2012 18:46 UTC (Thu) by
nybble41 (subscriber, #55106)
In reply to:
Fixing the unfixable autofs ABI by jzbiciak
Parent article:
Fixing the unfixable autofs ABI
Yes, but if you add padding fields you can ensure the same alignment on all reasonable architectures:
struct fixed
{
__u64 f1;
__u32 f2;
__u32 pad1;
};
This way sizeof(struct fixed) is 16 bytes on i386 and x86-64. Of course, that doesn't help with the structure from this article, because the smaller i386 alignment was written into the ABI. IMHO, any structures exposed through the ABI should be naturally aligned and marked as "packed", with explicit padding fields where necessary; alignment should not be left to the compiler where ABI compatibility is a concern.
(
Log in to post comments)