[PATCH] D37736: [ELF] - Do not spread specific flags when emiting output sections.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 16:05:12 PDT 2017


Rafael Avila de Espindola <rafael.espindola at gmail.com> writes:

I was experimenting a bit more with this.

Another option is doing what bfd does: not create the section. This
effectively means translating

SECTIONS {
  .abc : { xyz = .; }
}

to

SECTIONS {
  xyz = .;
}

But this is not generally applicable. We cannot do it if the section has
an explicit program header for example. It seems better to treat both
cases the same.

Another option that I tried is to still create the section, but don't
propagate the flags. This requires other parts of the code being aware
of these special sections:

* Orphan placement should not consider them as an insertion point.
* We should not create different program headers because of them.
* assignAddresses should not change the address to 0 even if they are
  not SHF_ALLOC.

Overall it seems much better to propagate a white list of flags and let
the rest of the code treat them as real sections.

Cheers,
Rafael


More information about the llvm-commits mailing list