[PATCH] D112735: export unique symbol list for xcoff with llvm-objdump new option "--export-unique-symbol"

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 06:28:51 PDT 2021


DiggerLin added inline comments.


================
Comment at: llvm/include/llvm/Object/SymbolicFile.h:122
                                  // (IR only)
+    SF_Protected = 1U << 12,     // Symbol has protected visibility
+    SF_Internal = 1U << 13       // Symbol has internal visibility
----------------
DiggerLin wrote:
> MaskRay wrote:
> > DiggerLin wrote:
> > > MaskRay wrote:
> > > > I don't think we need new bits.
> > > > 
> > > > If internal visibility has similar behavior with hidden visibility, just reuse it or not set symbol properties at all.
> > > > 
> > > > I am mostly concerned with the fact that BFD style describing all binary format's every symbol property simply does not work.
> > > we need the "protected" visibility in xcoff object file.
> > > 
> > > The AIX linker  accepts 4 of such visibility attribute types:
> > > 
> > > export: Symbol is exported with the global export attribute.
> > > hidden: Symbol is not exported.
> > > protected: Symbol is exported but cannot be rebound (preempted), even if runtime linking is being used.
> > > internal: Symbol is not exported. The address of the symbol must not be provided to other programs or shared objects, but the linker does not verify this.
> > > 
> > >  please  reference 
> > > 1. [[ https://www.ibm.com/docs/en/aix/7.1?topic=formats-xcoff-object-file-format | xcoff-object-file-format ]] . (search "Symbol visibility" in file". )
> > > 
> > > 2. https://developer.ibm.com/articles/au-aix-symbol-visibility/ , search 'STV_PROTECTED"
> > > 
> > Thanks for the pointers. But see my comment below: the request is about removing the unneeded `SF_*` abstraction.
> sorry that , I can not get "the request is about removing the unneeded SF_* abstraction"
> 
> your suggestion is to change  from "SF_Protected"  to "Protected"  ?  if so, my suggestion is that we keep "SF_Protected" as in this patch. and create a NFC to remove "SF_" 
> 
@MaskRay 


================
Comment at: llvm/tools/llvm-objdump/XCOFFDump.cpp:230
+
+    if (Flags & SymbolRef::SF_Protected) {
+      ExportSymbols.push_back(SymNameVisibilityTy(SymName, "protected"));
----------------
DiggerLin wrote:
> MaskRay wrote:
> > Just switch with the underlying binary format, instead of using a `SymbolRef` abstraction, then `SF_Protected` will not be needed.
> sorry again, I can not got the comment, can you explain it more detail ?
@MaskRay 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112735



More information about the llvm-commits mailing list