Skip to content

Commit

Permalink
[yaml2obj][ELF] Ensure STN_UNDEF entry is present.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184258 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chisophugis committed Jun 18, 2013
1 parent afcf60f commit ca0170f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion test/Object/yaml2obj-elf-symbol-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Sections:
- Name: .symtab
Type: SHT_SYMTAB
Symbols:
- Name: "" # TODO: Add STN_UNDEF automatically.
- Name: main

# CHECK: Symbols [
Expand Down
7 changes: 6 additions & 1 deletion tools/yaml2obj/yaml2elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ static void handleSymtabSectionHeader(
SHeader.sh_entsize = sizeof(Elf_Sym);

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) {
const ELFYAML::Symbol &Sym = Sec.Symbols[i];
Elf_Sym Symbol;
Expand Down

0 comments on commit ca0170f

Please sign in to comment.