objtool: Consolidate annotation macros
Consolidate __ASM_ANNOTATE into a single macro which is used by both C and asm. This also makes the code generation a bit more palatable by putting it all on a single line. Turn this: 911: .pushsection .discard.annotate_insn,"M", @progbits, 8 .long 911b - . .long 1 .popsection jmp __x86_return_thunk Into: 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 1; .popsection jmp __x86_return_thunk Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://patch.msgid.link/c05ff40d3383e85c3b59018ef0b3c7aaf993a60d.1764694625.git.jpoimboe@kernel.orgpull/1354/merge
parent
f387d0e102
commit
305c8dc477
|
|
@ -6,41 +6,35 @@
|
||||||
|
|
||||||
#ifdef CONFIG_OBJTOOL
|
#ifdef CONFIG_OBJTOOL
|
||||||
|
|
||||||
|
#define __ASM_ANNOTATE(section, label, type) \
|
||||||
|
.pushsection section, "M", @progbits, 8; \
|
||||||
|
.long label - .; \
|
||||||
|
.long type; \
|
||||||
|
.popsection
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
#define __ASM_ANNOTATE(section, label, type) \
|
|
||||||
".pushsection " section ",\"M\", @progbits, 8\n\t" \
|
|
||||||
".long " __stringify(label) " - .\n\t" \
|
|
||||||
".long " __stringify(type) "\n\t" \
|
|
||||||
".popsection\n\t"
|
|
||||||
|
|
||||||
#define ASM_ANNOTATE_LABEL(label, type) \
|
#define ASM_ANNOTATE_LABEL(label, type) \
|
||||||
__ASM_ANNOTATE(".discard.annotate_insn", label, type)
|
__stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t"
|
||||||
|
|
||||||
#define ASM_ANNOTATE(type) \
|
#define ASM_ANNOTATE(type) \
|
||||||
"911:\n\t" \
|
"911: " \
|
||||||
ASM_ANNOTATE_LABEL(911b, type)
|
__stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t"
|
||||||
|
|
||||||
#define ASM_ANNOTATE_DATA(type) \
|
#define ASM_ANNOTATE_DATA(type) \
|
||||||
"912:\n\t" \
|
"912: " \
|
||||||
__ASM_ANNOTATE(".discard.annotate_data", 912b, type)
|
__stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t"
|
||||||
|
|
||||||
#else /* __ASSEMBLY__ */
|
#else /* __ASSEMBLY__ */
|
||||||
|
|
||||||
.macro __ANNOTATE section, type
|
|
||||||
.Lhere_\@:
|
|
||||||
.pushsection \section, "M", @progbits, 8
|
|
||||||
.long .Lhere_\@ - .
|
|
||||||
.long \type
|
|
||||||
.popsection
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro ANNOTATE type
|
.macro ANNOTATE type
|
||||||
__ANNOTATE ".discard.annotate_insn", \type
|
.Lhere_\@:
|
||||||
|
__ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type)
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro ANNOTATE_DATA type
|
.macro ANNOTATE_DATA type
|
||||||
__ANNOTATE ".discard.annotate_data", \type
|
.Lhere_\@:
|
||||||
|
__ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type)
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue