[compiler-rt] [HWASan] Fix symbol indexing (PR #135967)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 14:18:45 PDT 2025


================
@@ -76,19 +82,29 @@ def handle_elf(mv):
   # have to extend the parsing code.
   if mv[:6] != b'\x7fELF\x02\x01':
     return None
+  found_symbols = False
+  bid = None
   e_shnum, = struct.unpack_from('<H', buffer=mv, offset=e_shnum_offset)
   e_shoff, = struct.unpack_from('<Q', buffer=mv, offset=e_shoff_offset)
   for i in range(0, e_shnum):
     start = e_shoff + i * Shdr_size
-    sh_offset, sh_size = handle_Shdr(mv[start: start + Shdr_size])
-    if sh_offset is None:
-      continue
-    note_hdr = mv[sh_offset: sh_offset + sh_size]
-    result = handle_Nhdr(note_hdr, sh_size)
-    if result is not None:
-      return result
+    sh = mv[start: start + Shdr_size]
+    sh_type = unpack_sh_type(sh)
+
+    if sh_type == SHT_SYMTAB:
----------------
fmayer wrote:

is this correct? we don't necessarily need this, we can take DWARF from .debug_info

https://github.com/llvm/llvm-project/pull/135967


More information about the llvm-commits mailing list