Anton Blanchard wrote: >Hi, > >I was unable to boot 2.5-BK on ppc64 and narrowed it down to the fast >poll patch. I found: > >offsetof(struct poll_list, entries) == 12 but >sizeof(struct poll_list) == 16 > >This means pp+1 did not match up with pp->entries. Im not sure what the >alignment requirements are for a zero length struct (ie is this a >compiler bug) but the following patch fixes the problem and also changes >->len to a long to ensure 8 byte alignment of ->entries on 64bit archs. > > That seems to be the root of the problem: ->entries requires 4 byte alignment, while struct poll_list requires 8 byte alignment. Thus the compiler aligns entries to a 4-byte boundary, and rounds up sizeof(struct poll_list) to 16. Attached is a small test case that shows the problem on both 64-bit and 32-bit platforms. I'm not sure if this is a gcc bug: the Compaq C compiler on Tru64 and MSVC on Windows generate the same structure layout. -- Manfred