Skip to content

Commit 1e80cd1

Browse files
keesJames Morris
authored andcommitted
vmlinux.lds.h: Avoid copy/paste of security_init section
Avoid copy/paste by defining SECURITY_INIT in terms of SECURITY_INITCALL. Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: James Morris <james.morris@microsoft.com> Reviewed-by: John Johansen <john.johansen@canonical.com> Signed-off-by: James Morris <james.morris@microsoft.com>
1 parent 98d2917 commit 1e80cd1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,6 @@
473473
#define RODATA RO_DATA_SECTION(4096)
474474
#define RO_DATA(align) RO_DATA_SECTION(align)
475475

476-
#define SECURITY_INIT \
477-
.security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
478-
__security_initcall_start = .; \
479-
KEEP(*(.security_initcall.init)) \
480-
__security_initcall_end = .; \
481-
}
482-
483476
/*
484477
* .text section. Map to function alignment to avoid address changes
485478
* during second ld run in second ld pass when generating System.map
@@ -798,6 +791,12 @@
798791
KEEP(*(.security_initcall.init)) \
799792
__security_initcall_end = .;
800793

794+
/* Older linker script style for security init. */
795+
#define SECURITY_INIT \
796+
.security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
797+
SECURITY_INITCALL \
798+
}
799+
801800
#ifdef CONFIG_BLK_DEV_INITRD
802801
#define INIT_RAM_FS \
803802
. = ALIGN(4); \

0 commit comments

Comments
 (0)