https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> As discussed on IRC, with current libasan __asan_register_globals, we have 2
> options:
> 1) add an object that we link early with -fsanitize=address that contains
> zero sized variables with following redzone registered with
> __asan_register_globals in .rodata, .data and .bss sections (similarly to
> how libasan_preinit.o is added to non- -shared links, this would be
> something added to every link)
> 2) in each TU emit such zero sized variable with following redzone and
> register it before the first variable in .data, .rodata and/or .bss if any
> vars are emitted there
> 
> 1) has the advantage that it wastes less memory in red zones (especially
> with many TUs), but will work well only if not mixing TUs with
> -fsanitize=address and without
> 2) wastes more memory and is more costly also because registering more
> globals, but will work better when mixing TUs with -fsanitize=address and
> without

Jakub on IRC:
if we go with the single *.o file with registered dummies at start of each
section, it would need to include .sdata and .sbss vars too on powerpc

Reply via email to