File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -4547,7 +4547,7 @@ static int disas_warned_funcs(struct objtool_file *file)
4547
4547
char * funcs = NULL , * tmp ;
4548
4548
4549
4549
for_each_sym (file , sym ) {
4550
- if (sym -> warned ) {
4550
+ if (sym -> warnings ) {
4551
4551
if (!funcs ) {
4552
4552
funcs = malloc (strlen (sym -> name ) + 1 );
4553
4553
strcpy (funcs , sym -> name );
Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ struct symbol {
65
65
u8 return_thunk : 1 ;
66
66
u8 fentry : 1 ;
67
67
u8 profiling_func : 1 ;
68
- u8 warned : 1 ;
69
68
u8 embedded_insn : 1 ;
70
69
u8 local_label : 1 ;
71
70
u8 frame_pointer : 1 ;
71
+ u8 warnings : 2 ;
72
72
struct list_head pv_target ;
73
73
struct reloc * relocs ;
74
74
};
Original file line number Diff line number Diff line change @@ -53,14 +53,22 @@ static inline char *offstr(struct section *sec, unsigned long offset)
53
53
free(_str); \
54
54
})
55
55
56
+ #define WARN_LIMIT 2
57
+
56
58
#define WARN_INSN (insn , format , ...) \
57
59
({ \
58
60
struct instruction *_insn = (insn); \
59
- if (!_insn->sym || !_insn->sym->warned) \
61
+ BUILD_BUG_ON(WARN_LIMIT > 2); \
62
+ if (!_insn->sym || _insn->sym->warnings < WARN_LIMIT) { \
60
63
WARN_FUNC(format, _insn->sec, _insn->offset, \
61
64
##__VA_ARGS__); \
62
- if (_insn->sym) \
63
- _insn->sym->warned = 1; \
65
+ if (_insn->sym) \
66
+ _insn->sym->warnings++; \
67
+ } else if (_insn->sym && _insn->sym->warnings == WARN_LIMIT) { \
68
+ WARN_FUNC("skipping duplicate warning(s)", \
69
+ _insn->sec, _insn->offset); \
70
+ _insn->sym->warnings++; \
71
+ } \
64
72
})
65
73
66
74
#define BT_INSN (insn , format , ...) \
You can’t perform that action at this time.
0 commit comments