diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-02-20 14:39:23 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-02-20 14:39:23 +0000 |
| commit | c4bd2b43b293827b7ec880a10a6e491f0cc94211 (patch) | |
| tree | acde8cf5ca883ea6e4fa6c9026bb8c6e3c14377b /lld/ELF | |
| parent | 3f25e997d96a3150a192777c3c389c258c5cf7ee (diff) | |
Vendor import of llvm-project branch release/13.x llvmorg-13.0.1-0-g75e33f71c2da.vendor/llvm-project/llvmorg-13.0.1-0-g75e33f71c2davendor/llvm-project/release-13.x
Diffstat (limited to 'lld/ELF')
| -rw-r--r-- | lld/ELF/Arch/PPC.cpp | 3 | ||||
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Relocations.cpp | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lld/ELF/Arch/PPC.cpp b/lld/ELF/Arch/PPC.cpp index aaecef6ee94f..d9334d5bf853 100644 --- a/lld/ELF/Arch/PPC.cpp +++ b/lld/ELF/Arch/PPC.cpp @@ -20,6 +20,9 @@ using namespace llvm::ELF; using namespace lld; using namespace lld::elf; +// Undefine the macro predefined by GCC powerpc32. +#undef PPC + namespace { class PPC final : public TargetInfo { public: diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index d5b9efbe18fc..ab65571887d1 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -1567,7 +1567,7 @@ template <class ELFT> void SharedFile::parse() { Symbol *s = symtab->addSymbol( Undefined{this, name, sym.getBinding(), sym.st_other, sym.getType()}); s->exportDynamic = true; - if (s->isUndefined() && !s->isWeak() && + if (s->isUndefined() && sym.getBinding() != STB_WEAK && config->unresolvedSymbolsInShlib != UnresolvedPolicy::Ignore) requiredSymbols.push_back(s); continue; diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 537859f9e0b5..71249188afe3 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -927,6 +927,12 @@ static void reportUndefinedSymbol(const UndefinedDiag &undef, msg += "\n>>> the vtable symbol may be undefined because the class is missing " "its key function (see https://lld.llvm.org/missingkeyfunction)"; + if (config->gcSections && config->zStartStopGC && + sym.getName().startswith("__start_")) { + msg += "\n>>> the encapsulation symbol needs to be retained under " + "--gc-sections properly; consider -z nostart-stop-gc " + "(see https://lld.llvm.org/ELF/start-stop-gc)"; + } if (undef.isWarning) warn(msg); @@ -1403,8 +1409,8 @@ static void scanReloc(InputSectionBase &sec, OffsetGetter &getOffset, RelTy *&i, // The 4 types that relative GOTPLT are all x86 and x86-64 specific. if (oneof<R_GOTPLTONLY_PC, R_GOTPLTREL, R_GOTPLT, R_TLSGD_GOTPLT>(expr)) { in.gotPlt->hasGotPltOffRel = true; - } else if (oneof<R_GOTONLY_PC, R_GOTREL, R_PPC64_TOCBASE, R_PPC64_RELAX_TOC>( - expr)) { + } else if (oneof<R_GOTONLY_PC, R_GOTREL, R_PPC32_PLTREL, R_PPC64_TOCBASE, + R_PPC64_RELAX_TOC>( expr)) { in.got->hasGotOffRel = true; } |
