[all-commits] [llvm/llvm-project] bb0597: [llvm-readelf/obj] - Stop printing wrong addresses...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Thu Sep 24 03:32:14 PDT 2020


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

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

  Log Message:
  -----------
  [llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects.

This is the first patch for https://bugs.llvm.org/show_bug.cgi?id=47581.

Currently -u does not compute function addresses correctly and
dumps broken addresses for non-relocatable objects.

ARM spec says:
"An index table entry consists of 2 words.
The first word contains a prel31 offset (see Relocations) to the start of a function, with bit 31 clear."
...
"The relocated 31 bits form a place-relative signed offset to the referenced entity.
For brevity, this document will refer to the results of these relocations as "prel31 offsets"."

(https://developer.arm.com/documentation/ihi0038/c/?lang=en#index-table-entries)
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#relocations)

Currently we use an address of the SHT_ARM_EXIDX section instead of an address of an entry
in computations. As a result we compute an offset that is not really "place-relative",
but section relative, what is wrong.

The patch fixes this issue.

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




More information about the All-commits mailing list