[all-commits] [llvm/llvm-project] 25394c: [llvm-objdump] Change printSymbolVersionDependency...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Sep 14 12:30:50 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25394c9d10e73b666f4fa1dff2426824894cce58
      https://github.com/llvm/llvm-project/commit/25394c9d10e73b666f4fa1dff2426824894cce58
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-09-14 (Wed, 14 Sep 2022)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/test/tools/llvm-objdump/ELF/verneed-invalid.test
    M llvm/test/tools/llvm-objdump/ELF/verneed.test
    M llvm/tools/llvm-objdump/ELFDump.cpp

  Log Message:
  -----------
  [llvm-objdump] Change printSymbolVersionDependency to use ELFFile API

When .gnu.version_r is empty (allowed by readelf but warned by objdump),
llvm-objdump -p may decode the next section as .gnu.version_r and may crash due
to out-of-bounds C string reference. ELFFile<ELFT>::getVersionDependencies
handles 0-entry .gnu.version_r gracefully. Just use it.

Fix https://github.com/llvm/llvm-project/issues/57707

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




More information about the All-commits mailing list