[PATCH] [ELF] Handle __init_array{start, end} correctly.

Shankar Easwaran shankare at codeaurora.org
Wed Mar 11 10:55:24 PDT 2015


On 3/10/2015 11:28 PM, Davide Italiano wrote:
> REPOSITORY
>    rL LLVM
>
> ================
> Comment at: lib/ReaderWriter/ELF/Atoms.h:873
> @@ -847,1 +872,3 @@
> +};
> +
>   class InitFiniAtom : public SimpleELFDefinedAtom {
> ----------------
> shankarke wrote:
>> It would be nice to add a class LinkerDefinedAtoms, that you can use for the purpose. It would simplify / remove extraneous code.
>>
>> Another thing apart from visibility that lld doesnot currently do is the symbols get added for executables all the time, even there is no init_array section.
> So if I read correctly your proposal is that of renaming InitArrayAtom to LinkerDefinedAtoms and use that also for preinit/fini/bss etc..?
Yes, which otherwise we will need a seperate class for every atom that 
the linker creates.
> About --gc-section,. I've already did some ground work for it and fixed bugs (see r230614 and r230737) but still lots of atoms get reclaimed when they shouldn't, making lld not functional. This patch is also part of the ground work because the section is important to understand what can or cannot be stripped (see KEEP directive of GNU ld linker script, which is, unfortunately or not) widely used in FreeBSD default linker script and FreeBSD kernel linker script.
>
> http://reviews.llvm.org/D8241
>
> EMAIL PREFERENCES
>    http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list