[PATCH] D27040: [ELF] - Add support for access to most of synthetic sections from linkerscript.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 09:57:14 PST 2016


ruiu added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:1589-1590
+template <class ELFT> bool VersionTableSection<ELFT>::empty() const {
+  bool HasVerNeed = In<ELFT>::VerNeed->getNeedNum() != 0;
+  return !In<ELFT>::VerDef && !HasVerNeed;
+}
----------------
grimar wrote:
> ruiu wrote:
> > I don't understand these conditions. Is this the same as the code below?
> > 
> >   if (!In<ELFT>::Verdef)
> >     return true;
> >   return In<ELFT>::VerNeed->empty();
> It is the same as:
> 
> ```
> template <class ELFT> bool VersionTableSection<ELFT>::empty() const {
>   return !In<ELFT>::VerDef && In<ELFT>::VerNeed->empty();
> }
> ```
So, you meant VersionTable is empty if

 - we have a VerDef section,
 - and VerNeed is empty.

But why?


https://reviews.llvm.org/D27040





More information about the llvm-commits mailing list