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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 09:45:06 PDT 2021


MaskRay requested changes to this revision.
MaskRay added inline comments.
This revision now requires changes to proceed.


================
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:
> 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 
My suggestion is to avoid the `SF_*` abstraction when implementing the dumper support. 

`exportSymbolInfoFromObjectFile` is XCOFF specific and ideally just uses the raw XCOFF interface, instead of using `SF_*` bits.

The `SF_*` bits are added prudently, not in one-shot places.


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