ports/devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp

16 lines
535 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
- Don't create IBT .plt if there are no PLT entries. Cherry picked from
upstream.
Index: tools/lld/ELF/SyntheticSections.cpp
--- tools/lld/ELF/SyntheticSections.cpp.orig
+++ tools/lld/ELF/SyntheticSections.cpp
@@ -2729,6 +2729,8 @@ size_t IBTPltSection::getSize() const {
return 16 + in.plt->getNumEntries() * target->pltEntrySize;
}
+bool IBTPltSection::isNeeded() const { return in.plt->getNumEntries() > 0; }
+
// The string hash function for .gdb_index.
static uint32_t computeGdbHash(StringRef s) {
uint32_t h = 0;