[all-commits] [llvm/llvm-project] 8c6d48: [llvm-readobj] Construct relocation-aware DWARFDat...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Jul 21 08:33:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c6d48baf67bcd4e351ab32ef2fc801523db05db
      https://github.com/llvm/llvm-project/commit/8c6d48baf67bcd4e351ab32ef2fc801523db05db
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/AArch64/dwarf-cfi.s
    M llvm/test/tools/llvm-readobj/ELF/ARM/dwarf-cfi.s
    M llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h

  Log Message:
  -----------
  [llvm-readobj] Construct relocation-aware DWARFDataExtractor to decode .eh_frame addresses correctly

In an object file, a "PC Begin" field in a FDE is usually relocated by a
PC-relative relocation. Use a relocation-aware DWARFDataExtractor overload (with
DWARFContext and a reference to its internal .eh_frame representation) to decode
addresses correctly. In an object file, most sections have addresses of zero. So
the displayed addresses are almost always offsets relative to the start of the
associated text section.

DWARFContext::create handles .eh_frame and .rela.eh_frame by itself, so if there
are more than one .eh_frame (technically possible, but almost always erronerous
in practice), this will only handle the first one.  Supporting multiple
.eh_frame is beyond the scope of this patch.

Reviewed By: grimar, jhenderson

Differential Revision: https://reviews.llvm.org/D84106




More information about the All-commits mailing list