Files
clang-p2996/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
Ard Biesheuvel 2e47b93fd2 [ARM] Honour -mno-movt in stack protector handling (#109022)
When -mno-movt is passed to Clang, the ARM codegen correctly avoids
movt/movw pairs to take the address of __stack_chk_guard in the stack
protector code emitted into the function pro- and epilogues. However,
the Thumb2 codegen fails to do so, and happily emits movw/movt pairs
unless it is generating an ELF binary and the symbol might be in a
different DSO. Let's incorporate a check for useMovt() in the logic
here, so movt/movw are never emitted when -mno-movt is specified.

Suggestions welcome for how/where to add a test case for this.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-10-09 09:34:17 -07:00

30 KiB