public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Structure Alignment
@ 2002-10-11 11:42 Sivaguru Sankaridurg
  2002-10-11 11:47 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Sivaguru Sankaridurg @ 2002-10-11 11:42 UTC (permalink / raw)
  To: binutils

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).

Thanks
Siva

----------------------------------------------------------------------------
------------
SpamNet - Stop spam immediately and help me too!
www.cloudmark.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Structure Alignment
  2002-10-11 11:42 Structure Alignment Sivaguru Sankaridurg
@ 2002-10-11 11:47 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-10-11 11:47 UTC (permalink / raw)
  To: Sivaguru Sankaridurg; +Cc: binutils

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-11 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 11:42 Structure Alignment Sivaguru Sankaridurg
2002-10-11 11:47 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).