[all-commits] [llvm/llvm-project] 0cf543: [BOLT] Emit DW_AT_high_pc matching the class of it...

YongKang Zhu via All-commits all-commits at lists.llvm.org
Tue Sep 29 15:25:56 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0cf54305fecea578cacebcfc94cb4166a62f3d79
      https://github.com/llvm/llvm-project/commit/0cf54305fecea578cacebcfc94cb4166a62f3d79
  Author: YongKang Zhu <yongzhu at fb.com>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M bolt/lib/Rewrite/DWARFRewriter.cpp
    A bolt/test/AArch64/dwarf2-highpc-addr-form.s
    M bolt/test/AArch64/go_dwarf.test

  Log Message:
  -----------
  [BOLT] Emit DW_AT_high_pc matching the class of its form (#227066)

DW_AT_high_pc holding an offset from DW_AT_low_pc is a DWARF 4 addition;
in DWARF 2 and 3 the attribute is always class address.

updateLowPCHighPC() always wrote "HighPC - LowPC" while reusing whatever
form the input DIE had, so a DWARF 2 CU using DW_FORM_addr ended up
storing a length where an end address is expected.

BOLT should write the end address when the form is DW_FORM_addr, and
the length otherwise. The default form for a new attribute is now
DW_FORM_addr below DWARF 4, and size needs to be widened to 64 bits so
DW_FORM_data8 won't be truncated. The FunctionRanges.empty() code path
no longer treats a raw DW_FORM_addr high_pc as a size.

Assited-by: opus



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list