sync with OpenBSD -current

This commit is contained in:
purplerain 2023-12-05 13:40:24 +00:00
parent 005bcb25db
commit bd69b5651c
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
15 changed files with 217 additions and 133 deletions

View file

@ -67,7 +67,9 @@ std::string lld::toString(const InputFile *f) {
// .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));

View file

@ -792,6 +792,7 @@ void elf::reportUndefinedSymbols() {
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