[llvm] r184258 - [yaml2obj][ELF] Ensure STN_UNDEF entry is present.
Sean Silva
silvas at purdue.edu
Tue Jun 18 16:19:17 PDT 2013
Author: silvas
Date: Tue Jun 18 18:19:17 2013
New Revision: 184258
URL: http://llvm.org/viewvc/llvm-project?rev=184258&view=rev
Log:
[yaml2obj][ELF] Ensure STN_UNDEF entry is present.
Modified:
llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml?rev=184258&r1=184257&r2=184258&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml Tue Jun 18 18:19:17 2013
@@ -12,7 +12,6 @@ Sections:
- Name: .symtab
Type: SHT_SYMTAB
Symbols:
- - Name: "" # TODO: Add STN_UNDEF automatically.
- Name: main
# CHECK: Symbols [
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=184258&r1=184257&r2=184258&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Tue Jun 18 18:19:17 2013
@@ -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;
More information about the llvm-commits
mailing list