[PATCH] D76932: [AIX] emit .extern and .weak directive linkage

Digger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 14:53:12 PDT 2020


DiggerLin marked 3 inline comments as done.
DiggerLin added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1548
+
+  if (XCOFFSym->hasContainingCsect()) {
+    MCSymbolXCOFF *QualName =
----------------
jasonliu wrote:
> I hope we can find a better solution here. IMO, we don't even want to override this function in this patch. 
> GVSym should be the right one from what caller passed in. It's caller's responsibility to pass in the right GVSym. 
> When caller calls emitLinkage, we should emitLinkage. It's weird when emitLinkage is called, but none is emitted (when hasContainingCsect() returns false).
In the function 
``` bool AsmPrinter::doFinalization(Module &M) {
  // Emit remaining GOT equivalent globals.
  emitGlobalGOTEquivs();

  // Emit visibility info for declarations
  for (const Function &F : M) {
  ....
}
```

there is  function name .llvm.stackprotector in the M. the function is declared . it go to emitLinkage();

we need 
if (XCOFFSym->hasContainingCsect()) { 

}

to exclude emit linkage for function .llvm.stackprotector

I think over it , do you have any good suggestion to distinguish .llvm.stackprotector from other extern declared function.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76932/new/

https://reviews.llvm.org/D76932





More information about the cfe-commits mailing list