Can gcc do same work like VS2005 "/ORDER" options
Ian Lance Taylor
iant@google.com
Mon Aug 1 16:48:00 GMT 2011
"Wu .Shao Lin" <shao.lin.wu@gmail.com> writes:
> I am playing with C, and have tried the -freorder-functions with
> __attribute__((hot)), it works some but the link only reorder the
> functions that in one object file range , Is there any way to ask link
> to reorder the functions in whole executive file range?
If you are using the gold linker you can use the --section-ordering-file
option. You should use -ffunction-sections to give each function its
own section.
> Can I name the functions (C code) to other code segments (instead
> of .text by default)?
Sure. See __attribute__ ((section (xxx))).
See also gcc's -freorder-blocks-and-partition option.
Ian
More information about the Gcc-help
mailing list