Support of link time symbols reorder to improve performance

Xi Ruoyao
Thu May 6 16:34:21 GMT 2021

On Fri, 2021-05-07 at 00:06 +0800, 陈云星 via Gcc-help wrote:
> From llvm community: 
> <
> LLD linker has an option :  --symbol-ordering-file
> Which support direct linker to sort symbol in result object by a user
> supplied file;
> This improve performance by reduce instruction cache miss.
> The hottest function will cluster and code cache hit rate will be high.
> Does gnu linker can support this ?

I think with -ffunction-sections and -fdata-sections, and a ld script it
can be achieved.  But it may be very painful.

Cc binutils, as it's a more proper location to discuss this.
Xi Ruoyao <>
School of Aerospace Science and Technology, Xidian University

More information about the Gcc-help mailing list