[PATCH] D11266: LLD: ELF: Correctly identify SHT_NOTE sections with !SHF_ALLOC as type*Note

Rui Ueyama ruiu at google.com
Wed Aug 5 19:33:15 PDT 2015


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/ReaderWriter/ELF/Atoms.cpp:77
@@ -75,1 +76,3 @@
+    if (_section->sh_type == SHT_NOTE)
+      return (flags == SHF_WRITE) ? typeRWNote : typeRONote;
     return _contentType = typeNoAlloc;
----------------
tstellarAMD wrote:
> ruiu wrote:
> > Don't you have to assign it to _contentType?
> I don't think this is necessary.  This function is called from only one place: ELFDefinedAtom<ELFT>::contentType()
> and the return value is assigned to _contentType here.
Then maybe we should remove other assignments to _contentType from this function? (I'm not suggesting to do that in this patch, but in a separate one.)


http://reviews.llvm.org/D11266





More information about the llvm-commits mailing list