kernel: add support for init_array constructors
authorFrantisek Hrbata <fhrbata@redhat.com>
Mon, 14 Oct 2013 07:38:46 +0000 (18:08 +1030)
committerMark Brown <broonie@kernel.org>
Tue, 17 Mar 2015 21:52:04 +0000 (21:52 +0000)
commiteb05fc8193e9632a1910c2a2dedbcaf88a5a361f
tree6c9a78dfb0378134230918be1667647cb19d5c2f
parent9c6152e67952d3645e9379b6b3e120e3308caca0
kernel: add support for init_array constructors

This adds the .init_array section as yet another section with constructors. This
is needed because gcc could add __gcov_init calls to .init_array or .ctors
section, depending on gcc (and binutils) version .

v2: - reuse mod->ctors for .init_array section for modules, because gcc uses
      .ctors or .init_array, but not both at the same time
v3: - fail to load if that does happen somehow.

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/asm-generic/vmlinux.lds.h
kernel/module.c