[all-commits] [llvm/llvm-project] 317c49: [obj2yaml] - Fix the issue with dumping empty sect...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Apr 22 02:36:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 317c4913c642f8f7fa0fb150fd5e656b59f20a4a
      https://github.com/llvm/llvm-project/commit/317c4913c642f8f7fa0fb150fd5e656b59f20a4a
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-04-22 (Wed, 22 Apr 2020)

  Changed paths:
    M llvm/test/Object/obj2yaml.test
    M llvm/test/tools/obj2yaml/program-headers.yaml
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [obj2yaml] - Fix the issue with dumping empty sections when dumping program headers.

Imagine we have:

```
ProgramHeaders:
  - Type:  PT_LOAD
    Flags: [ PF_W, PF_R ]
    Sections:
      - Section: .bar
    VAddr: 0x2000
Sections:
  - Name:    .foo
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x1000
  - Name:    .bar
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x2000
```

Both `.foo` and `.bar` share the same starting file offset,
but `VA(.foo)` < `VA(PT_LOAD)`, we should not include it into segment.

This patch fixes the issue.

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




More information about the All-commits mailing list