[PATCH] D54483: [ELF] .gdb_index: use lower_bound to compute relative CU index in an object file

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 23:25:37 PST 2018


dblaikie added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:2433
+                      [](GdbIndexSection::CuEntry CU, uint32_t Offset) {
+                        return CU.CuOffset < Offset;
+                      }) -
----------------
ruiu wrote:
> Hmm, not sure if I follow. This new code still assume that CUs is sorted by CuOffset, no?
It's not that CUs could be unordered wrt CuOffset - they're read from the section linearly, so they're necessarily ordered from smallest to largest CuOffset.

But the order of references from pubnames contributions isn't ordered relative to them - so the first pubnames contribution might reference the last CU, for instance.

The currently committed solution assumes that the pubnames contribution are in the same order as the CU contributions (for each pubnames contribution, it walks from the last CU referenced from a pubnames contribution (or from the start if it's the first) expecting to find the next one - never doubling back).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54483





More information about the llvm-commits mailing list