[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
Fri Dec 15 07:42:25 PST 2017


Igor Kudrin via Phabricator <reviews at reviews.llvm.org> writes:

> ikudrin updated this revision to Diff 127104.
> ikudrin added a comment.
>
> - Add a sentinel entry earlier so that it can be arranged in a regular way.

Please rebase on top of the current change to deduplicate entries.

>      }
> +    if (Sections.empty())
> +      continue;

This is never true because of the sentinel, no?


> +ARMExidxSentinelSection *ARMExidxSentinelSection::create() {
> +  if (Config->Relocatable)
> +    return nullptr;
> +
> +  // Find if there are live ARM exidx input sections.
> +  if (InputSections.end() ==
> +      llvm::find_if(InputSections, [](InputSectionBase *Sec) {
> +        return Sec->Type == SHT_ARM_EXIDX && Sec->Live;
> +      }))
> +    return nullptr;

Walling all input sections to find out if it is needed seems a bit
much. If you really must create the sentinel before adding other
sections to the output you should implement an empty() method so that it
is dropped if not needed.

Cheers,
Rafael


More information about the llvm-commits mailing list