[PATCH] Add DefinedAtom::sectionSize().

kledzik at apple.com kledzik at apple.com
Tue Jun 24 18:19:44 PDT 2014


Yes, adding a virtual method is "free" in that it does not increase the size of each object, but this patch alone does not solve the round-trip (yaml/native) that Shankar brought up.  My suggestion to add an atom representing the section and a reference from the mergeByLargestSection atom to the section atom, does work with round tripping.  

The extra section atom and reference are not just arbitrary.  They actually correspond to this merge mode. The atom is saying "pick me if my section is biggest".  The reference answers the question "what is your section?" and the section atom answers the question "what is your section's size".


But there may also be another approach to this.  Rather than have the SymbolTable understand all the merge modes, maybe we can have it call out to the LinkingContext to pick between custom modes? Or have it support mergeByLargestSection by calling out to the LinkingContext for the section size of a particular atom?

http://reviews.llvm.org/D4042






More information about the llvm-commits mailing list