diff options
| author | James Morris <james.morris@microsoft.com> | 2019-01-10 11:41:59 -0800 |
|---|---|---|
| committer | James Morris <james.morris@microsoft.com> | 2019-01-10 11:41:59 -0800 |
| commit | 49e41801b335f64610bbfd23e8f2bbaf34d46276 (patch) | |
| tree | 4fbedacd1de1bbd4054f07f93031aebcb7b7a919 /include/linux/export.h | |
| parent | b49d564344f773d8afee982153c8493e5f2eaf38 (diff) | |
| parent | bfeffd155283772bbe78c6a05dec7c0128ee500c (diff) | |
Merge tag 'v5.0-rc1' into next-general
Linux 5.0-rc1
Sync to pick up LSM stacking work (which is based on -rc1).
Diffstat (limited to 'include/linux/export.h')
| -rw-r--r-- | include/linux/export.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/export.h b/include/linux/export.h index ce764a5d2ee4..fd8711ed9ac4 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -92,22 +92,22 @@ struct kernel_symbol { */ #define __EXPORT_SYMBOL(sym, sec) -#elif defined(__KSYM_DEPS__) +#elif defined(CONFIG_TRIM_UNUSED_KSYMS) + +#include <generated/autoksyms.h> /* * For fine grained build dependencies, we want to tell the build system * about each possible exported symbol even if they're not actually exported. - * We use a string pattern that is unlikely to be valid code that the build - * system filters out from the preprocessor output (see ksym_dep_filter - * in scripts/Kbuild.include). + * We use a symbol pattern __ksym_marker_<symbol> that the build system filters + * from the $(NM) output (see scripts/gen_ksymdeps.sh). These symbols are + * discarded in the final link stage. */ -#define __EXPORT_SYMBOL(sym, sec) === __KSYM_##sym === - -#elif defined(CONFIG_TRIM_UNUSED_KSYMS) - -#include <generated/autoksyms.h> +#define __ksym_marker(sym) \ + static int __ksym_marker_##sym[0] __section(".discard.ksym") __used #define __EXPORT_SYMBOL(sym, sec) \ + __ksym_marker(sym); \ __cond_export_sym(sym, sec, __is_defined(__KSYM_##sym)) #define __cond_export_sym(sym, sec, conf) \ ___cond_export_sym(sym, sec, conf) |
