Is there any specification on the symbol ordering file

Dear LLVM developers,

I see ld.lld support symbol-ordering-file option to support custom symbol layout. Unfortunately, there seems to be no accompanied documents on this feature. I do not know what kind of format I should use to customize the layout.

P.S. I was to use my own runtime profiling tool is generate the function placement. The code is compiled with -ffunction-sections and I wanted to reorder the function symbols in the final binary output.

Best.

Yifan ZHU

I know this is an old thread, but as it comes up high in Google, I thought Iā€™d respond: the symbol order file is essentially a list of symbols, one-per-line, which LLD will attempt to order relative to one another, in the order specified in the file, by laying out the corresponding sections appropriately. Whitespace on the line will be trimmed.

1 Like