[PATCH] D102296: [ELF] getRelocatedSection: allow allocatable section in non-relocatable file

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 23:21:03 PDT 2021


Amir updated this revision to Diff 345609.
Amir added a comment.

Remove added checks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102296/new/

https://reviews.llvm.org/D102296

Files:
  llvm/include/llvm/Object/ELFObjectFile.h


Index: llvm/include/llvm/Object/ELFObjectFile.h
===================================================================
--- llvm/include/llvm/Object/ELFObjectFile.h
+++ llvm/include/llvm/Object/ELFObjectFile.h
@@ -968,9 +968,6 @@
 template <class ELFT>
 Expected<section_iterator>
 ELFObjectFile<ELFT>::getRelocatedSection(DataRefImpl Sec) const {
-  if (EF.getHeader().e_type != ELF::ET_REL)
-    return section_end();
-
   const Elf_Shdr *EShdr = getSection(Sec);
   uintX_t Type = EShdr->sh_type;
   if (Type != ELF::SHT_REL && Type != ELF::SHT_RELA)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102296.345609.patch
Type: text/x-patch
Size: 550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210515/b5281999/attachment.bin>


More information about the llvm-commits mailing list