profile-driven optimization and the linker?

Dan Kegel dank@kegel.com
Tue Nov 30 03:24:00 GMT 2004


Will Cohen wrote:
>>> http://gcc.gnu.org/news/profiledriven.html doesn't mention
>>> having ld reorder sections to improve locality of reference
>>> of frequently called functions.    Has that technique
>>> been tried with gcc and binutils?
>>
>> Yes.  I had some success with it a while back.  ...
>> We had some hacks to gprof which would take profile data
>> and build a linker map.  That's the code that really needs
>> to be improved.  I never understood the gprof code well
>> enough to do it right.  ...
> 
> There are a couple of students doing a ECE senior design project at 
> North Carolina Statue University using valgrind/callgrind to collect 
> call-graph information. The information is feed into a program to 
> generate a link script. It should do something similar to ROPE assuming 
> that the code is compiled with -ffunction-section. There should be some 
> information available on it in the near future, the NCSU semester is 
> wrapping up.

Excellent.  I'm trying to put together a similar project for
a course at UCLA, and it'd be nice to be able to build on
what the NCSU project did.
- Dan

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html



More information about the Gcc mailing list