[ELF] --gdb-index: use lower_bound to compute relative CU index in the object file
authorFangrui Song <maskray@google.com>
Thu, 29 Nov 2018 00:17:00 +0000 (00:17 +0000)
committerFangrui Song <maskray@google.com>
Thu, 29 Nov 2018 00:17:00 +0000 (00:17 +0000)
commitf2143761d6450d7be992f69602e1826e3e5774f4
treebe4927ac25c695c5e77a6d264d5bd37e88057980
parent2de209313e88467ec0103b1c69d37f80eef03107
[ELF] --gdb-index: use lower_bound to compute relative CU index in the object file

Summary:
This reinstates what I originally intended to do in D54361.
It removes the assumption that .debug_gnu_pubnames has increasing CuOffset.

Now we do better than gold here: when .debug_gnu_pubnames contains
multiple sets, gold would think every set has the same CU index as the
first set (incorrect).

Reviewed By: ruiu

Reviewers: ruiu, dblaikie, espindola

Subscribers: emaste, arichardson, arphaman, llvm-commits

Differential Revision: https://reviews.llvm.org/D54483

llvm-svn: 347820
lld/ELF/SyntheticSections.cpp
lld/test/ELF/gdb-index-multiple-cu.s