[PATCH] D65240: [XCOFF][AIX] Generate symbol table entries with llvm-readobj

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 09:52:38 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:310
+    StatAuxEntPtr =
+        reinterpret_cast<const XCOFFSectAuxEntForStat *>(SymbolEntPtr + 1);
+    printSectAuxEntForStat(StatAuxEntPtr);
----------------
jasonliu wrote:
> hubert.reinterpretcast wrote:
> > jasonliu wrote:
> > > hubert.reinterpretcast wrote:
> > > > This is unsafe. There is no statement I could find indicating that such an auxiliary entry is required, and `xlc` will generate such symbol table entries with no auxiliary entry.
> > > > 
> > > > ```
> > > > [16]    m   0x00000094     .data     1  unamex                    _$STATIC
> > > > [17]    a4  0x00000004       0    0     SD       RW    0    0
> > > > [18]    m   0x00000094     .data     0  static                    x
> > > > ```
> > > We have 
> > > 
> > > ```
> > > if (NumberOfAuxEntries == 0)
> > >     return;
> > > ```
> > > 
> > > before this switch statement. If there is no aux entry, we would exit already before getting here. 
> > Ah, yes. As a further consideration, I think we should do something about having more than one auxiliary entry here.
> Could C_STAT symbol have more than 1 aux entry? I added an assertion for that.
Can we make that a `report_fatal_error`? It is an error in the user-provided input, so we should report the error.


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

https://reviews.llvm.org/D65240





More information about the llvm-commits mailing list