mirror of git://gcc.gnu.org/git/gcc.git
pa.c (pa_output_addr_vec): Align address table.
* config/pa/pa.c (pa_output_addr_vec): Align address table. * config/pa/pa.h (JUMP_TABLES_IN_TEXT_SECTION): Revise comment. * config/pa/pa32-linux.h (JUMP_TABLES_IN_TEXT_SECTION): Define. From-SVN: r263051
This commit is contained in:
parent
d3d94f7a7a
commit
3605ba0d1b
|
|
@ -1,3 +1,9 @@
|
||||||
|
2018-07-29 John David Anglin <danglin@gcc.gnu.org>
|
||||||
|
|
||||||
|
* config/pa/pa.c (pa_output_addr_vec): Align address table.
|
||||||
|
* config/pa/pa.h (JUMP_TABLES_IN_TEXT_SECTION): Revise comment.
|
||||||
|
* config/pa/pa32-linux.h (JUMP_TABLES_IN_TEXT_SECTION): Define.
|
||||||
|
|
||||||
2018-07-27 Michael Meissner <meissner@linux.ibm.com>
|
2018-07-27 Michael Meissner <meissner@linux.ibm.com>
|
||||||
|
|
||||||
* config/rs6000/constraints.md (wG constraint): Delete, no longer
|
* config/rs6000/constraints.md (wG constraint): Delete, no longer
|
||||||
|
|
|
||||||
|
|
@ -10680,6 +10680,8 @@ pa_output_addr_vec (rtx lab, rtx body)
|
||||||
{
|
{
|
||||||
int idx, vlen = XVECLEN (body, 0);
|
int idx, vlen = XVECLEN (body, 0);
|
||||||
|
|
||||||
|
if (!TARGET_SOM)
|
||||||
|
fputs ("\t.align 4\n", asm_out_file);
|
||||||
targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
|
targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
|
||||||
if (TARGET_GAS)
|
if (TARGET_GAS)
|
||||||
fputs ("\t.begin_brtab\n", asm_out_file);
|
fputs ("\t.begin_brtab\n", asm_out_file);
|
||||||
|
|
|
||||||
|
|
@ -1143,21 +1143,23 @@ do { \
|
||||||
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
|
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
|
||||||
pa_output_ascii ((FILE), (P), (SIZE))
|
pa_output_ascii ((FILE), (P), (SIZE))
|
||||||
|
|
||||||
/* Jump tables are always placed in the text section. Technically, it
|
/* Jump tables are always placed in the text section. We have to do
|
||||||
is possible to put them in the readonly data section. This has the
|
this for the HP-UX SOM target as we can't switch sections in the
|
||||||
benefit of getting the table out of .text and reducing branch lengths
|
middle of a function.
|
||||||
as a result.
|
|
||||||
|
|
||||||
The downside is that an additional insn (addil) is needed to access
|
On ELF targets, it is possible to put them in the readonly-data section.
|
||||||
|
This would get the table out of .text and reduce branch lengths.
|
||||||
|
|
||||||
|
A downside is that an additional insn (addil) is needed to access
|
||||||
the table when generating PIC code. The address difference table
|
the table when generating PIC code. The address difference table
|
||||||
also has to use 32-bit pc-relative relocations. Currently, GAS does
|
also has to use 32-bit pc-relative relocations.
|
||||||
not support these relocations, although it is easily modified to do
|
|
||||||
this operation.
|
|
||||||
|
|
||||||
The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0"
|
The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0"
|
||||||
when using ELF GAS. A simple difference can be used when using
|
when using ELF GAS. A simple difference can be used when using
|
||||||
SOM GAS or the HP assembler. The final downside is GDB complains
|
the HP assembler.
|
||||||
about the nesting of the label for the table when debugging. */
|
|
||||||
|
The final downside is GDB complains about the nesting of the label
|
||||||
|
for the table. */
|
||||||
|
|
||||||
#define JUMP_TABLES_IN_TEXT_SECTION 1
|
#define JUMP_TABLES_IN_TEXT_SECTION 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,3 +67,12 @@ call_ ## FUNC (void) \
|
||||||
layout compatibility with the original linux thread implementation. */
|
layout compatibility with the original linux thread implementation. */
|
||||||
#undef MALLOC_ABI_ALIGNMENT
|
#undef MALLOC_ABI_ALIGNMENT
|
||||||
#define MALLOC_ABI_ALIGNMENT 128
|
#define MALLOC_ABI_ALIGNMENT 128
|
||||||
|
|
||||||
|
/* Place jump tables in the text section except when generating non-PIC
|
||||||
|
code. When generating non-PIC code, the relocations needed to load the
|
||||||
|
address of the jump table result in a text label in the final executable
|
||||||
|
if the jump table is placed in the text section. This breaks the unwind
|
||||||
|
data for the function. Thus, the jump table needs to be placed in
|
||||||
|
rodata when generating non-PIC code. */
|
||||||
|
#undef JUMP_TABLES_IN_TEXT_SECTION
|
||||||
|
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue