[PATCH] D152157: [AppleAccelTable] Keep track of the size of each hash data entry

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 06:45:16 PDT 2023


fdeazeve created this revision.
Herald added subscribers: ormris, cmtice, steven_wu, hiraditya.
Herald added a reviewer: JDevlieghere.
Herald added a reviewer: jhenderson.
Herald added a project: All.
fdeazeve requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

In a future patch, it will be desirable to skip over all hash data entries for a
particular string. In order to do so, we must know how many bytes each of those
entries have.

In its full specification, Apple tables allow for variable length entries, which
would make the above impossible without reading the data of each entry. However,
this is largely unsupported today (as a FIXME in the code indicates, there is a
bug with hash collisions exactly because we don't know how to skip over data),
and the documentation[1] states that:

> For the current implementations of the “.apple_names” (all functions +
> globals), the “.apple_types” (names of all types that are defined), and the
> “.apple_namespaces” (all namespaces), we currently set the Atom array to be:
> [...]
> This defines the contents to be the DIE offset (eAtomTypeDIEOffset) that is
> encoded as a 32 bit value (DW_FORM_data4).

In other words, we only produce fixed sized entries.

A few tests containing invalid dwarf had to be updated, as the error is now
detected earlier (when the accelerator table is being parsed, instead of inside
the explicit call to "verify").

[1]: https://llvm.org/docs/SourceLevelDebugging.html#fixed-lookup

Depends on D152156 <https://reviews.llvm.org/D152156>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152157

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
  llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  llvm/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
  llvm/test/tools/dsymutil/X86/basic-lto-linking-x86.test
  llvm/test/tools/dsymutil/X86/objc.test
  llvm/test/tools/llvm-dwarfdump/X86/apple_names_verify_form.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152157.528413.patch
Type: text/x-patch
Size: 6262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230605/ad198416/attachment.bin>


More information about the llvm-commits mailing list