diff options
Diffstat (limited to 'gas/config/tc-tilepro.c')
-rw-r--r-- | gas/config/tc-tilepro.c | 121 |
1 files changed, 110 insertions, 11 deletions
diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c index 581028d..0b378c2 100644 --- a/gas/config/tc-tilepro.c +++ b/gas/config/tc-tilepro.c @@ -103,14 +103,14 @@ md_show_usage (FILE *stream) /* Extra expression types. */ -#define O_lo16 O_md1 -#define O_hi16 O_md2 -#define O_ha16 O_md3 -#define O_got O_md4 +#define O_lo16 O_md1 +#define O_hi16 O_md2 +#define O_ha16 O_md3 +#define O_got O_md4 #define O_got_lo16 O_md5 #define O_got_hi16 O_md6 #define O_got_ha16 O_md7 -#define O_plt O_md8 +#define O_plt O_md8 #define O_tls_gd O_md9 #define O_tls_gd_lo16 O_md10 #define O_tls_gd_hi16 O_md11 @@ -119,6 +119,13 @@ md_show_usage (FILE *stream) #define O_tls_ie_lo16 O_md14 #define O_tls_ie_hi16 O_md15 #define O_tls_ie_ha16 O_md16 +#define O_tls_le O_md17 +#define O_tls_le_lo16 O_md18 +#define O_tls_le_hi16 O_md19 +#define O_tls_le_ha16 O_md20 +#define O_tls_gd_call O_md21 +#define O_tls_gd_add O_md22 +#define O_tls_ie_load O_md23 static struct hash_control *special_operator_hash; @@ -230,6 +237,13 @@ md_begin (void) INSERT_SPECIAL_OP(tls_ie_lo16); INSERT_SPECIAL_OP(tls_ie_hi16); INSERT_SPECIAL_OP(tls_ie_ha16); + INSERT_SPECIAL_OP(tls_le); + INSERT_SPECIAL_OP(tls_le_lo16); + INSERT_SPECIAL_OP(tls_le_hi16); + INSERT_SPECIAL_OP(tls_le_ha16); + INSERT_SPECIAL_OP(tls_gd_call); + INSERT_SPECIAL_OP(tls_gd_add); + INSERT_SPECIAL_OP(tls_ie_load); #undef INSERT_SPECIAL_OP /* Initialize op_hash hash table. */ @@ -516,6 +530,26 @@ emit_tilepro_instruction (tilepro_bundle_bits bits, require_symbol = 1; break; + case O_tls_le: + HANDLE_OP16 (TLS_LE); + require_symbol = 1; + break; + + case O_tls_le_lo16: + HANDLE_OP16 (TLS_LE_LO); + require_symbol = 1; + break; + + case O_tls_le_hi16: + HANDLE_OP16 (TLS_LE_HI); + require_symbol = 1; + break; + + case O_tls_le_ha16: + HANDLE_OP16 (TLS_LE_HA); + require_symbol = 1; + break; + #undef HANDLE_OP16 case O_plt: @@ -532,6 +566,57 @@ emit_tilepro_instruction (tilepro_bundle_bits bits, require_symbol = 1; break; + case O_tls_gd_call: + switch (reloc) + { + case BFD_RELOC_TILEPRO_JOFFLONG_X1: + reloc = BFD_RELOC_TILEPRO_TLS_GD_CALL; + break; + default: + die = 1; + break; + } + use_subexp = 1; + require_symbol = 1; + break; + + case O_tls_gd_add: + switch (reloc) + { + case BFD_RELOC_TILEPRO_IMM8_X0: + reloc = BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD; + break; + case BFD_RELOC_TILEPRO_IMM8_X1: + reloc = BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD; + break; + case BFD_RELOC_TILEPRO_IMM8_Y0: + reloc = BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD; + break; + case BFD_RELOC_TILEPRO_IMM8_Y1: + reloc = BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD; + break; + default: + die = 1; + break; + } + use_subexp = 1; + require_symbol = 1; + break; + + case O_tls_ie_load: + switch (reloc) + { + case BFD_RELOC_TILEPRO_IMM8_X1: + reloc = BFD_RELOC_TILEPRO_TLS_IE_LOAD; + break; + default: + die = 1; + break; + } + use_subexp = 1; + require_symbol = 1; + break; + default: /* Do nothing. */ break; @@ -1298,22 +1383,36 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) #ifdef OBJ_ELF switch (fixP->fx_r_type) { + case BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD: + case BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD: + case BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD: + case BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD: case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD: case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD: - case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE: - case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE: case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO: case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO: - case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO: - case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO: case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI: case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI: - case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI: - case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI: case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA: case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI: case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA: case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI: + case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA: + case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA: + case BFD_RELOC_TILEPRO_TLS_GD_CALL: + case BFD_RELOC_TILEPRO_TLS_IE_LOAD: case BFD_RELOC_TILEPRO_TLS_DTPMOD32: case BFD_RELOC_TILEPRO_TLS_DTPOFF32: case BFD_RELOC_TILEPRO_TLS_TPOFF32: |