[dev.link] cmd/link: set attributes atomically
Now concurrent relocsym may access symbols attributes concurrently, causing data race when using the race detector. I think it is still safe as we read/write on different bits, and not write the same symbol's attributes from multiple goroutines, so it will always reads the right value regardless whether the write happens before or after, as long as the memory model is not so insane. Use atomic accesses to appease the race detector. It doesn't seem to cost much, at least on x86. Change-Id: I2bfc3755ee59c87ed237d508f29d6172fa976392 Reviewed-on: https://go-review.googlesource.com/c/go/+/226368 Reviewed-by:Austin Clements <austin@google.com>
Loading
Please sign in to comment