Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Natural alignment used on NetBSD/m68k



On Sat, Feb 08, 2025 at 10:19:08PM +0900, Izumi Tsutsui wrote:
> > Do you happen to know whether NetBSD has always used four bytes or did that
> > change in the past?
> 
> Maybe we have to clarify the definition of "a natural alignment",
> but IIRC there were incompatible alignment issue when we have
> switched from a.out to ELF.

Yes, it was always this way since we switched to ELF.

The gcc config for linux overrides the m68k defaults:

m68k/linux.h:#undef STRICT_ALIGNMENT
m68k/linux.h:#define STRICT_ALIGNMENT 0
m68k/linux.h:#undef M68K_HONOR_TARGET_STRICT_ALIGNMENT
m68k/linux.h:#define M68K_HONOR_TARGET_STRICT_ALIGNMENT 0

while the NetBSD configuration keeps all SVR4/ELF alignment defaults
and only sets BIGGEST_ALIGNMENT to 64:

m68k/netbsd-elf.h:#undef BIGGEST_ALIGNMENT
m68k/netbsd-elf.h:#define BIGGEST_ALIGNMENT 64

See:
https://github.com/NetBSD/src/blob/trunk/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h


Martin


Home | Main Index | Thread Index | Old Index