[PATCH] D41234: [ELF] Fix placement of a sentinel entry in the .ARM.exidx section.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 27 17:00:12 PST 2017


Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> ruiu added inline comments.
>
>
> ================
> Comment at: lld/trunk/ELF/SyntheticSections.cpp:2573
> +// The sentinel has to be removed if there are no other .ARM.exidx entries.
> +bool ARMExidxSentinelSection::empty() const {
> +  OutputSection *OS = getParent();
> ----------------
> It looks like this function returns true if the parent section of this section is empty. That's different from what you'd expect for `empty`function. `empty` should return true if `this` is empty, not other object.

It is a funny definition, but the sentinel is empty if it is the only
section.

> ================
> Comment at: lld/trunk/ELF/SyntheticSections.h:790
> +
> +  InputSection *Highest = 0;
>  };
> ----------------
> `= 0` is too C-ish. Please use nullptr. Also this needs comment because it is not obvious what this member is. What is Highest?

Agreed. Highest was just copied from the old code, but now it is used in
a larger context.

Igor, please  switch to nullptr and add a comment.

Thanks,
Rafael


More information about the llvm-commits mailing list