ELFYAML.h contains a Section class which is a base for a few other
sections classes that are used for mapping different section types.
In rL230124 Info field was moved there from RelocationSection class
because patch reused it for Group section type. Info has a string type.
At the same time, sh_info has very different meanings for sections.
For SHT_GROUP the meaning of sh_info is "The symbol table index of an entry
in the associated symbol table. The name of the specified symbol table entry provides
a signature for the section group."
And for SHT_REL[A] is "The section header index of the section to which the relocation
So it cannot be processed in a similar way generally,
for example ELFDumper does not handle it in dumpCommonSection
but do that in dumpGroup and dumpCommonRelocationSection respectively.
At this moment, we have and handle it as a string, because that was possible for
the current use case. But also it can simply be a number,
see for example SHT_SUNW_verdef/SHT_SUNW_verneed sections (SHT_GNU_verdef/SHT_GNU_verneed):
Given above, I think keeping is as StringRef in a common Section class is probably wrong.
I want to move it out to be able to have it as a number and to implement dumping/parsing the versioning
sections mentioned above. With that change, each class will be able to decide what type and purpose
of the sh_info field it wants to use.
I also had to edit 2 test cases. This is because patch fixes a bug. Previously we accepted
yaml files with Info fields for all sections (for example, for SHT_DYNSYM too).
But we do not handle it and the resulting objects had zero sh_info fields set for such sections.
Now it is accepted only for sections that support it.