summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index cdb787d3fea..b0c4f65a038 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -1621,7 +1621,16 @@ template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) {
Symbol *Sym = Ent.Sym;
if (Sym->isInPlt() && Sym->NeedsPltAddr)
ESym->st_other |= STO_MIPS_PLT;
-
+ if (isMicroMips()) {
+ // Set STO_MIPS_MICROMIPS flag and less-significant bit for
+ // defined microMIPS symbols and shared symbols with PLT record.
+ if ((Sym->isDefined() && (Sym->StOther & STO_MIPS_MICROMIPS)) ||
+ (Sym->isShared() && Sym->NeedsPltAddr)) {
+ if (StrTabSec.isDynamic())
+ ESym->st_value |= 1;
+ ESym->st_other |= STO_MIPS_MICROMIPS;
+ }
+ }
if (Config->Relocatable)
if (auto *D = dyn_cast<Defined>(Sym))
if (isMipsPIC<ELFT>(D))
OpenPOWER on IntegriCloud