Skip to contentSkip to conversation

+ kernel-add-support-for-init_array-constructors.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Sep 18, 2013 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

Subject: + kernel-add-support-for-init_array-constructors.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 18 Sep 2013 14:24:22 -0700

The patch titled
Subject: kernel: add support for init_array constructors
has been added to the -mm tree. Its filename is
kernel-add-support-for-init_array-constructors.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/kernel-add-support-for-init_array-constructors.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/kernel-add-support-for-init_array-constructors.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Frantisek Hrbata <[email protected]>
Subject: 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 version.

Cc Jan Stancek <[email protected]>
Cc Kees Cook <[email protected]>
Cc Peter Oberparleiter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Gospodarek <[email protected]>

---

 include/asm-generic/vmlinux.lds.h |    1 +
 kernel/module.c                   |    3 +++
 2 files changed, 4 insertions(+)
include/asm-generic/vmlinux.lds.h renamed from include/asm-generic/vmlinux.lds.h~kernel-add-support-for-init_array-constructors +1 -0
diff -puN include/asm-generic/vmlinux.lds.h~kernel-add-support-for-init_array-constructors include/asm-generic/vmlinux.lds.h
@@ -473,6 +473,7 @@
 #define KERNEL_CTORS()	. = ALIGN(8);			   \
 			VMLINUX_SYMBOL(__ctors_start) = .; \
 			*(.ctors)			   \
+			*(.init_array)			   \
 			VMLINUX_SYMBOL(__ctors_end) = .;
 #else
 #define KERNEL_CTORS()
kernel/module.c renamed from kernel/module.c~kernel-add-support-for-init_array-constructors +3 -0
diff -puN kernel/module.c~kernel-add-support-for-init_array-constructors kernel/module.c
@@ -2768,6 +2768,9 @@ static void find_module_sections(struct
 #ifdef CONFIG_CONSTRUCTORS
 	mod->ctors = section_objs(info, ".ctors",
 				  sizeof(*mod->ctors), &mod->num_ctors);
+	if (!mod->ctors)
+		mod->ctors = section_objs(info, ".init_array",
+				sizeof(*mod->ctors), &mod->num_ctors);
 #endif
 
 #ifdef CONFIG_TRACEPOINTS

_

Patches currently in -mm which might be from [email protected] are

gcov-move-gcov-structs-definitions-to-a-gcc-version-specific-file.patch gcov-add-support-for-gcc-47-gcov-format.patch gcov-add-support-for-gcc-47-gcov-format-fix.patch gcov-compile-specific-gcov-implementation-based-on-gcc-version.patch kernel-add-support-for-init_array-constructors.patch