lkml.org 
[lkml]   [2020]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] objtool: Fix clang switch table edge case
On Mon, Feb 17, 2020 at 09:41:53PM -0600, Josh Poimboeuf wrote:
> Clang has the ability to create a switch table which is not a jump
> table, but is rather a table of string pointers. This confuses objtool,
> because it sees the relocations for the string pointers and assumes
> they're part of a jump table:
>
> drivers/ata/sata_dwc_460ex.o: warning: objtool: sata_dwc_bmdma_start_by_tag()+0x3a2: can't find switch jump table
> net/ceph/messenger.o: warning: objtool: ceph_con_workfn()+0x47c: can't find switch jump table
>
> Make objtool's find_jump_table() smart enough to distinguish between a
> switch jump table (which has relocations to text addresses in the same
> function as the original instruction) and other anonymous rodata (which
> may have relocations to elsewhere).
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/485
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>

Tested with clang-11 and binutils 2.34, a combo that was previously
broken and I no longer see these warnings on either defconfig or
allyesconfig.

Tested-by: Nathan Chancellor <natechancellor@gmail.com>

\
 
 \ /
  Last update: 2020-02-18 21:10    [W:0.146 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site