[all-commits] [llvm/llvm-project] fee910: [libObject, llvm-readelf] - Stop describing a secti...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Nov 25 01:59:02 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fee910e522c997d7606f31148e01bcf67f3f94d1
      https://github.com/llvm/llvm-project/commit/fee910e522c997d7606f31148e01bcf67f3f94d1
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-11-25 (Wed, 25 Nov 2020)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/test/tools/llvm-readobj/ELF/gnu-notes.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [libObject,llvm-readelf] - Stop describing a section/segment in `notes_begin()`.

`notes_begin()` is used for iterating over notes. This API in some cases might print
section type and index. At the same time during iterating, the `Elf_Note_Iterator`
might omit it as it doesn't have this info.

Because of above we might have the redundant duplication of information in warnings:
(See D92021).

```
warning: '[[FILE]]': unable to read notes from the SHT_NOTE section with index 1: SHT_NOTE section [index 1] has invalid offset (0x40) or size (0xffff0000)
```

This change stops reporting section index/type in Object/ELF.h/notes_begin().
(FTR, this was introduced by me for llvm-readobj in D64470).
Instead we can describe sections/program headers on the caller side.

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




More information about the All-commits mailing list