[all-commits] [llvm/llvm-project] 38b632: [ELF] --gdb-index: support --icf={safe, all}

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Oct 20 09:43:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 38b632c16e0fdfd5f5a69bcfd4aecf6f69ea0186
      https://github.com/llvm/llvm-project/commit/38b632c16e0fdfd5f5a69bcfd4aecf6f69ea0186
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp
    A lld/test/ELF/gdb-index-icf.s

  Log Message:
  -----------
  [ELF] --gdb-index: support --icf={safe,all}

The combination has not been tested before. In the case of ICF,
`e.section->getVA(0)` equals the start address of the output section.

This can cause incorrect overlapping with the actual function at the
start of the output section and potentially trigger a GDB internal error
in `dw2_find_pc_sect_compunit_symtab` (presumably because:
if a short address range incorrectly starts at the start address of the
output section, GDB may pick it instead of the correct longer address
range. When mapping an address within the long address range but
out of the scope of the short address range, the routine may find
nothing - while the code asserts that it can find something).

Note that in the case of ICF there may be duplicate address range entries,
but GDB appears to be fine with them.

Reviewed By: grimar

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




More information about the All-commits mailing list