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 45
45
#define __WARN_FLAGS (flags ) \
46
46
do { \
47
47
instrumentation_begin(); \
48
- __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE);\
48
+ __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b) );\
49
49
instrumentation_end(); \
50
50
} while (0)
51
51
Original file line number Diff line number Diff line change @@ -308,10 +308,9 @@ SYM_CODE_END(xen_error_entry)
308
308
movq $-1 , ORIG_RAX(%rsp ) /* no syscall to restart */
309
309
.endif
310
310
311
- call \cfunc
312
-
313
311
/* For some configurations \cfunc ends up being a noreturn. */
314
312
ANNOTATE_REACHABLE
313
+ call \cfunc
315
314
316
315
jmp error_return
317
316
.endm
@@ -529,10 +528,10 @@ SYM_CODE_START(\asmsym)
529
528
movq %rsp , %rdi /* pt_regs pointer into first argument */
530
529
movq ORIG_RAX(%rsp ), %rsi /* get error code into 2nd argument*/
531
530
movq $-1 , ORIG_RAX(%rsp ) /* no syscall to restart */
532
- call \cfunc
533
531
534
532
/* For some configurations \cfunc ends up being a noreturn. */
535
533
ANNOTATE_REACHABLE
534
+ call \cfunc
536
535
537
536
jmp paranoid_exit
538
537
Original file line number Diff line number Diff line change 92
92
do { \
93
93
__auto_type __flags = BUGFLAG_WARNING|(flags); \
94
94
instrumentation_begin(); \
95
- _BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE); \
95
+ _BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE(1b) ); \
96
96
instrumentation_end(); \
97
97
} while (0)
98
98
Original file line number Diff line number Diff line change 100
100
}
101
101
102
102
#define ASM_CALL_ARG0 \
103
- "call %c[__func] \n" \
104
- ANNOTATE_REACHABLE
103
+ "1: call %c[__func] \n" \
104
+ ANNOTATE_REACHABLE(1b)
105
105
106
106
#define ASM_CALL_ARG1 \
107
107
"movq %[arg1], %%rdi \n" \
Original file line number Diff line number Diff line change 177
177
*/
178
178
#define ANNOTATE_UNRET_BEGIN ASM_ANNOTATE(ANNOTYPE_UNRET_BEGIN)
179
179
/*
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
181
181
* terminating, like a noreturn CALL or UD2 when we know they are not -- eg
182
182
* WARN using UD2.
183
183
*/
184
- #define ANNOTATE_REACHABLE ASM_ANNOTATE( ANNOTYPE_REACHABLE)
184
+ #define ANNOTATE_REACHABLE ( label ) __ASM_ANNOTATE(label, ANNOTYPE_REACHABLE)
185
185
186
186
#else
187
187
#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)
614
614
return 0 ;
615
615
}
616
616
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
-
630
617
static int create_static_call_sections (struct objtool_file * file )
631
618
{
632
619
struct static_call_site * site ;
@@ -2281,16 +2268,6 @@ static int read_annotate(struct objtool_file *file,
2281
2268
offset = reloc -> sym -> offset + reloc_addend (reloc );
2282
2269
insn = find_insn (file , reloc -> sym -> sec , offset );
2283
2270
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
-
2294
2271
if (!insn ) {
2295
2272
WARN ("bad .discard.annotate_insn entry: %d of type %d" , reloc_idx (reloc ), type );
2296
2273
return -1 ;
You can’t perform that action at this time.
0 commit comments