[llvm] r184624 - [yaml2obj][ELF] Don't special case writing these.

Sean Silva silvas at purdue.edu
Fri Jun 21 18:06:12 PDT 2013


Author: silvas
Date: Fri Jun 21 20:06:12 2013
New Revision: 184624

URL: http://llvm.org/viewvc/llvm-project?rev=184624&view=rev
Log:
[yaml2obj][ELF] Don't special case writing these.

Just add them to the vector of section headers like the rest of the
section headers.

Modified:
    llvm/trunk/tools/yaml2obj/yaml2elf.cpp

Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=184624&r1=184623&r2=184624&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Fri Jun 21 20:06:12 2013
@@ -347,16 +347,16 @@ static int writeELF(raw_ostream &OS, con
   zero(DotStrTabSHeader);
   DotStrTabSHeader.sh_name = SHStrTab.addString(StringRef(".strtab"));
   createStringTableSectionHeader(DotStrTabSHeader, State.getStringTable(), CBA);
+  SHeaders.push_back(DotStrTabSHeader);
 
   // Section header string table header.
   Elf_Shdr SHStrTabSHeader;
   zero(SHStrTabSHeader);
   createStringTableSectionHeader(SHStrTabSHeader, SHStrTab, CBA);
+  SHeaders.push_back(SHStrTabSHeader);
 
   OS.write((const char *)&Header, sizeof(Header));
   writeVectorData(OS, SHeaders);
-  OS.write((const char *)&DotStrTabSHeader, sizeof(DotStrTabSHeader));
-  OS.write((const char *)&SHStrTabSHeader, sizeof(SHStrTabSHeader));
   CBA.writeBlobToStream(OS);
   return 0;
 }





More information about the llvm-commits mailing list