]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: move the switch tables for Arm to the RO data section.
authorRichard Ball <richard.ball@arm.com>
Mon, 30 Oct 2023 15:31:26 +0000 (15:31 +0000)
committerRichard Ball <richard.ball@arm.com>
Mon, 30 Oct 2023 15:31:26 +0000 (15:31 +0000)
commitfb1941d08fc3711b058c1e148e9ce7ed9b7dfbba
tree4dc93a6b920cd8c31fae00c132f673ca1dd45c97
parent7666d94db0684f04264712f3e3fdb542518960c5
arm: move the switch tables for Arm to the RO data section.

Follow up patch to arm: Use deltas for Arm switch tables
This patch moves the switch tables for Arm from the .text section
into the .rodata section.

gcc/ChangeLog:

* config/arm/aout.h: Change to use the Lrtx label.
* config/arm/arm.h (CASE_VECTOR_PC_RELATIVE): Remove arm targets
from (!target_pure_code) condition.
(ADDR_VEC_ALIGN): Add align for tables in rodata section.
* config/arm/arm.cc (arm_output_casesi): Alter the function to include
.Lrtx label and remove adr instructions.
* config/arm/arm.md
(arm_casesi_internal): Use force_reg to generate ldr instructions that
would otherwise be out of range, and change rtl to accommodate force reg.
Additionally remove unnecessary register temp.
(casesi): Remove pure code check for Arm.
* config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Remove arm
targets from JUMP_TABLES_IN_TEXT_SECTION definition.

gcc/testsuite/ChangeLog:

* gcc.target/arm/arm-switchstatement.c: Alter the tests to
change adr instruction to ldr.
gcc/config/arm/aout.h
gcc/config/arm/arm.cc
gcc/config/arm/arm.h
gcc/config/arm/arm.md
gcc/config/arm/elf.h
gcc/testsuite/gcc.target/arm/arm-switchstatement.c