From fe793806e9eb4b1106977de940a7cfc4750cfaf4 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Fri, 7 Oct 2011 20:58:24 +0000 Subject: [PATCH] Don't emit a shstrtabindex in the reserved range. Spotted by inspection and patch by Cary Coutant! llvm-svn: 141413 --- lib/MC/ELFObjectWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 549a5099376..9bb64625654 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -130,7 +130,7 @@ void ELFObjectWriter::WriteHeader(uint64_t SectionDataSize, Write16(NumberOfSections); // e_shstrndx = Section # of '.shstrtab' - if (NumberOfSections >= ELF::SHN_LORESERVE) + if (ShstrtabIndex >= ELF::SHN_LORESERVE) Write16(ELF::SHN_XINDEX); else Write16(ShstrtabIndex);