[all-commits] [llvm/llvm-project] 4ba006: [llvm-readobj/elf] - Fix the PREL31 relocation com...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Mon Sep 28 06:23:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ba00619ee70be6eda1d6fbd37471636145d1140
      https://github.com/llvm/llvm-project/commit/4ba00619ee70be6eda1d6fbd37471636145d1140
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-09-28 (Mon, 28 Sep 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/ARM/unwind-non-relocatable.test
    M llvm/tools/llvm-readobj/ARMEHABIPrinter.h

  Log Message:
  -----------
  [llvm-readobj/elf] - Fix the PREL31 relocation computation used for dumping arm32 unwind info (-u).

This is a part of https://bugs.llvm.org/show_bug.cgi?id=47581.

We have the following computation:
```
(1) uint64_t Location = Address & 0x7fffffff;
(2) if (Location & 0x04000000)
(3)   Location |= (uint64_t) ~0x7fffffff;
(4) return Location + Place;
```

At line 2 there is a mistype. The constant should be `0x40000000`,
not `0x04000000`, because the intention here is to sign extend the `Location`,
which is the 31 bit signed value.

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




More information about the All-commits mailing list