Open th-otto opened 3 years ago
On m68k, the alignment of all types >= 2 bytes should be 2, not 4 as specified in 68000.cspec. To verify:
$ cat foo.c struct foo { short x; double y; }; int x = __builtin_offsetof(struct foo, y); $ m68k-elf-gcc -S -o - foo.c x: .long 2 .ident "GCC: (GNU) 10.0.1 20200501 (prerelease)"
The value of the global variable "x" there is 2. That would be the case also for other types of y in the structure.
I've encountered this multiple times when analyzing old Amiga programs - many of the standard structures contain pointers which straddle a 32-bit boundary and thus end up being the wrong size.
On m68k, the alignment of all types >= 2 bytes should be 2, not 4 as specified in 68000.cspec. To verify:
The value of the global variable "x" there is 2. That would be the case also for other types of y in the structure.