[all-commits] [llvm/llvm-project] c2090f: [obj2yaml] - Don't assert when trying to calculate...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Nov 27 04:50:09 PST 2020


  Branch: refs/heads/temp-test-main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2090ff5942269c391c549f432258e4fd2fa12cb
      https://github.com/llvm/llvm-project/commit/c2090ff5942269c391c549f432258e4fd2fa12cb
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M llvm/test/tools/obj2yaml/ELF/offset.yaml
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [obj2yaml] - Don't assert when trying to calculate the expected section offset.

The following line asserts when `sh_addralign > MAX_UINT32 && (uint32_t)sh_addralign == 0`:

```
    ExpectedOffset = alignTo(ExpectedOffset,
                             SecHdr.sh_addralign ? SecHdr.sh_addralign : 1);
```

it happens because `sh_addralign` is truncated to 32-bit value, but `alignTo`
doesn't accept `Align == 0`. We should change `1` to `1uLL`.

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




More information about the All-commits mailing list