Skip to content

Commit 4baae98

Browse files
jpoimboePeter Zijlstra
authored andcommitted
objtool: Print data address for "!ENDBR" data warnings
When a "!ENDBR" warning is reported for a data section, objtool just prints the text address of the relocation target twice, without giving any clues about the location of the original data reference: vmlinux.o: warning: objtool: dcbnl_netdevice_event()+0x0: .text+0xb64680: data relocation to !ENDBR: dcbnl_netdevice_event+0x0 Instead, print the address of the data reference, in addition to the address of the relocation target. vmlinux.o: warning: objtool: dcbnl_nb+0x0: .data..read_mostly+0xe260: data relocation to !ENDBR: dcbnl_netdevice_event+0x0 Fixes: 89bc853 ("objtool: Find unused ENDBR instructions") Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/762e88d51300e8eaf0f933a5b0feae20ac033bea.1650300597.git.jpoimboe@redhat.com
1 parent 1ab80a0 commit 4baae98

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/objtool/check.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3817,11 +3817,8 @@ static int validate_ibt(struct objtool_file *file)
38173817
struct instruction *dest;
38183818

38193819
dest = validate_ibt_reloc(file, reloc);
3820-
if (is_data && dest && !dest->noendbr) {
3821-
warn_noendbr("data ", reloc->sym->sec,
3822-
reloc->sym->offset + reloc->addend,
3823-
dest);
3824-
}
3820+
if (is_data && dest && !dest->noendbr)
3821+
warn_noendbr("data ", sec, reloc->offset, dest);
38253822
}
38263823
}
38273824

0 commit comments

Comments
 (0)