+ // If corresponding function is weak definition, this should be too.
+ if ((EHFrameInfo.linkage == Function::WeakLinkage ||
+ EHFrameInfo.linkage == Function::LinkOnceLinkage) &&
+ TAI->getWeakDefDirective())
+ O << TAI->getWeakDefDirective() << EHFrameInfo.FnName << "\n";
+
+ // If there are no calls then you can't unwind. This may mean we can
+ // omit the EH Frame, but some environments do not handle weak absolute
+ // symbols.
+ if (!EHFrameInfo.hasCalls &&
+ ((EHFrameInfo.linkage != Function::WeakLinkage &&
+ EHFrameInfo.linkage != Function::LinkOnceLinkage) ||
+ !TAI->getWeakDefDirective() ||
+ TAI->getSupportsWeakOmittedEHFrame()))
+ {