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

Rui Ueyama ruiu at google.com
Wed Mar 11 12:30:11 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/ReaderWriter/ELF/Atoms.h:873
@@ -847,1 +872,3 @@
+};
+
 class InitFiniAtom : public SimpleELFDefinedAtom {
----------------
davide wrote:
> 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.
This is not a complicated class so I think it's ok for now. We may want to clean this up, but that needs to be done in a separate patch. First thing we should do is probably removing blank lines from one-line member function definitions so that they look more like simple struct-like field definitions.

http://reviews.llvm.org/D8241

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list