[all-commits] [llvm/llvm-project] 5f627c: [lld-macho] Fix symbol name returned from InputSec...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Mon Jun 13 12:52:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f627cc2251c17ed9362abd556b425e7d0a53437
      https://github.com/llvm/llvm-project/commit/5f627cc2251c17ed9362abd556b425e7d0a53437
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-06-13 (Mon, 13 Jun 2022)

  Changed paths:
    M lld/MachO/InputSection.cpp
    M lld/test/MachO/invalid/range-check.s

  Log Message:
  -----------
  [lld-macho] Fix symbol name returned from InputSection::getLocation

This commit fixes the issue that getLocation always printed the name of
the first symbol in the section.

For clarity, upper_bound is used instead of a linear search for finding
the closest symbol name. Note that this change does not affect
performance: this function is only called when printing errors and
`symbols` typically contains a single symbol because of
.subsections_via_symbols.

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




More information about the All-commits mailing list