[PATCH] D109452: using symbol index and qualname for --sym --symbol--description for llvm-objdump for xcoff

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 13:36:23 PDT 2021


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:2070
 
   if (Common || O->isELF()) {
     uint64_t Val =
----------------
DiggerLin wrote:
> hubert.reinterpretcast wrote:
> > DiggerLin wrote:
> > > jhenderson wrote:
> > > > hubert.reinterpretcast wrote:
> > > > > @DiggerLin, at least some XCOFF symbols have size fields. This could be handled in a separate patch if that is your preference (in which case, please add a TODO comment to the code).
> > > > > 
> > > > > @jhenderson, at least for XCOFF, I would prefer to always have the field (even if empty). I am not convinced that having it present only for "common" symbols for non-ELF formats is good.
> > > > At least for ELF format, we are tied by the need to match GNU objdump output as closely as practical. I've no issue it being different for other formats that don't have a GNU objdump implementation they are trying to mirror.
> > > @hubert.reinterpretcast , the size we  mention here is section size?
> > > in the https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format
> > > 
> > > XTY_SD  x_scnlen contains the csect length. 
> > > XTY_CM x_scnlen contains the csect length.
> > > 
> > > so we want to display the size of the symbols of the XTY_SD symbols and XTY_CM symbols  or only XTY_CM symbols? 
> > For ELF, the common symbols are displayed with the alignment and the other symbols are displayed with the size. We could do the same as ELF (except sometimes we don't have a size or alignment).
> for the "char c" in global variable, in the common, the x_scnlen of csect auxiliary  symbol entry is 1, but the alignment will be 4, so we will show 4 bytes?
Just because the alignment given by the various compilers is surprising doesn't mean that we should avoid indicating the alignment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109452



More information about the llvm-commits mailing list