[yaml2obj][ELF] Ensure STN_UNDEF entry is present.

llvm-svn: 184258
This commit is contained in:
Sean Silva 2013-06-18 23:19:17 +00:00
parent d60a41d941
commit abe18db268
2 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,6 @@ Sections:
- Name: .symtab - Name: .symtab
Type: SHT_SYMTAB Type: SHT_SYMTAB
Symbols: Symbols:
- Name: "" # TODO: Add STN_UNDEF automatically.
- Name: main - Name: main
# CHECK: Symbols [ # CHECK: Symbols [

View File

@ -154,7 +154,12 @@ static void handleSymtabSectionHeader(
SHeader.sh_entsize = sizeof(Elf_Sym); SHeader.sh_entsize = sizeof(Elf_Sym);
std::vector<Elf_Sym> Syms; std::vector<Elf_Sym> Syms;
// FIXME: Ensure STN_UNDEF entry is present. {
// Ensure STN_UNDEF is present
Elf_Sym Sym;
zero(Sym);
Syms.push_back(Sym);
}
for (unsigned i = 0, e = Sec.Symbols.size(); i != e; ++i) { for (unsigned i = 0, e = Sec.Symbols.size(); i != e; ++i) {
const ELFYAML::Symbol &Sym = Sec.Symbols[i]; const ELFYAML::Symbol &Sym = Sec.Symbols[i];
Elf_Sym Symbol; Elf_Sym Symbol;