discussed with, tested by and ok tb@
// .gnu.warning.SYMBOL are treated as warning symbols for the given symbol
void lld::parseGNUWarning(StringRef name, ArrayRef<char> data, size_t size) {
+ static std::mutex mu;
if (!name.empty() && name.startswith(".gnu.warning.")) {
+ std::lock_guard<std::mutex> lock(mu);
StringRef wsym = name.substr(13);
StringRef s(data.begin());
StringRef wng(s.substr(0, size));
static void reportGNUWarning(Symbol &sym, InputSectionBase &sec,
uint64_t offset) {
+ std::lock_guard<std::mutex> lock(relocMutex);
if (sym.gwarn) {
StringRef gnuWarning = gnuWarnings.lookup(sym.getName());
// report first occurance only