forked from OSchip/llvm-project
[yaml2obj][ELF] Ensure STN_UNDEF entry is present.
llvm-svn: 184258
This commit is contained in:
parent
d60a41d941
commit
abe18db268
|
@ -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 [
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue