public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Can gcc do same work like VS2005 "/ORDER" options
@ 2011-08-01  5:54 Wu .Shao Lin
  2011-08-01 16:48 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Wu .Shao Lin @ 2011-08-01  5:54 UTC (permalink / raw)
  To: gcc-help

Hi, GCC experts:

    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?

    Can I name the functions (C code) to other code segments (instead
of .text by default)?

Thanks & Best Regards,
Shaolin

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

* Re: Can gcc do same work like VS2005 "/ORDER" options
  2011-08-01  5:54 Can gcc do same work like VS2005 "/ORDER" options Wu .Shao Lin
@ 2011-08-01 16:48 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-08-01 16:48 UTC (permalink / raw)
  To: Wu .Shao Lin; +Cc: gcc-help

"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

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

end of thread, other threads:[~2011-08-01 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-01  5:54 Can gcc do same work like VS2005 "/ORDER" options Wu .Shao Lin
2011-08-01 16:48 ` Ian Lance Taylor

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