[all-commits] [llvm/llvm-project] 8119ab: [dsymutil] Fix .debug_addr index calculation

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Jun 16 13:27:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8119ab9bf78b3c0af26eb820527be1193a77c97d
      https://github.com/llvm/llvm-project/commit/8119ab9bf78b3c0af26eb820527be1193a77c97d
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    A llvm/test/tools/dsymutil/ARM/dwarf5-addrx-0x0-last.test
    A llvm/test/tools/dsymutil/Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.o
    A llvm/test/tools/dsymutil/Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out
    M llvm/tools/dsymutil/DwarfLinkerForBinary.cpp

  Log Message:
  -----------
  [dsymutil] Fix .debug_addr index calculation

The DW_OP_addrx operation encodes a zero-based index into the
.debug_addr section. The index is relative to the DW_AT_addr_base
attribute of the associated compilation unit. In order to compute the
offset into the .debug_addr section and find the associated relocation,
we need to add the add the add base offset and multiply the index with
the address size.

This patch fixes a bug in this computation, where the multiplication was
omitted. This went unnoticed because for small test cases, the index for
interesting addresses (such as the main subprogram) is often zero.

rdar://110881668

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




More information about the All-commits mailing list