sync ports with The Matrix

This commit is contained in:
purplerain 2023-09-08 05:21:37 +00:00
parent ec769495ab
commit f5034afcba
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
3108 changed files with 91999 additions and 80269 deletions

View file

@ -0,0 +1,31 @@
Index: lld/ELF/Relocations.cpp
--- lld/ELF/Relocations.cpp.orig
+++ lld/ELF/Relocations.cpp
@@ -790,6 +790,18 @@ void elf::reportUndefinedSymbols() {
undefs.clear();
}
+static void reportGNUWarning(Symbol &sym, InputSectionBase &sec,
+ uint64_t offset) {
+ if (sym.gwarn) {
+ StringRef gnuWarning = gnuWarnings.lookup(sym.getName());
+ // report first occurance only
+ sym.gwarn = false;
+ if (!gnuWarning.empty())
+ message(sec.getSrcMsg(sym, offset) + "(" + sec.getObjMsg(offset) +
+ "): warning: " + gnuWarning);
+ }
+}
+
// Report an undefined symbol if necessary.
// Returns true if the undefined symbol will produce an error message.
static bool maybeReportUndefined(Undefined &sym, InputSectionBase &sec,
@@ -1351,6 +1363,8 @@ template <class ELFT, class RelTy> void RelocationScan
uint64_t offset = getter.get(rel.r_offset);
if (offset == uint64_t(-1))
return;
+
+ reportGNUWarning(sym, *sec, rel.r_offset);
RelExpr expr = target->getRelExpr(type, sym, sec->content().data() + offset);
int64_t addend = RelTy::IsRela