[all-commits] [llvm/llvm-project] 511210: [hwasan] Add hwasan-static-linking option (#154529)

Vadim Marchenko via All-commits all-commits at lists.llvm.org
Tue Aug 26 13:21:32 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 511210db434ee67c4ae3242858af36c7492af236
      https://github.com/llvm/llvm-project/commit/511210db434ee67c4ae3242858af36c7492af236
  Author: Vadim Marchenko <jakosvadim at gmail.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/HWAddressSanitizer/globals.ll

  Log Message:
  -----------
  [hwasan] Add hwasan-static-linking option (#154529)

Discarding the `.note.hwasan.globals` section in ldscript causes a
linker error, since `hwasan_globals` refers to the discarded section.
The issue comes from `hwasan.dummy.global` being associated via metadata
with `.note.hwasan.globals`.

Add a new `-hwasan-static-linking` option to skip inserting
`.note.hwasan.globals` for static binaries, as it is only needed for
instrumenting globals from dynamic libraries. In static binaries, the
global variables section can be accessed directly via the
`__start_hwasan_globals` and `__stop_hwasan_globals` symbols inserted by
the linker.



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