[Top][All Lists]

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

Re: Issue in netbsd_bootinfo.h

From: Seth Goldberg
Subject: Re: Issue in netbsd_bootinfo.h
Date: Wed, 9 Nov 2011 15:57:43 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)


Great. My guess is: some linkers are more forgiving than others. Can you get this fixed for non-Netbsd platforms where __packed is undefined, please?


Quoting Grégoire Sutre, who wrote the following on Thu, 10 Nov 2011:

On 11/09/2011 01:14 AM, Seth Goldberg wrote:

The following structure definition is causing linker failures (not with GNU
ld) when building GRUB2:

struct grub_netbsd_btinfo_bootwedge {
grub_uint32_t biosdev;
grub_disk_addr_t startblk;
grub_uint64_t nblks;
grub_disk_addr_t matchblk;
grub_uint64_t matchnblks;
grub_uint8_t matchhash[16]; /* MD5 hash */
} __packed;

The question is: Is this a valid way to declare a structure with a packed
data structure on NetBSD?

Yes.  IIRC, this struct declaration was inspired from:

Or did you mean to add "__attribute__((packed))"

Indeed, you're right.  NetBSD defines __packed depending on the

For GCC, it's "__attribute__((__packed__))" as you said.  Sorry
about that.  I wonder why it didn't cause problems until now, though.


Grub-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]