[PATCH] D62349: Change ELF tools to allow multiple dynsym, versym, verdef and verneed sections per file.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 15:27:43 PDT 2019


pcc marked an inline comment as done.
pcc added a comment.

I think some of the GNU tools dump the first one, while others dump all of them. For example, nm dumps first, readelf dumps all. I agree with @grimar that regardless of what the GNU tools do, I think the end goal should be to dump all of them in all tools somehow. I filed https://bugs.llvm.org/show_bug.cgi?id=42013 to track this behaviour. But to start with, dumping the first one is better than erroring.

I'll see if yaml2obj will let me write tests for this. It looks like the current behaviour is untested, which might mean that things are harder than I'm expecting.



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1429-1430
     case ELF::SHT_LLVM_CALL_GRAPH_PROFILE:
       if (DotCGProfileSec != nullptr)
         reportError("Multiple .llvm.call-graph-profile");
       DotCGProfileSec = &Sec;
----------------
jhenderson wrote:
> MaskRay wrote:
> > jhenderson wrote:
> > > Ditto.
> > See D62350. Only dynamic sections are duplicated for partitions.
> > 
> > Static symbol table, etc, are still singleton.
> The principle is more general though. For most of these tools, there's no reason why there can't be multiple sections of these other types.
My initial inclination was to do only what was required for partitions, but after thinking about this for a bit, I think it's fine to do this for all sections. Although it means that we'll be ignoring some sections in some cases, that's simply a limitation of our tools and there's nothing wrong with the files themselves.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62349





More information about the llvm-commits mailing list