This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to get typesizes w/o running binary ?


Enrico Weigelt wrote:
> I'd like to probe typesizes. 
> Simply building and running some little test program is trivial.
> But I'd like to do it *without* running an test program.

Something like a .c file with two lines:

#include <stddef.h>
size_t siz = sizeof(whatever);

compile it using -S, and check the assembler output, e.g.:

        .file   "sizetest.c"
        .globl  siz
        .data
        .align 4
        .type   siz, @object
        .size   siz, 4
siz:
        .long   8		<--- there's your info :)


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]