File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -715,6 +715,8 @@ void RISCVAsmPrinter::emitEndOfAsmFile(Module &M) {
715715 // export different static things.
716716 if (Entry.Fn .hasExternalLinkage () && !Entry.forceLocal )
717717 OutStreamer->emitSymbolAttribute (Sym, MCSA_Global);
718+ else if (Entry.Fn .isWeakForLinker () && !Entry.forceLocal )
719+ OutStreamer->emitSymbolAttribute (Sym, MCSA_Weak);
718720 OutStreamer->emitValueToAlignment (Align (4 ));
719721 OutStreamer->emitLabel (Sym);
720722 emitLabelDifference (Entry.FnSym , CompartmentStartSym, 2 );
@@ -741,6 +743,8 @@ void RISCVAsmPrinter::emitEndOfAsmFile(Module &M) {
741743 OutStreamer->emitSymbolAttribute (AliasExportSym, MCSA_ELF_TypeObject);
742744 if (GA->hasExternalLinkage () && !Entry.forceLocal )
743745 OutStreamer->emitSymbolAttribute (AliasExportSym, MCSA_Global);
746+ else if (GA->isWeakForLinker () && !Entry.forceLocal )
747+ OutStreamer->emitSymbolAttribute (AliasExportSym, MCSA_Weak);
744748 OutStreamer->emitAssignment (AliasExportSym,
745749 MCSymbolRefExpr::create (Sym, C));
746750 OutStreamer->emitELFSize (AliasExportSym, MCConstantExpr::create (4 , C));
You can’t perform that action at this time.
0 commit comments