vmlinux.lds.h: Avoid copy/paste of security_init section
authorKees Cook <keescook@chromium.org>
Thu, 11 Oct 2018 00:18:18 +0000 (17:18 -0700)
committerJames Morris <james.morris@microsoft.com>
Thu, 11 Oct 2018 03:40:21 +0000 (20:40 -0700)
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>
include/asm-generic/vmlinux.lds.h

index 7b75ff6e2fceeb407e828c4e171176afc5ae7281..934a453955471ca39ddf40ac1f8f9165a7334d15 100644 (file)
 #define RODATA          RO_DATA_SECTION(4096)
 #define RO_DATA(align)  RO_DATA_SECTION(align)
 
-#define SECURITY_INIT                                                  \
-       .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
-               __security_initcall_start = .;                          \
-               KEEP(*(.security_initcall.init))                        \
-               __security_initcall_end = .;                            \
-       }
-
 /*
  * .text section. Map to function alignment to avoid address changes
  * during second ld run in second ld pass when generating System.map
                KEEP(*(.security_initcall.init))                        \
                __security_initcall_end = .;
 
+/* Older linker script style for security init. */
+#define SECURITY_INIT                                                  \
+       .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
+               SECURITY_INITCALL                                       \
+       }
+
 #ifdef CONFIG_BLK_DEV_INITRD
 #define INIT_RAM_FS                                                    \
        . = ALIGN(4);                                                   \