[all-commits] [llvm/llvm-project] 78aea9: [llvm-readelf/obj] - Handle out-of-order PT_LOADs ...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Dec 16 02:04:40 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 78aea98308a85c061a87952e9842bf1e6fe097d5
      https://github.com/llvm/llvm-project/commit/78aea98308a85c061a87952e9842bf1e6fe097d5
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/lib/Object/ELF.cpp
    M llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp
    M llvm/unittests/Object/ELFObjectFileTest.cpp

  Log Message:
  -----------
  [llvm-readelf/obj] - Handle out-of-order PT_LOADs better.

This is https://bugs.llvm.org/show_bug.cgi?id=45698.

Specification says that
"Loadable segment entries in the program header table appear
in ascending order, sorted on the p_vaddr member."

Our `toMappedAddr()` relies on this condition. This patch
adds a warning when the sorting order of loadable segments is wrong.
In this case we force segments sorting and that allows
`toMappedAddr()` to work as expected.

Differential revision: https://reviews.llvm.org/D92641




More information about the All-commits mailing list