Skip to content

Commit

Permalink
vmlinux.lds.h: Avoid copy/paste of security_init section
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kees Cook authored and James Morris committed Oct 11, 2018
1 parent 98d2917 commit 1e80cd1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,6 @@
#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
Expand Down Expand Up @@ -798,6 +791,12 @@
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); \
Expand Down

0 comments on commit 1e80cd1

Please sign in to comment.