From: "Grégoire Sutre" <gregoire.sutre@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Issue in netbsd_bootinfo.h
Date: Thu, 10 Nov 2011 00:42:21 +0100 [thread overview]
Message-ID: <4EBB0FDD.5020606@gmail.com> (raw)
In-Reply-To: <alpine.GSO.2.00.1111081608500.965@oretfbsg>
On 11/09/2011 01:14 AM, Seth Goldberg wrote:
> Hi,
>
> 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:
http://nxr.netbsd.org/xref/src/sys/arch/x86/include/bootinfo.h#70
> Or did you mean to add "__attribute__((packed))"
> there?
Indeed, you're right. NetBSD defines __packed depending on the
compiler:
http://nxr.netbsd.org/source/xref/src/sys/sys/cdefs.h#314
For GCC, it's "__attribute__((__packed__))" as you said. Sorry
about that. I wonder why it didn't cause problems until now, though.
Grégoire
next prev parent reply other threads:[~2011-11-09 23:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 0:14 Issue in netbsd_bootinfo.h Seth Goldberg
2011-11-09 23:42 ` Grégoire Sutre [this message]
2011-11-09 23:57 ` Seth Goldberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EBB0FDD.5020606@gmail.com \
--to=gregoire.sutre@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.