[all-commits] [llvm/llvm-project] 141906: [llvm-readelf/obj] - Add support of multiple SHT_S...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Jan 13 00:42:13 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 141906fa149ffaa37bb5b65e9890ab1f0f3effd5
      https://github.com/llvm/llvm-project/commit/141906fa149ffaa37bb5b65e9890ab1f0f3effd5
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/test/Object/invalid.test
    M llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
    M llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
    M llvm/test/tools/llvm-readobj/ELF/mips-got.test
    M llvm/test/tools/llvm-readobj/ELF/mips-plt.test
    M llvm/test/tools/llvm-readobj/ELF/section-symbols.test
    M llvm/test/tools/llvm-readobj/ELF/symbol-shndx.test
    A llvm/test/tools/llvm-readobj/ELF/symtab-shndx.test
    M llvm/test/tools/obj2yaml/ELF/sht-symtab-shndx.yaml
    M llvm/test/tools/yaml2obj/ELF/sht-symtab-shndx.yaml
    M llvm/tools/llvm-readobj/ELFDumper.cpp
    M llvm/unittests/Object/ELFTest.cpp

  Log Message:
  -----------
  [llvm-readelf/obj] - Add support of multiple SHT_SYMTAB_SHNDX sections.

Currently we don't support multiple SHT_SYMTAB_SHNDX sections
and the DT_SYMTAB_SHNDX tag currently.

This patch implements it and fixes the
https://bugs.llvm.org/show_bug.cgi?id=43991.

I had to introduce the `struct DataRegion` to ELF.h,
it is used to represent a region that might have no known size.
It is needed, because we don't know the size of the extended
section indices table when it is located via DT_SYMTAB_SHNDX.
In this case we still want to validate that we don't read
past the end of the file.

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




More information about the All-commits mailing list