SuccessChanges

Summary

  1. [yaml2obj] - Do not assert when .dynsym is specified explicitly, but .dynstr is not present. We have a code in buildSectionIndex() that adds implicit sections: // Add special sections after input sections, if necessary. for (StringRef Name : implicitSectionNames()) if (SN2I.addName(Name, SecNo)) { // Account for this section, since it wasn't in the Doc ++SecNo; DotShStrtab.add(Name); } The problem arises when .dynsym is specified explicitly and no DynamicSymbols is used. In that case, we do not add .dynstr implicitly and will assert later when will try to set Link for .dynsym. Seems, in this case, reasonable behavior is to allow Link field to be zero. This is what this patch does. Differential revision: https://reviews.llvm.org/D63001
Revision 362929 by grimar:
[yaml2obj] - Do not assert when .dynsym is specified explicitly, but .dynstr is not present.

We have a code in buildSectionIndex() that adds implicit sections:

// Add special sections after input sections, if necessary.
for (StringRef Name : implicitSectionNames())
  if (SN2I.addName(Name, SecNo)) {
    // Account for this section, since it wasn't in the Doc
    ++SecNo;
    DotShStrtab.add(Name);
  }

The problem arises when .dynsym is specified explicitly and no
DynamicSymbols is used. In that case, we do not add
.dynstr implicitly and will assert later when will try to set Link
for .dynsym.

Seems, in this case, reasonable behavior is to allow Link field to be zero.
This is what this patch does.

Differential revision: https://reviews.llvm.org/D63001
Change TypePath in RepositoryPath in Workspace
The file was added/llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yamltrunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml
The file was modified/llvm/trunk/tools/yaml2obj/yaml2elf.cpptrunk/tools/yaml2obj/yaml2elf.cpp