[PATCH] D15767: [lld/ELF] Don't reclaim .ctors/.dtors
Rafael Espíndola via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 24 06:24:46 PST 2015
On 24 December 2015 at 04:16, Rui Ueyama <ruiu at google.com> wrote:
> ruiu added a comment.
> The code looks OK, but I'm not sure if this is the right thing to do. `.ctors` and `.dtors` are used to construct and destruct statically-allocated objects. This patch is to keep them regardless of their usage, which in turn the data referenced by `.ctors` or `.dtors` always live even if they are not used.
> I'm wondering why we need this for FreeBSD. What's the difference from Linux?
It uses .init_array instead of .ctor, so it was already covered.
We have to keep those since static constructors are always referenced:
the initialization code references it.
More information about the llvm-commits