[all-commits] [llvm/llvm-project] c314f5: ObjectFileELF: Test whether reloc_header is non-nu...

pcc via All-commits all-commits at lists.llvm.org
Thu Feb 11 15:05:57 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c314f5ede8249ef20fff1de45c2c31156b1950d4
      https://github.com/llvm/llvm-project/commit/c314f5ede8249ef20fff1de45c2c31156b1950d4
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2021-02-11 (Thu, 11 Feb 2021)

  Changed paths:
    M lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    A lldb/test/Shell/ObjectFile/ELF/null-jmprel.yaml

  Log Message:
  -----------
  ObjectFileELF: Test whether reloc_header is non-null instead of asserting.

It is possible for the GetSectionHeaderByIndex lookup to fail because
the previous FindSectionContainingFileAddress lookup found a segment
instead of a section. This is possible if the binary does not have
a PLT (which means that lld will in some circumstances set DT_JMPREL
to 0, which is typically an address that is part of the ELF headers
and not in a section) and may also be possible if the section headers
have been stripped. To handle this possibility, replace the assert
with an if.

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




More information about the All-commits mailing list