Fangrui Song bd5b77529f
__asan_register_elf_globals: properly check the "no instrumented global variable" case
On ELF platforms, the instrumentation registers global variables using
`__asan_register_elf_globals` for the default `UseGlobalsGC` case. If
all instrumented global variables in a module are discarded by linker
GC, we will have `start == stop`.

Normally `start == 0`, but `start != 0` is possible with a linker script
retaining `asan_globals`. The called `__asan_register_globals` would
access out-of-bounds `globals[n-1]`, though there is likely no runtime
failure.

Pull Request: https://github.com/llvm/llvm-project/pull/96529
2024-06-25 13:14:39 -07:00
..
2023-09-28 15:40:42 +08:00