File tree Expand file tree Collapse file tree 6 files changed +8
-32
lines changed
Expand file tree Collapse file tree 6 files changed +8
-32
lines changed Original file line number Diff line number Diff line change 4545#define __WARN_FLAGS (flags ) \
4646do { \
4747 instrumentation_begin(); \
48- __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE);\
48+ __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b) );\
4949 instrumentation_end(); \
5050} while (0)
5151
Original file line number Diff line number Diff line change @@ -308,10 +308,9 @@ SYM_CODE_END(xen_error_entry)
308308 movq $-1 , ORIG_RAX(%rsp ) /* no syscall to restart */
309309 .endif
310310
311- call \cfunc
312-
313311 /* For some configurations \cfunc ends up being a noreturn. */
314312 ANNOTATE_REACHABLE
313+ call \cfunc
315314
316315 jmp error_return
317316.endm
@@ -529,10 +528,10 @@ SYM_CODE_START(\asmsym)
529528 movq %rsp , %rdi /* pt_regs pointer into first argument */
530529 movq ORIG_RAX(%rsp ), %rsi /* get error code into 2nd argument*/
531530 movq $-1 , ORIG_RAX(%rsp ) /* no syscall to restart */
532- call \cfunc
533531
534532 /* For some configurations \cfunc ends up being a noreturn. */
535533 ANNOTATE_REACHABLE
534+ call \cfunc
536535
537536 jmp paranoid_exit
538537
Original file line number Diff line number Diff line change 9292do { \
9393 __auto_type __flags = BUGFLAG_WARNING|(flags); \
9494 instrumentation_begin(); \
95- _BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE); \
95+ _BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE(1b) ); \
9696 instrumentation_end(); \
9797} while (0)
9898
Original file line number Diff line number Diff line change 100100}
101101
102102#define ASM_CALL_ARG0 \
103- "call %c[__func] \n" \
104- ANNOTATE_REACHABLE
103+ "1: call %c[__func] \n" \
104+ ANNOTATE_REACHABLE(1b)
105105
106106#define ASM_CALL_ARG1 \
107107 "movq %[arg1], %%rdi \n" \
Original file line number Diff line number Diff line change 177177 */
178178#define ANNOTATE_UNRET_BEGIN ASM_ANNOTATE(ANNOTYPE_UNRET_BEGIN)
179179/*
180- * This should be used directly after an instruction that is considered
180+ * This should be used to refer to an instruction that is considered
181181 * terminating, like a noreturn CALL or UD2 when we know they are not -- eg
182182 * WARN using UD2.
183183 */
184- #define ANNOTATE_REACHABLE ASM_ANNOTATE( ANNOTYPE_REACHABLE)
184+ #define ANNOTATE_REACHABLE ( label ) __ASM_ANNOTATE(label, ANNOTYPE_REACHABLE)
185185
186186#else
187187#define ANNOTATE_NOENDBR ANNOTATE type=ANNOTYPE_NOENDBR
Original file line number Diff line number Diff line change @@ -614,19 +614,6 @@ static int init_pv_ops(struct objtool_file *file)
614614 return 0 ;
615615}
616616
617- static struct instruction * find_last_insn (struct objtool_file * file ,
618- struct section * sec )
619- {
620- struct instruction * insn = NULL ;
621- unsigned int offset ;
622- unsigned int end = (sec -> sh .sh_size > 10 ) ? sec -> sh .sh_size - 10 : 0 ;
623-
624- for (offset = sec -> sh .sh_size - 1 ; offset >= end && !insn ; offset -- )
625- insn = find_insn (file , sec , offset );
626-
627- return insn ;
628- }
629-
630617static int create_static_call_sections (struct objtool_file * file )
631618{
632619 struct static_call_site * site ;
@@ -2281,16 +2268,6 @@ static int read_annotate(struct objtool_file *file,
22812268 offset = reloc -> sym -> offset + reloc_addend (reloc );
22822269 insn = find_insn (file , reloc -> sym -> sec , offset );
22832270
2284- /*
2285- * Reachable annotations are 'funneh' and act on the previous instruction :/
2286- */
2287- if (type == ANNOTYPE_REACHABLE ) {
2288- if (insn )
2289- insn = prev_insn_same_sec (file , insn );
2290- else if (offset == reloc -> sym -> sec -> sh .sh_size )
2291- insn = find_last_insn (file , reloc -> sym -> sec );
2292- }
2293-
22942271 if (!insn ) {
22952272 WARN ("bad .discard.annotate_insn entry: %d of type %d" , reloc_idx (reloc ), type );
22962273 return -1 ;
You can’t perform that action at this time.
0 commit comments