Symbol re-ordering in ld?

Bryce McKinlay bryce@albatross.co.nz
Mon Mar 26 21:22:00 GMT 2001


Is it possible to have the linker emit symbols in some explicit order,
rather than just whatever order is encountered in the input files?

Specifically, GCJ emits a "class registration" global constructor for
every class it compiles. These end up being dispersed throughout
generated archives (such as libgcj.so), resulting in added startup
overhead as the kernel has to bring in many dispersed pages. If we
could group those global constructor functions together, the number of
page faults at startup would presumably be reduced resulting in faster
loading binaries.

Additionally, wouldn't it be a generally useful optimization to have
the linker always group global constructors together in an output
file?

regards

  [ bryce ]




More information about the Binutils mailing list