[PATCH] [ELF] Make -init/-fini options compatible with the gnu linker
Simon Atanasyan
simon at atanasyan.com
Tue Dec 9 05:56:24 PST 2014
>>! In D6578#9, @shankar.easwaran wrote:
> $ ld.gold --help|grep ctors
> --ctors-in-init-array Use DT_INIT_ARRAY for all constructors (default)
> --no-ctors-in-init-array Handle constructors as directed by compiler.
>
> If this is the case I recommend using old code so that ctors and init/fini are placed in init array sections or fini array sections.
The old code puts to the `.init_array/.fini_array` sections only the symbols specified by the `-init/-fini` command line options. It does nothing with incoming `.ctors` and `.init` sections. I can keep `xxxInitAtom / xxxFiniAtom` classes but they will be a really dead code. Sure we can/need to implement `--ctors-in-init-array` default semantics. But I think it is a separate task.
http://reviews.llvm.org/D6578
More information about the llvm-commits
mailing list