Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter Lee <walt@tilera.com>2012-02-26 02:24:21 +0400
committerWalter Lee <walt@tilera.com>2012-02-26 02:24:21 +0400
commit3a90360cf0abf04e43eaea2f502e02353ea88ac7 (patch)
treecbd751d90319fa3cc84d8275543777de3f4c3772 /include/elf/tilegx.h
parent704bb69dcbb895d2440754a108108d6a441b235c (diff)
Improve TLS support on TILE-Gx/TILEPro:
- Add support for TLS LE references. - Support linker optimization of TLS references. - Delete relocations of GOT/tp relative offsets beyond 32-bits. This brings binutils in line with the support expected in gcc 4.7, for TILE-Gx/TILEPro. bfd/ * reloc.c: Add BFD_RELOC_TILEPRO_TLS_GD_CALL, BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD, BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD, BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD, BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD, BFD_RELOC_TILEPRO_TLS_IE_LOAD, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE, BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO, BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI, BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA, BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE, BFD_RELOC_TILEGX_TLS_GD_CALL, BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD, BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD, BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD, BFD_RELOC_TILEGX_TLS_IE_LOAD, BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD. Delete BFD_RELOC_TILEGX_IMM16_X0_HW1_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW2_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW2_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW3_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW3_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_IE. * elf32-tilepro.c (tilepro_elf_howto_table): Update tilepro relocations. (tilepro_reloc_map): Ditto. (tilepro_info_to_howto_rela): Ditto. (reloc_to_create_func): Ditto. (tilepro_tls_translate_to_le): New. (tilepro_tls_translate_to_ie): New. (tilepro_elf_tls_transition): New. (tilepro_elf_check_relocs): Handle new tls relocations. (tilepro_elf_gc_sweep_hook): Ditto. (allocate_dynrelocs): Ditto. (tilepro_elf_relocate_section): Ditto. (tilepro_replace_insn): New. (insn_mask_X1): New. (insn_mask_X0_no_dest_no_srca): New (insn_mask_X1_no_dest_no_srca): New (insn_mask_Y0_no_dest_no_srca): New (insn_mask_Y1_no_dest_no_srca): New (srca_mask_X0): New (srca_mask_X1): New (insn_tls_le_move_X1): New (insn_tls_le_move_zero_X0X1): New (insn_tls_ie_lw_X1): New (insn_tls_ie_add_X0X1): New (insn_tls_ie_add_Y0Y1): New (insn_tls_gd_add_X0X1): New (insn_tls_gd_add_Y0Y1): New * elfxx-tilegx.c (tilegx_elf_howto_table): Update tilegx relocations. (tilegx_reloc_map): Ditto. (tilegx_info_to_howto_rela): Ditto. (reloc_to_create_func): Ditto. (tilegx_elf_link_hash_table): New field disable_le_transition. (tilegx_tls_translate_to_le): New. (tilegx_tls_translate_to_ie): New. (tilegx_elf_tls_transition): New. (tilegx_elf_check_relocs): Handle new tls relocations. (tilegx_elf_gc_sweep_hook): Ditto. (allocate_dynrelocs): Ditto. (tilegx_elf_relocate_section): Ditto. (tilegx_copy_bits): New. (tilegx_replace_insn): New. (insn_mask_X1): New. (insn_mask_X0_no_dest_no_srca): New. (insn_mask_X1_no_dest_no_srca): New. (insn_mask_Y0_no_dest_no_srca): New. (insn_mask_Y1_no_dest_no_srca): New. (insn_mask_X0_no_operand): New. (insn_mask_X1_no_operand): New. (insn_mask_Y0_no_operand): New. (insn_mask_Y1_no_operand): New. (insn_tls_ie_ld_X1): New. (insn_tls_ie_ld4s_X1): New. (insn_tls_ie_add_X0X1): New. (insn_tls_ie_add_Y0Y1): New. (insn_tls_ie_addx_X0X1): New. (insn_tls_ie_addx_Y0Y1): New. (insn_tls_gd_add_X0X1): New. (insn_tls_gd_add_Y0Y1): New. (insn_move_X0X1): New. (insn_move_Y0Y1): New. (insn_add_X0X1): New. (insn_add_Y0Y1): New. (insn_addx_X0X1): New. (insn_addx_Y0Y1): New. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. gas/ * tc-tilepro.c (O_tls_le): Define operator. (O_tls_le_lo16): Ditto. (O_tls_le_hi16): Ditto. (O_tls_le_ha16): Ditto. (O_tls_gd_call): Ditto. (O_tls_gd_add): Ditto. (O_tls_ie_load): Ditto. (md_begin): Delete old operators; handle new operators. (emit_tilepro_instruction): Ditto. (md_apply_fix): Ditto. * tc-tilegx.c (O_hw1_got): Delete operator. (O_hw2_got): Ditto. (O_hw3_got): Ditto. (O_hw2_last_got): Ditto. (O_hw1_tls_gd): Ditto. (O_hw2_tls_gd): Ditto. (O_hw3_tls_gd): Ditto. (O_hw2_last_tls_gd): Ditto. (O_hw1_tls_ie): Ditto. (O_hw2_tls_ie): Ditto. (O_hw3_tls_ie): Ditto. (O_hw2_last_tls_ie): Ditto. (O_hw0_tls_le): Define operator. (O_hw0_last_tls_le): Ditto. (O_hw1_last_tls_le): Ditto. (O_tls_gd_call): Ditto. (O_tls_gd_add): Ditto. (O_tls_ie_load): Ditto. (O_tls_add): Ditto. (md_begin): Delete old operators; handle new operators. (emit_tilegx_instruction): Ditto. (md_apply_fix): Ditto. * doc/c-tilegx.texi: Delete old operators; document new operators. * doc/c-tilepro.texi: Ditto. include/elf/ * tilegx.h (R_TILEGX_IMM16_X0_HW1_GOT): Delete. (R_TILEGX_IMM16_X1_HW1_GOT): Ditto. (R_TILEGX_IMM16_X0_HW2_GOT): Ditto. (R_TILEGX_IMM16_X1_HW2_GOT): Ditto. (R_TILEGX_IMM16_X0_HW3_GOT): Ditto. (R_TILEGX_IMM16_X1_HW3_GOT): Ditto. (R_TILEGX_IMM16_X0_HW2_LAST_GOT): Ditto. (R_TILEGX_IMM16_X1_HW2_LAST_GOT): Ditto. (R_TILEGX_IMM16_X0_HW1_TLS_GD): Ditto. (R_TILEGX_IMM16_X1_HW1_TLS_GD): Ditto. (R_TILEGX_IMM16_X0_HW2_TLS_GD): Ditto. (R_TILEGX_IMM16_X1_HW2_TLS_GD): Ditto. (R_TILEGX_IMM16_X0_HW3_TLS_GD): Ditto. (R_TILEGX_IMM16_X1_HW3_TLS_GD): Ditto. (R_TILEGX_IMM16_X0_HW2_LAST_TLS_GD): Ditto. (R_TILEGX_IMM16_X1_HW2_LAST_TLS_GD): Ditto. (R_TILEGX_IMM16_X0_HW1_TLS_IE): Ditto. (R_TILEGX_IMM16_X1_HW1_TLS_IE): Ditto. (R_TILEGX_IMM16_X0_HW2_TLS_IE): Ditto. (R_TILEGX_IMM16_X1_HW2_TLS_IE): Ditto. (R_TILEGX_IMM16_X0_HW3_TLS_IE): Ditto. (R_TILEGX_IMM16_X1_HW3_TLS_IE): Ditto. (R_TILEGX_IMM16_X0_HW2_LAST_TLS_IE): Ditto. (R_TILEGX_IMM16_X1_HW2_LAST_TLS_IE): Ditto. (R_TILEGX_IMM16_X0_HW0_TLS_LE): New relocation. (R_TILEGX_IMM16_X1_HW0_TLS_LE): Ditto. (R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE): Ditto. (R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE): Ditto. (R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE): Ditto. (R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE): Ditto. (R_TILEGX_TLS_GD_CALL): Ditto. (R_TILEGX_IMM8_X0_TLS_GD_ADD): Ditto. (R_TILEGX_IMM8_X1_TLS_GD_ADD): Ditto. (R_TILEGX_IMM8_Y0_TLS_GD_ADD): Ditto. (R_TILEGX_IMM8_Y1_TLS_GD_ADD): Ditto. (R_TILEGX_TLS_IE_LOAD): Ditto. (R_TILEGX_IMM8_X0_TLS_ADD): Ditto. (R_TILEGX_IMM8_X1_TLS_ADD): Ditto. (R_TILEGX_IMM8_Y0_TLS_ADD): Ditto. (R_TILEGX_IMM8_Y1_TLS_ADD): Ditto. * tilepro.h (R_TILEPRO_TLS_GD_CALL): New relocation. (R_TILEPRO_IMM8_X0_TLS_GD_ADD): Ditto. (R_TILEPRO_IMM8_X1_TLS_GD_ADD): Ditto. (R_TILEPRO_IMM8_Y0_TLS_GD_ADD): Ditto. (R_TILEPRO_IMM8_Y1_TLS_GD_ADD): Ditto. (R_TILEPRO_TLS_IE_LOAD): Ditto. (R_TILEPRO_IMM16_X0_TLS_LE): Ditto. (R_TILEPRO_IMM16_X1_TLS_LE): Ditto. (R_TILEPRO_IMM16_X0_TLS_LE_LO): Ditto. (R_TILEPRO_IMM16_X1_TLS_LE_LO): Ditto. (R_TILEPRO_IMM16_X0_TLS_LE_HI): Ditto. (R_TILEPRO_IMM16_X1_TLS_LE_HI): Ditto. (R_TILEPRO_IMM16_X0_TLS_LE_HA): Ditto. (R_TILEPRO_IMM16_X1_TLS_LE_HA): Ditto. include/opcode/ * tilegx.h (tilegx_mnemonic): Add TILEGX_OPC_LD4S_TLS, TILEGX_OPC_LD_TLS. * tilepro.h (tilepro_mnemonic): Add TILEPRO_OPC_LW_TLS, TILEPRO_OPC_LW_TLS_SN. opcodes/ * tilegx-opc.c: Handle TILEGX_OPC_LD4S_TLS and TILEGX_OPC_LD_TLS. * tilepro-opc.c: Handle TILEPRO_OPC_LW_TLS and TILEPRO_OPC_LW_TLS_SN.
Diffstat (limited to 'include/elf/tilegx.h')
-rw-r--r--include/elf/tilegx.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/include/elf/tilegx.h b/include/elf/tilegx.h
index d276f2e5f..004ce28ca 100644
--- a/include/elf/tilegx.h
+++ b/include/elf/tilegx.h
@@ -104,48 +104,37 @@ START_RELOC_NUMBERS (elf_tilegx_reloc_type)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_GOT, 64)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_GOT, 65)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_GOT, 66)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_GOT, 67)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_GOT, 68)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_GOT, 69)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW3_GOT, 70)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW3_GOT, 71)
+ /* Relocs 66-71 are currently not defined. */
+
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_GOT, 72)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_GOT, 73)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_LAST_GOT, 74)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_LAST_GOT, 75)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_LAST_GOT, 76)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_LAST_GOT, 77)
+ /* Relocs 76-77 are currently not defined. */
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_TLS_GD, 78)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_TLS_GD, 79)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_TLS_GD, 80)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_TLS_GD, 81)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_TLS_GD, 82)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_TLS_GD, 83)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW3_TLS_GD, 84)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW3_TLS_GD, 85)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_TLS_LE, 80)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_TLS_LE, 81)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE, 82)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE, 83)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE, 84)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE, 85)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD, 86)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD, 87)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD, 88)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, 89)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_LAST_TLS_GD, 90)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_LAST_TLS_GD, 91)
+ /* Relocs 90-91 are currently not defined. */
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_TLS_IE, 92)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_TLS_IE, 93)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_TLS_IE, 94)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_TLS_IE, 95)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_TLS_IE, 96)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_TLS_IE, 97)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW3_TLS_IE, 98)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW3_TLS_IE, 99)
+ /* Relocs 94-99 are currently not defined. */
+
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, 100)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, 101)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, 102)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE, 103)
- RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_LAST_TLS_IE, 104)
- RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_LAST_TLS_IE, 105)
+ /* Relocs 104-105 are currently not defined. */
RELOC_NUMBER (R_TILEGX_TLS_DTPMOD64, 106)
RELOC_NUMBER (R_TILEGX_TLS_DTPOFF64, 107)
@@ -154,6 +143,17 @@ START_RELOC_NUMBERS (elf_tilegx_reloc_type)
RELOC_NUMBER (R_TILEGX_TLS_DTPOFF32, 110)
RELOC_NUMBER (R_TILEGX_TLS_TPOFF32, 111)
+ RELOC_NUMBER (R_TILEGX_TLS_GD_CALL, 112)
+ RELOC_NUMBER (R_TILEGX_IMM8_X0_TLS_GD_ADD, 113)
+ RELOC_NUMBER (R_TILEGX_IMM8_X1_TLS_GD_ADD, 114)
+ RELOC_NUMBER (R_TILEGX_IMM8_Y0_TLS_GD_ADD, 115)
+ RELOC_NUMBER (R_TILEGX_IMM8_Y1_TLS_GD_ADD, 116)
+ RELOC_NUMBER (R_TILEGX_TLS_IE_LOAD, 117)
+ RELOC_NUMBER (R_TILEGX_IMM8_X0_TLS_ADD, 118)
+ RELOC_NUMBER (R_TILEGX_IMM8_X1_TLS_ADD, 119)
+ RELOC_NUMBER (R_TILEGX_IMM8_Y0_TLS_ADD, 120)
+ RELOC_NUMBER (R_TILEGX_IMM8_Y1_TLS_ADD, 121)
+
/* These are GNU extensions to enable C++ vtable garbage collection. */
RELOC_NUMBER (R_TILEGX_GNU_VTINHERIT, 128)
RELOC_NUMBER (R_TILEGX_GNU_VTENTRY, 129)