[PATCH] D101116: [ELF] Support .rela.eh_frame with unordered r_offset values

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 02:48:22 PDT 2021


peter.smith added a comment.

My understanding is that there is no requirement in ELF for relocations being in r_offset order even if that is how must object producers naturally generate them. This would make the inputs legal if unconventional. Although I have no numbers I'd expect a linear scan of the relocations for just EHInputSection with little computation to be small, but of course every linear scan costs. It may be possible to set a flag in EHInputSection after the first llvm::is_sorted so that only one test for the relocations being sorted is necessary.

One possible alternative, although I have little confidence it would be a better solution, is to effectively run something like a cut down scanRelocs() early for EHInputSections only. This would need to be done prior to split(). This could by construction ensure the relocations in EHInputSection were added in r_offset order and split() could use these relocations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101116



More information about the llvm-commits mailing list