Re: Question on BIGGEST_ALIGNMENT in GCC on NetBSD/m68k
Laurent Vivier <[email protected]> Mon, 16 Jun 2025 13:16:36 +0200
| Newsgroups | gmane.linux.ports.m68k,gmane.os.netbsd.ports.m68k,gmane.linux.debian.ports.68k |
|---|---|
| Message-ID | <[email protected]> |
On 16/06/2025 13:10, John Paul Adrian Glaubitz wrote:
> On Mon, 2025-06-16 at 13:05 +0200, Laurent Vivier wrote:
>> I think an e_flags with a new value like EF_M68K_ABI2 would be more appropriate.
>
> How is it currently used on m68k and does QEMU use it? I think that would be
> certainly a way to go.
>
It's not used by m68k.
It's only used by MIPS.
In QEMU see linux-user/elfload.c:
#ifdef TARGET_ABI_MIPSN32
#define elf_check_abi(x) ((x) & EF_MIPS_ABI2)
#else
#define elf_check_abi(x) (!((x) & EF_MIPS_ABI2))
#endif
#ifndef elf_check_abi
#define elf_check_abi(x) (1)
#endif
/* Verify the portions of EHDR outside of E_IDENT for the target.
This has to wait until after bswapping the header. */
static bool elf_check_ehdr(struct elfhdr *ehdr)
{
return (elf_check_arch(ehdr->e_machine)
&& elf_check_abi(ehdr->e_flags)
&& ehdr->e_ehsize == sizeof(struct elfhdr)
&& ehdr->e_phentsize == sizeof(struct elf_phdr)
&& (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN));
}
...
static void load_elf_image(const char *image_name, const ImageSource *src,
struct image_info *info, struct elfhdr *ehdr,
char **pinterp_name)
...
if (!elf_check_ehdr(ehdr)) {
error_setg(&err, "Invalid ELF image for this architecture");
goto exit_errmsg;
}
...
Thanks,
Laurent