CFLAGS += -fomit-frame-pointer
endif
+CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
+
CFLAGS += -nostdinc -fno-builtin -fno-common
CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
$(call cc-option-add,CFLAGS,CC,-Wvla)
#endif /* !CONFIG_EARLY_PRINTK */
+ .section .text.header, "ax", @progbits
.arm
/*
add \xb, \xb, x20
.endm
+ .section .text.header, "ax", @progbits
/*.aarch64*/
/*
_start = .;
.text : {
_stext = .; /* Text section */
+ *(.text.header)
+
+ *(.text.cold .text.cold.*)
+ *(.text.unlikely .text.*_unlikely .text.unlikely.*)
+
*(.text)
- *(.text.cold)
- *(.text.unlikely)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+ *(.text.*)
+#endif
+
*(.fixup)
*(.gnu.warning)
_etext = .; /* End of text section */
*(.data.rel)
*(.data.rel.*)
+#ifdef CONFIG_LIVEPATCH
+ *(.data.*)
+#endif
CONSTRUCTORS
} :text
. = ALIGN(SMP_CACHE_BYTES);
__per_cpu_data_end = .;
*(.bss)
+#ifdef CONFIG_LIVEPATCH
+ *(.bss.*)
+#endif
. = ALIGN(POINTER_ALIGN);
__bss_end = .;
} :text
#include <asm/cpufeature.h>
#include <public/elfnote.h>
- .text
+ .section .text.header, "ax", @progbits
.code32
#define sym_offs(sym) ((sym) - __XEN_VIRT_START)
_start = .;
DECL_SECTION(.text) {
_stext = .; /* Text and read-only data */
- *(.text)
- *(.text.__x86_indirect_thunk_*)
- *(.text.page_aligned)
+ *(.text.header)
. = ALIGN(PAGE_SIZE);
_stextentry = .;
*(.text.kexec) /* Page aligned in the object file. */
kexec_reloc_end = .;
- *(.text.cold)
- *(.text.unlikely)
+ *(.text.cold .text.cold.*)
+ *(.text.unlikely .text.*_unlikely .text.unlikely.*)
+
+ *(.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+ *(.text.*)
+#endif
+ *(.text.__x86_indirect_thunk_*)
+ *(.text.page_aligned)
+
*(.fixup)
*(.gnu.warning)
_etext = .; /* End of text section */
DECL_SECTION(.data) {
*(.data.page_aligned)
- *(.data)
- *(.data.rel)
- *(.data.rel.*)
+ *(.data .data.*)
CONSTRUCTORS
} PHDR(text)
*(.bss.percpu.read_mostly)
. = ALIGN(SMP_CACHE_BYTES);
__per_cpu_data_end = .;
- *(.bss)
+ *(.bss .bss.*)
. = ALIGN(POINTER_ALIGN);
__bss_end = .;
} PHDR(text)
config CRYPTO
bool
+config CC_SPLIT_SECTIONS
+ bool
+
config LIVEPATCH
bool "Live patching support"
default X86
depends on "$(XEN_HAS_BUILD_ID)" = "y"
+ select CC_SPLIT_SECTIONS
---help---
Allows a running Xen hypervisor to be dynamically patched using
binary patches without rebooting. This is primarily used to binarily