Re: Can gcc do same work like VS2005 "/ORDER" options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Wu .Shao Lin" <shao.lin.wu@xxxxxxxxx> 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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux