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

Davide Italiano davide at freebsd.org
Tue Mar 10 21:28:07 PDT 2015


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..?
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/






More information about the llvm-commits mailing list