forked from OSchip/llvm-project
Quick fix data/bss detection in TSan.
The old way breaks when a module's bss is adjacent to the [heap] vm area. Both ways are not very reliable, though. llvm-svn: 164772
This commit is contained in:
parent
9aabaa39d6
commit
f7f616ba66
|
@ -153,7 +153,10 @@ static void InitDataSeg() {
|
|||
while (proc_maps.Next(&start, &end, &offset, name, ARRAY_SIZE(name))) {
|
||||
DPrintf("%p-%p %p %s\n", start, end, offset, name);
|
||||
bool is_data = offset != 0 && name[0] != 0;
|
||||
bool is_bss = offset == 0 && name[0] == 0 && prev_is_data;
|
||||
// BSS may get merged with [heap] in /proc/self/maps. This is not very
|
||||
// reliable.
|
||||
bool is_bss = offset == 0 &&
|
||||
(name[0] == 0 || internal_strcmp(name, "[heap]") == 0) && prev_is_data;
|
||||
if (g_data_start == 0 && is_data)
|
||||
g_data_start = start;
|
||||
if (is_bss)
|
||||
|
|
Loading…
Reference in New Issue