[PATCH] D77368: [ELF] Allow invalid sh_size%sh_entsize!=0 for non-SHF_MERGE sections

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 3 02:39:36 PDT 2020


grimar accepted this revision.
grimar added a comment.

In D77368#1959036 <https://reviews.llvm.org/D77368#1959036>, @psmith wrote:

> A minor stylistic comment that me might want to put the check for SHF_MERGE as the first item as I don't think we'd create a merge section for anything else.


Yeah, sounds like a bit more natural behavior for a function called  `shouldMerge`.



================
Comment at: lld/ELF/InputFiles.cpp:449
 
+  uint64_t flags = sec.sh_flags;
+  if (!(flags & SHF_MERGE))
----------------
nit: Perhaps no need to have `flags` variable? `sec.sh_flags` should look good when inlined.


================
Comment at: lld/test/ELF/invalid/entsize.yaml:1
+## Ignore invalid sh_entsize (sh_size%sh_entsize!=0) for non-SHF_MERGE sections.
+# RUN: yaml2obj %s -o %t.o
----------------
Perhaps add a bit of information abut why we even care about this case, e.g. link to a GNU as bug?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77368





More information about the llvm-commits mailing list