[PATCH] D39582: Add ELF dynamic symbol support to yaml2obj/obj2yaml

Dave Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 11:21:30 PDT 2017


kastiglione added a subscriber: silvas.
kastiglione added inline comments.


================
Comment at: tools/yaml2obj/yaml2elf.cpp:162-163
   unsigned getDotShStrTabSecNo() const { return Doc.Sections.size() + 3; }
-  unsigned getSectionCount() const { return Doc.Sections.size() + 4; }
+  unsigned getDotDynSymSecNo() const { return Doc.Sections.size() + 4; }
+  unsigned getDotDynStrSecNo() const { return Doc.Sections.size() + 5; }
+  unsigned getSectionCount() const {
----------------
kastiglione wrote:
> jakehehrlich wrote:
> > .dyn* sections are going to be allocated and so we need to be able place them next to certain other allocated sections so that we can't put them in program headers. It won't be sufficient to decide for the user, at least not this way. One way might be to require that the user add a .dynsym section if they want to use DynamicSymbols and then using the index of that section if they do. This will require that you compute the size of the .dynsym and .dynstr sections early enough for the standard layout algorithm to work.
> What about making the `.dynsym` section optional? If it's there, that's the order that's used, and if it no `.dynsym` section is specified, then this default ordering is used? The same could be applied to these other sections (`.symtab` etc) if desired.
@silvas Hi Sean, do you have an opinion on how you would like to see section ordering handled, particularly as it relates to dynamic symbols?


https://reviews.llvm.org/D39582





More information about the llvm-commits mailing list