[PATCH] D15767: [lld/ELF] Don't reclaim .ctors/.dtors

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 24 01:39:19 PST 2015


davide added a comment.

Both gold and ld keep the section in the output even if non-referenced and if empty.
Example:

davide at rabbit1:/exps/llvm-lld/build/bin % objdump -s -j .ctors ./blah

./blah:     file format elf64-x86-64-freebsd

Contents of section .ctors:
 4019f0 ffffffff ffffffff 00000000 00000000  ................
davide at rabbit1:/exps/llvm-lld/build/bin % 
davide at rabbit1:/exps/llvm-lld/build/bin % cat blah.c
blah.c     blah.core  blah.cpp   
davide at rabbit1:/exps/llvm-lld/build/bin % cat blah.c
int
main(void)
{

  return (0);

}

I'd love to strip it, but the overhead of keeping these bits around (if unused) should be minimal, FWIW.


http://reviews.llvm.org/D15767





More information about the llvm-commits mailing list