sync ports with The Matrix
This commit is contained in:
parent
ec769495ab
commit
f5034afcba
3108 changed files with 91999 additions and 80269 deletions
69
devel/llvm/16/patches/patch-lld_ELF_InputFiles_cpp
Normal file
69
devel/llvm/16/patches/patch-lld_ELF_InputFiles_cpp
Normal file
|
@ -0,0 +1,69 @@
|
|||
Index: lld/ELF/InputFiles.cpp
|
||||
--- lld/ELF/InputFiles.cpp.orig
|
||||
+++ lld/ELF/InputFiles.cpp
|
||||
@@ -45,6 +45,8 @@ uint32_t InputFile::nextGroupId;
|
||||
|
||||
std::unique_ptr<TarWriter> elf::tar;
|
||||
|
||||
+DenseMap<StringRef, StringRef> elf::gnuWarnings;
|
||||
+
|
||||
// Returns "<internal>", "foo.a(bar.o)" or "baz.o".
|
||||
std::string lld::toString(const InputFile *f) {
|
||||
static std::mutex mu;
|
||||
@@ -63,6 +65,17 @@ std::string lld::toString(const InputFile *f) {
|
||||
return std::string(f->toStringCache);
|
||||
}
|
||||
|
||||
+// .gnu.warning.SYMBOL are treated as warning symbols for the given symbol
|
||||
+void lld::parseGNUWarning(StringRef name, ArrayRef<char> data, size_t size) {
|
||||
+ if (!name.empty() && name.startswith(".gnu.warning.")) {
|
||||
+ StringRef wsym = name.substr(13);
|
||||
+ StringRef s(data.begin());
|
||||
+ StringRef wng(s.substr(0, size));
|
||||
+ symtab.insert(wsym)->gwarn = true;
|
||||
+ gnuWarnings.insert({wsym, wng});
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static ELFKind getELFKind(MemoryBufferRef mb, StringRef archiveName) {
|
||||
unsigned char size;
|
||||
unsigned char endian;
|
||||
@@ -747,6 +760,14 @@ void ObjFile<ELFT>::initializeSections(bool ignoreComd
|
||||
case SHT_RELA:
|
||||
case SHT_NULL:
|
||||
break;
|
||||
+ case SHT_PROGBITS: {
|
||||
+ this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab)));
|
||||
+ StringRef name = check(obj.getSectionName(sec, shstrtab));
|
||||
+ ArrayRef<char> data =
|
||||
+ CHECK(obj.template getSectionContentsAsArray<char>(sec), this);
|
||||
+ parseGNUWarning(name, data, sec.sh_size);
|
||||
+ }
|
||||
+ break;
|
||||
case SHT_LLVM_SYMPART:
|
||||
ctx.hasSympart.store(true, std::memory_order_relaxed);
|
||||
[[fallthrough]];
|
||||
@@ -1349,6 +1370,9 @@ template <class ELFT> void SharedFile::parse() {
|
||||
const ELFFile<ELFT> obj = this->getObj<ELFT>();
|
||||
ArrayRef<Elf_Shdr> sections = getELFShdrs<ELFT>();
|
||||
|
||||
+ StringRef sectionStringTable =
|
||||
+ CHECK(obj.getSectionStringTable(sections), this);
|
||||
+
|
||||
const Elf_Shdr *versymSec = nullptr;
|
||||
const Elf_Shdr *verdefSec = nullptr;
|
||||
const Elf_Shdr *verneedSec = nullptr;
|
||||
@@ -1371,6 +1395,13 @@ template <class ELFT> void SharedFile::parse() {
|
||||
case SHT_GNU_verneed:
|
||||
verneedSec = &sec;
|
||||
break;
|
||||
+ case SHT_PROGBITS: {
|
||||
+ StringRef name = CHECK(obj.getSectionName(sec, sectionStringTable), this);
|
||||
+ ArrayRef<char> data =
|
||||
+ CHECK(obj.template getSectionContentsAsArray<char>(sec), this);
|
||||
+ parseGNUWarning(name, data, sec.sh_size);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue