This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Structure Alignment
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Sivaguru Sankaridurg <siva at eternal-systems dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 11 Oct 2002 14:47:03 -0400
- Subject: Re: Structure Alignment
- References: <000b01c27156$47877120$21a8a8c0@sirius>
On Fri, Oct 11, 2002 at 11:44:48AM -0700, Sivaguru Sankaridurg wrote:
> Hi,
>
> If I have a program that defines a structure ( say struct node { char c; int
> i; } ), is there any way that I can get the alignment information for this
> structure from objdump OR by using BFD api ?
>
> Note:
> * I dont want to use alignof() builtin function, bcos all I have is the name
> of the structure as a char*. For example think that I am writing a function
> "int GetAlignment(char *typename)", that accepts the typename ("node" in
> this case) and returns the alignment required for the type (4 -- in this
> case).
Nope. This information is generally not encoded in debug information
at all; you're out of luck.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer