config CC_HAS_VISIBILITY_ATTRIBUTE
def_bool $(cc-option,-fvisibility=hidden)
+# Use -f{function,data}-sections compiler parameters
+config CC_SPLIT_SECTIONS
+ bool
+
source "arch/$(SRCARCH)/Kconfig"
config DEFCONFIG_LIST
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)
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+ *(.text.*)
+#endif
*(.fixup)
*(.gnu.warning)
#endif
_erodata = .; /* End of read-only data */
+ . = ALIGN(PAGE_SIZE);
+ .data.read_mostly : {
+ /* Exception table */
+ __start___ex_table = .;
+ *(.ex_table)
+ __stop___ex_table = .;
+
+ /* Pre-exception table */
+ __start___pre_ex_table = .;
+ *(.ex_table.pre)
+ __stop___pre_ex_table = .;
+
+ *(.data.read_mostly)
+ } :text
+
+ . = ALIGN(SMP_CACHE_BYTES);
.data : { /* Data */
- . = ALIGN(PAGE_SIZE);
*(.data.page_aligned)
- *(.data)
. = ALIGN(8);
__start_schedulers_array = .;
*(.data.schedulers)
__paramhypfs_end = .;
#endif
- *(.data.rel)
- *(.data.rel.*)
+ *(.data .data.*)
CONSTRUCTORS
} :text
- . = ALIGN(SMP_CACHE_BYTES);
- .data.read_mostly : {
- /* Exception table */
- __start___ex_table = .;
- *(.ex_table)
- __stop___ex_table = .;
-
- /* Pre-exception table */
- __start___pre_ex_table = .;
- *(.ex_table.pre)
- __stop___pre_ex_table = .;
-
- *(.data.read_mostly)
- } :text
-
. = ALIGN(8);
.arch.info : {
_splatform = .;
*(.bss.percpu.read_mostly)
. = ALIGN(SMP_CACHE_BYTES);
__per_cpu_data_end = .;
- *(.bss)
+ *(.bss .bss.*)
. = ALIGN(POINTER_ALIGN);
__bss_end = .;
} :text
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+ *(.text.*)
+#endif
*(.text.__x86_indirect_thunk_*)
*(.text.page_aligned)
DECL_SECTION(.data) {
*(.data.page_aligned)
- *(.data)
- *(.data.rel)
- *(.data.rel.*)
+ *(.data .data.*)
} PHDR(text)
DECL_SECTION(.bss) {
*(.bss.percpu.read_mostly)
. = ALIGN(SMP_CACHE_BYTES);
__per_cpu_data_end = .;
- *(.bss)
+ *(.bss .bss.*)
. = ALIGN(POINTER_ALIGN);
__bss_end = .;
} PHDR(text)
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