This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][hwasan] Do not call InitLoadedGlobals in __hwasan_init
ClosedPublic

Authored by leonardchan on Nov 8 2022, 3:06 PM.

Details

Summary

Fuchsia's libc provides a new hook (sanitizer_module_loaded) which calls hwasan_library_loaded in the startup path which will register globals in loaded modules.

Diff Detail

Event Timeline

leonardchan created this revision.Nov 8 2022, 3:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 3:06 PM
leonardchan requested review of this revision.Nov 8 2022, 3:06 PM
Herald added a subscriber: Restricted Project. · View Herald TranscriptNov 8 2022, 3:06 PM
mcgrathr accepted this revision.Nov 8 2022, 3:23 PM

lgtm

compiler-rt/lib/hwasan/hwasan.cpp
343

You could make this an if constexpr instead of #if to avoid the unused static function warning.

This revision is now accepted and ready to land.Nov 8 2022, 3:23 PM