Relocatable read-only section support for absolute jump table
authorHaochen Gui <guihaoc@gcc.gnu.org>
Tue, 17 Nov 2020 19:52:15 +0000 (13:52 -0600)
committerHaochen Gui <guihaoc@gcc.gnu.org>
Tue, 17 Nov 2020 05:53:14 +0000 (13:53 +0800)
commitd5ac0401eb128bf3dadec943741dfde7c499e49a
tree9f7cce8cbdbd8438af547d8584dea1b25ba77185
parent287cc750b0887e86cb309d976b17c7ee95f7ad48
Relocatable read-only section support for absolute jump table

This patch puts absolute jump tables into a relocatable read-only section
if they are on ELF target and relocation is supported.

gcc/ChangeLog:

* final.c (final_scan_insn_1): Set jump table relocatable as the
second argument of targetm.asm_out.function_rodata_section.
* output.h (default_function_rodata_section,
default_no_function_rodata_section): Add the second argument to the
declarations.
* target.def (function_rodata_section): Change the doc and add
the second argument.
* doc/tm.texi: Regenerate.
* varasm.c (jumptable_relocatable): Implement.
(default_function_rodata_section): Add the second argument
and the support for relocatable read only sections.
(default_no_function_rodata_section): Add the second argument.
(function_mergeable_rodata_prefix): Set the second argument to false.
* config/mips/mips.c (mips_function_rodata_section): Add the second
arugment and set it to false.
* config/s390/s390.c (targetm.asm_out.function_rodata_section): Set
the second argument to false.
* config/s390/s390.md: Likewise.
gcc/config/mips/mips.c
gcc/config/s390/s390.c
gcc/config/s390/s390.md
gcc/doc/tm.texi
gcc/final.c
gcc/output.h
gcc/target.def
gcc/varasm.c