GCC-3.4, official way to get size of functions ?
Etienne Lorrain
etienne_lorrain@yahoo.fr
Tue Oct 21 11:09:00 GMT 2003
More information about the Binutils mailing list
Tue Oct 21 11:09:00 GMT 2003
- Previous message (by thread): ld doesn't warn about undefined memory region name
- Next message (by thread): GCC-3.4, official way to get size of functions ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
For gujin, a project of mine, I need once to get
the size in bytes of a function.
Before GCC-3.4, I was getting the size of one function doing:
__attribute__ ((section (".xdata"))) __attribute__ ((cdecl, regparm (0)))
static unsigned
linux_set_params (unsigned totalmem,
struct loader_t bootloader_type,
struct linux_param *LnxParam,
struct LOADER_str *loader,
struct gpl_compliant_str *togpl,
struct desc_str *system_desc,
int proposed_row,
char **string2print)
{
....
}
asm ("__sizeof_linux_set_params = . - linux_set_params\n");
But with my version of GCC-3.4 (one month old,
gcc (GCC) 3.4 20030924 (experimental)) the asm is now inserted
at the beginning of the file, before any function, maybe because
I am using --function-section.
I cannot add "volatile" to this asm because it is refused by
the compiler on this context.
I noticed the line:
.size menu_load_system, .-menu_load_system
after every function there is such a line.
Is there any official way to get the value of this last
debugging symbol - or an official way to get the size of a
function?
Thanks,
Etienne.
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
- Previous message (by thread): ld doesn't warn about undefined memory region name
- Next message (by thread): GCC-3.4, official way to get size of functions ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list