[PATCH] D30419: [ELF] - Define __bss_start symbol.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 11:38:12 PST 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> +  // __bss_start should point to the first .bss.* output section.
> +  for (OutputSection *OS : OutputSections) {
> +    bool IsBSS = (In<ELFT>::Common && In<ELFT>::Common->OutSec == OS) ||
> +                 OS == Out::Bss || OS == Out::BssRelRo;

You can just check if the type is NOBITS, no?

> +    if (!IsBSS)
> +      continue;
> +    Set(ElfSym<ELFT>::BssStart, nullptr, OS, 0);
> +    break;

This might be simpler as

if (IsBSS) {
  Set ...
  break;
}

LGTM with the nits.

Cheers,
Rafael


More information about the llvm-commits mailing list