# Re: \[RFC PATCH 12/17\] gcc-plugins: objtool: Add plugin to detect switch table on arm64

- From: Nick Desaulniers \<ndesaulniers@google.com\>
- Date: 2021-01-27 22:16:59 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/01/6250167
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/01/6241659/t.md

```text
> From: Raphael Gault <redacted>
> 
> This plugins comes into play before the final 2 RTL passes of GCC and
> detects switch-tables that are to be outputed in the ELF and writes
> information in an ".discard.switch_table_info" section which will be
> used by objtool.
> 
> Signed-off-by: Raphael Gault <redacted>
> [J.T.: Change section name to store switch table information,
>        Make plugin Kconfig be selected rather than opt-in by user,
>        Add a relocation in the switch_table_info that points to
>        the jump operation itself]
> Signed-off-by: Julien Thierry <redacted>

Rather than tightly couple this feature to a particular toolchain via
plugin, it might be nice to consider what features could be spec'ed out
for toolchains to implement (perhaps via a -f flag).

Distributions (like Android, CrOS) wont be able to use such a feature as
is.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
