diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-26 13:11:18 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-26 13:11:18 -0800 |
commit | fcbc38b1b296cd38214891fb1fc714d52937d062 (patch) | |
tree | cb10b3a1bb13fb1c6e84b743550d48eaf8bfd061 /include | |
parent | 844056fd74ebdd826bd23a7d989597e15f478acb (diff) | |
parent | a356d2ae50790f49858ebed35da9e206336fafee (diff) | |
download | linux-fcbc38b1b296cd38214891fb1fc714d52937d062.tar.bz2 |
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Ingo Molnar:
"A handful of objtool fixes, most of them related to making the UAPI
header-syncing warnings easier to read and easier to act upon"
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tools/headers: Sync objtool UAPI header
objtool: Fix cross-build
objtool: Move kernel headers/code sync check to a script
objtool: Move synced files to their original relative locations
objtool: Make unreachable annotation inline asms explicitly volatile
objtool: Add a comment for the unreachable annotation macros
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/compiler.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 3672353a0acd..188ed9f65517 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -88,17 +88,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, /* Unreachable code */ #ifdef CONFIG_STACK_VALIDATION +/* + * These macros help objtool understand GCC code flow for unreachable code. + * The __COUNTER__ based labels are a hack to make each instance of the macros + * unique, to convince GCC not to merge duplicate inline asm statements. + */ #define annotate_reachable() ({ \ - asm("%c0:\n\t" \ - ".pushsection .discard.reachable\n\t" \ - ".long %c0b - .\n\t" \ - ".popsection\n\t" : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ - asm("%c0:\n\t" \ - ".pushsection .discard.unreachable\n\t" \ - ".long %c0b - .\n\t" \ - ".popsection\n\t" : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.unreachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define ASM_UNREACHABLE \ "999:\n\t" \ |