]> git.ipfire.org Git - thirdparty/gcc.git/commit
asan: adjust module name for global variables
authorMartin Liska <mliska@suse.cz>
Fri, 17 Feb 2023 14:11:02 +0000 (15:11 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 27 Feb 2023 08:30:32 +0000 (09:30 +0100)
commitb8e496d132ec087c9db5951fea23551dcc831d8c
tree5c767fec2871fa749ce042f6c62a2caf683f175b
parentcea4b90f8305df681d322315a9c30e3924e1e79d
asan: adjust module name for global variables

As mentioned in the PR, when we use LTO, we wrongly use ltrans output
file name as a module name of a global variable. That leads to a
non-reproducible output.

After the suggested change, we emit context name of normal global
variables. And for artificial variables (like .Lubsan_data3), we use
aux_base_name (e.g. "./a.ltrans0.ltrans").

PR sanitizer/108834

gcc/ChangeLog:

* asan.cc (asan_add_global): Use proper TU name for normal
global variables (and aux_base_name for the artificial one).

gcc/testsuite/ChangeLog:

* c-c++-common/asan/global-overflow-1.c: Test line and column
info for a global variable.

(cherry picked from commit 94c9b1bb79f63d000ebb05efc155c149325e332d)
gcc/asan.cc
gcc/testsuite/c-c++-common/asan/global-overflow-1.c