diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-21 08:13:04 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-21 08:13:04 +0000 |
commit | 77c27f439443c2a7f56fc707fc9ceb0d10f085ae (patch) | |
tree | 8ffb7f15f963237d494e084b71d9e009ba9f48d3 | |
parent | 04f74a149d16ff92722c3c333ab36b130fd8cae7 (diff) | |
download | external_llvm-77c27f439443c2a7f56fc707fc9ceb0d10f085ae.zip external_llvm-77c27f439443c2a7f56fc707fc9ceb0d10f085ae.tar.gz external_llvm-77c27f439443c2a7f56fc707fc9ceb0d10f085ae.tar.bz2 |
Revert "[Object] .bss sections have no content. PR15005."
This reverts commit r173007.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173012 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Object/ELF.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index 5409fc3..136fdf5 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -1260,18 +1260,16 @@ template<class ELFT> error_code ELFObjectFile<ELFT>::getSectionContents(DataRefImpl Sec, StringRef &Result) const { const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p); - return getSectionContents(sec, Result); + const char *start = (const char*)base() + sec->sh_offset; + Result = StringRef(start, sec->sh_size); + return object_error::success; } template<class ELFT> error_code ELFObjectFile<ELFT>::getSectionContents(const Elf_Shdr *Sec, StringRef &Result) const { - if (Sec->sh_type == ELF::SHT_NOBITS) - Result = StringRef(); - else { - const char *start = (const char*)base() + Sec->sh_offset; - Result = StringRef(start, Sec->sh_size); - } + const char *start = (const char*)base() + Sec->sh_offset; + Result = StringRef(start, Sec->sh_size); return object_error::success; } |