summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-05-24 16:12:31 -0400
committerTom Rini <[email protected]>2021-05-24 16:12:31 -0400
commit27c6d9663c3f42059514e47c17652304a1cfcfc9 (patch)
tree15e7a1deb449053a3ffca9b708813cce2da366ec /include/linux
parenteb53b943be2949ca111140a8e05532cd74cda058 (diff)
parent2fc62f2991744dfeec65f8619092c359d8ecbcb0 (diff)
Merge branch '2021-05-24-add-lto-support'
- Add LTO (link time optimization) support to the build system and enable it on a few boards. This is an alternative to using -ffunction-sections/-fdata-sections and --gc-sections at link time to remove unused code. This can result in notable savings, but needs testing on each platform before use as it can expose problems by optimizing away various functionally necessary calls.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler.h10
-rw-r--r--include/linux/compiler_attributes.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5e3b3c08e91..98dd3fc4cc2 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
long ______r; \
static struct ftrace_likely_data \
__aligned(4) \
- __section(_ftrace_annotated_branch) \
+ __section("_ftrace_annotated_branch") \
______f = { \
.data.func = __func__, \
.data.file = __FILE__, \
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
#define __trace_if_value(cond) ({ \
static struct ftrace_branch_data \
__aligned(4) \
- __section(_ftrace_branch) \
+ __section("_ftrace_branch") \
__if_trace = { \
.func = __func__, \
.file = __FILE__, \
@@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
".popsection\n\t"
/* Annotate a C jump table to allow objtool to follow the code flow */
-#define __annotate_jump_table __section(.rodata..c_jump_table)
+#define __annotate_jump_table __section(".rodata..c_jump_table")
#else
#define annotate_reachable()
@@ -294,8 +294,8 @@ unsigned long read_word_at_a_time(const void *addr)
* visible to the compiler.
*/
#define __ADDRESSABLE(sym) \
- static void * __section(.discard.addressable) __used \
- __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
+ static void * __section(".discard.addressable") __used \
+ __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)&sym;
/**
* offset_to_ptr - convert a relative memory offset to an absolute pointer
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index cdf01659665..44c9a08d734 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -246,7 +246,7 @@
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
* clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
*/
-#define __section(S) __attribute__((__section__(#S)))
+#define __section(S) __attribute__((__section__(S)))
/*
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute