Main executable did not export symbols that exist both in the main executable and in DSOs before this patch.
Symbols from object files that override symbols in DSO should be added to .dynsym table.
This fixes https://llvm.org/bugs/show_bug.cgi?id=26222
Let's do this here for consistency.
// We want to export all symbols that exist both in the executable and in DSOs // so that the symbols in the executable can interrupt symbols in the DSO at runtime. if (isShared() != Other->isShared()) if (!isa<DefinedRegular<ELFT>>(isShared() ? this : Other)) IsUsedInDynamicReloc = Other->IsUsedInDynamicReloc = true;By the way, is this correct to have this inside if (IsUsedInRegularObj || Other->IsUsedInRegularObj) {}?