[all-commits] [llvm/llvm-project] fef3bf: [yaml2obj] Fix bug when referencing items in Secti...

James Henderson via All-commits all-commits at lists.llvm.org
Wed Jun 16 02:02:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fef3bfb1b23af09668d20b09f09c65cc14b5479c
      https://github.com/llvm/llvm-project/commit/fef3bfb1b23af09668d20b09f09c65cc14b5479c
  Author: James Henderson <james.henderson at sony.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M llvm/lib/ObjectYAML/ELFEmitter.cpp
    M llvm/test/tools/yaml2obj/ELF/section-headers.yaml

  Log Message:
  -----------
  [yaml2obj] Fix bug when referencing items in SectionHeaderTable

There was an off-by-one error caused by an index (which included an
index for the null section header) being used to check against the size
of a list of sections (which didn't include the null section header).

This is a partial fix for https://bugs.llvm.org/show_bug.cgi?id=50506.

Reviewed by: MaskRay

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


  Commit: 5c1639fe064b548adff67d45e1f8cedae395ed6f
      https://github.com/llvm/llvm-project/commit/5c1639fe064b548adff67d45e1f8cedae395ed6f
  Author: James Henderson <james.henderson at sony.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M llvm/include/llvm/ObjectYAML/ELFYAML.h
    M llvm/lib/ObjectYAML/ELFEmitter.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/test/tools/obj2yaml/ELF/invalid-section-name.yaml
    A llvm/test/tools/obj2yaml/ELF/shstrtab.yaml
    A llvm/test/tools/yaml2obj/ELF/shstrtab.yaml
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [yaml2obj][obj2yaml] Support custom ELF section header string table name

This patch adds support for a new field in the FileHeader, which states
the name to use for the section header string table. This also allows
combining the string table with another string table in the object, e.g.
the symbol name string table. The field is optional. By default,
.shstrtab will continue to be used.

This partially fixes https://bugs.llvm.org/show_bug.cgi?id=50506.

Reviewed by: Higuoxing

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


Compare: https://github.com/llvm/llvm-project/compare/6f778fed8e50...5c1639fe064b


More information about the All-commits mailing list