[PATCH] D61477: [ELF] -z combreloc: sort dynamic relocations by (!is_relative,symbol_index,r_offset)

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 03:35:15 PDT 2019


grimar added a comment.

In D61477#1490167 <https://reviews.llvm.org/D61477#1490167>, @mcgrathr wrote:

> The sorting behavior is entirely an optimization for locality at dynamic reloc time.  Both locality of symtab indices and locality of reloc offsets are useful to that goal.


When we initially implemented sorting of relocations, we sorted by symbol index only, because testing showed that it was the only
thing that made a difference: https://reviews.llvm.org/D19528#423828

After that at some point we started sorting by `RelativeRel` to set the DT_RELACOUNT tag.
(Setting this tag was needed for FreeBSD I think, but I do not remember honestly).

So what I want to say that probably sorting by offset is not really usefull. At least would be nice to see the numbers before doing that.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61477/new/

https://reviews.llvm.org/D61477





More information about the llvm-commits mailing list