summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog25
-rw-r--r--bfd/bfd-in2.h14
-rw-r--r--bfd/elfxx-tilegx.c117
-rw-r--r--bfd/libbfd.h14
-rw-r--r--bfd/reloc.c28
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/tc-tilegx.c53
-rw-r--r--gas/doc/c-tilegx.texi20
-rw-r--r--include/elf/ChangeLog17
-rw-r--r--include/elf/tilegx.h20
10 files changed, 286 insertions, 33 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 12bef8c0b5..0107ea132c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,28 @@
+2012-08-27 Walter Lee <walt@tilera.com>
+
+ * reloc.c (Add BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL): new relocations.
+ * elfxx-tilegx.c (tilegx_elf_howto_table): Handle new relocations.
+ (tilegx_reloc_map): Ditto.
+ (reloc_to_create_func): Ditto.
+ (tilegx_elf_check_relocs): Ditto.
+ (tilegx_elf_gc_sweep_hook): Ditto.
+ (tilegx_elf_relocate_section): Ditto.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+
2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* elf32-arm.c (v8): New array.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index e496083d6e..bc5ed0c11f 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5421,10 +5421,18 @@ giving a 16 bit signed byte offset. */
BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
+ BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
+ BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
@@ -5439,6 +5447,12 @@ giving a 16 bit signed byte offset. */
BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
+ BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index 6f748ece7f..1f5c4587da 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -490,21 +490,21 @@ static reloc_howto_type tilegx_elf_howto_table [] =
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X0_HW0_GOT, 0),
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X1_HW0_GOT, 0),
- /* These relocs are currently not defined. */
- EMPTY_HOWTO (66),
- EMPTY_HOWTO (67),
- EMPTY_HOWTO (68),
- EMPTY_HOWTO (69),
- EMPTY_HOWTO (70),
- EMPTY_HOWTO (71),
+
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X0_HW0_PLT_PCREL, 0),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X1_HW0_PLT_PCREL, 0),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X0_HW1_PLT_PCREL, 16),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X1_HW1_PLT_PCREL, 16),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X0_HW2_PLT_PCREL, 32),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X1_HW2_PLT_PCREL, 32),
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X0_HW0_LAST_GOT, 0),
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X1_HW0_LAST_GOT, 0),
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X0_HW1_LAST_GOT, 16),
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X1_HW1_LAST_GOT, 16),
- /* These relocs are currently not defined. */
- EMPTY_HOWTO (76),
- EMPTY_HOWTO (77),
+
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X0_HW3_PLT_PCREL, 48),
+ TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X1_HW3_PLT_PCREL, 48),
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X0_HW0_TLS_GD, 0),
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X1_HW0_TLS_GD, 0),
@@ -530,12 +530,13 @@ static reloc_howto_type tilegx_elf_howto_table [] =
TILEGX_IMM16_HOWTO_TLS_IE (R_TILEGX_IMM16_X0_HW0_TLS_IE, 0),
TILEGX_IMM16_HOWTO_TLS_IE (R_TILEGX_IMM16_X1_HW0_TLS_IE, 0),
- EMPTY_HOWTO (94),
- EMPTY_HOWTO (95),
- EMPTY_HOWTO (96),
- EMPTY_HOWTO (97),
- EMPTY_HOWTO (98),
- EMPTY_HOWTO (99),
+
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, 0),
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, 0),
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, 16),
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, 16),
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, 32),
+ TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, 32),
#define TILEGX_IMM16_HOWTO_LAST_TLS_IE(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
@@ -713,10 +714,18 @@ static const reloc_map tilegx_reloc_map [] =
SIMPLE_REMAP (TILEGX_IMM16_X1_HW2_LAST_PCREL)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_GOT)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_GOT)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW1_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW1_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW2_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW2_PLT_PCREL)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_LAST_GOT)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_LAST_GOT)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW1_LAST_GOT)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW1_LAST_GOT)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW3_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW3_PLT_PCREL)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_TLS_GD)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_TLS_GD)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_TLS_LE)
@@ -731,6 +740,12 @@ static const reloc_map tilegx_reloc_map [] =
SIMPLE_REMAP (TILEGX_IMM16_X1_HW1_LAST_TLS_GD)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_TLS_IE)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_TLS_IE)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL)
+ SIMPLE_REMAP (TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW0_LAST_TLS_IE)
SIMPLE_REMAP (TILEGX_IMM16_X1_HW0_LAST_TLS_IE)
SIMPLE_REMAP (TILEGX_IMM16_X0_HW1_LAST_TLS_IE)
@@ -1027,18 +1042,10 @@ static const tilegx_create_func reloc_to_create_func[] =
create_Imm16_X1,
create_Imm16_X0,
create_Imm16_X1,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
create_Imm16_X0,
create_Imm16_X1,
create_Imm16_X0,
create_Imm16_X1,
- NULL,
- NULL,
create_Imm16_X0,
create_Imm16_X1,
create_Imm16_X0,
@@ -1051,16 +1058,24 @@ static const tilegx_create_func reloc_to_create_func[] =
create_Imm16_X1,
create_Imm16_X0,
create_Imm16_X1,
- NULL,
- NULL,
+ create_Imm16_X0,
+ create_Imm16_X1,
+ create_Imm16_X0,
+ create_Imm16_X1,
+ create_Imm16_X0,
+ create_Imm16_X1,
create_Imm16_X0,
create_Imm16_X1,
NULL,
NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ create_Imm16_X0,
+ create_Imm16_X1,
+ create_Imm16_X0,
+ create_Imm16_X1,
+ create_Imm16_X0,
+ create_Imm16_X1,
+ create_Imm16_X0,
+ create_Imm16_X1,
create_Imm16_X0,
create_Imm16_X1,
create_Imm16_X0,
@@ -1855,6 +1870,20 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Fall through */
case R_TILEGX_JUMPOFF_X1_PLT:
+ case R_TILEGX_IMM16_X0_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
because this might be a case of linking PIC code without
@@ -2248,6 +2277,20 @@ tilegx_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
/* Fall through. */
case R_TILEGX_JUMPOFF_X1_PLT:
+ case R_TILEGX_IMM16_X0_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL:
if (h != NULL)
{
if (h->plt.refcount > 0)
@@ -3440,6 +3483,20 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
break;
case R_TILEGX_JUMPOFF_X1_PLT:
+ case R_TILEGX_IMM16_X0_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW3_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL:
+ case R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
BFD_ASSERT (h != NULL);
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 88ff9c6685..2e9d70617a 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -2613,10 +2613,18 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT",
"BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT",
"BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT",
"BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT",
"BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD",
"BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE",
@@ -2631,6 +2639,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE",
"BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL",
+ "BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL",
"BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE",
"BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE",
"BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 47d052d134..dc01dd9ea0 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -6430,6 +6430,18 @@ ENUMX
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT
ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL
+ENUMX
BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT
@@ -6438,6 +6450,10 @@ ENUMX
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT
ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL
+ENUMX
BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD
@@ -6466,6 +6482,18 @@ ENUMX
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE
ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL
+ENUMX
+ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL
+ENUMX
BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE
ENUMX
BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2e8b2ace6f..88e911050f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,14 @@
+2012-08-27 Walter Lee <walt@tilera.com>
+
+ * tc-tilegx.c (O_hw0_plt): Define operator.
+ (O_hw1_plt): Ditto.
+ (O_hw1_last_plt): Ditto.
+ (O_hw2_last_plt): Ditto.
+ (md_begin): Handle new operators.
+ (emit_tilegx_instruction): Ditto.
+ (md_apply_fix): Ditto.
+ * doc/c-tilegx.texi: Document new operators.
+
2012-08-24 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* config/tc-arm.c (ARM_ENC_TAB): Add sha1h and sha2op entries.
diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index b2d94205be..19a04c279a 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -173,6 +173,10 @@ md_show_usage (FILE *stream)
#define O_tls_gd_add O_md22
#define O_tls_ie_load O_md23
#define O_tls_add O_md24
+#define O_hw0_plt O_md25
+#define O_hw1_plt O_md26
+#define O_hw1_last_plt O_md27
+#define O_hw2_last_plt O_md28
static struct hash_control *special_operator_hash;
@@ -300,6 +304,10 @@ md_begin (void)
INSERT_SPECIAL_OP (tls_gd_add);
INSERT_SPECIAL_OP (tls_ie_load);
INSERT_SPECIAL_OP (tls_add);
+ INSERT_SPECIAL_OP (hw0_plt);
+ INSERT_SPECIAL_OP (hw1_plt);
+ INSERT_SPECIAL_OP (hw1_last_plt);
+ INSERT_SPECIAL_OP (hw2_last_plt);
#undef INSERT_SPECIAL_OP
/* Initialize op_hash hash table. */
@@ -611,6 +619,22 @@ emit_tilegx_instruction (tilegx_bundle_bits bits,
require_symbol = 1;
break;
+ case O_hw0_plt:
+ HANDLE_OP16 (HW0_PLT_PCREL);
+ break;
+
+ case O_hw1_plt:
+ HANDLE_OP16 (HW1_PLT_PCREL);
+ break;
+
+ case O_hw1_last_plt:
+ HANDLE_OP16 (HW1_LAST_PLT_PCREL);
+ break;
+
+ case O_hw2_last_plt:
+ HANDLE_OP16 (HW2_LAST_PLT_PCREL);
+ break;
+
#undef HANDLE_OP16
case O_plt:
@@ -1475,6 +1499,13 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
fixP->fx_r_type = rtype; \
break
+#define FIX_PLT_PCREL(rtype) \
+ case rtype##_PLT_PCREL: \
+ if (!fixP->fx_pcrel) \
+ fixP->fx_r_type = rtype; \
+ \
+ break;
+
FIX_PCREL (BFD_RELOC_8);
FIX_PCREL (BFD_RELOC_16);
FIX_PCREL (BFD_RELOC_32);
@@ -1493,6 +1524,14 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
FIX_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST);
FIX_PCREL (BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST);
FIX_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X0_HW0);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW0);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X0_HW1);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW1);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST);
+ FIX_PLT_PCREL (BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST);
#undef FIX_PCREL
@@ -1560,6 +1599,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW0:
case BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL:
special = O_hw0;
break;
@@ -1568,6 +1609,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST:
case BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL:
special = O_hw0_last;
break;
@@ -1576,6 +1619,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW1:
case BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL:
special = O_hw1;
break;
@@ -1584,6 +1629,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST:
case BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL:
special = O_hw1_last;
break;
@@ -1592,6 +1639,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW2:
case BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL:
special = O_hw2;
break;
@@ -1600,6 +1649,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST:
case BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL:
special = O_hw2_last;
break;
@@ -1608,6 +1659,8 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED)
case BFD_RELOC_TILEGX_IMM16_X1_HW3:
case BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL:
case BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL:
+ case BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL:
special = O_hw3;
break;
diff --git a/gas/doc/c-tilegx.texi b/gas/doc/c-tilegx.texi
index 268cc4f7a5..0d8c038bf1 100644
--- a/gas/doc/c-tilegx.texi
+++ b/gas/doc/c-tilegx.texi
@@ -242,6 +242,26 @@ called (at latest; depending environment variables). It is only safe
to leave the symbol unresolved this way if all references are function
calls.
+@item hw0_plt
+
+This modifier is used to load bits 0-15 of the pc-relative address of
+a plt entry.
+
+@item hw1_plt
+
+This modifier is used to load bits 16-31 of the pc-relative address of
+a plt entry.
+
+@item hw1_last_plt
+
+This modifier yields the same value as @code{hw1_plt}, but it also
+checks that the value does not overflow.
+
+@item hw2_last_plt
+
+This modifier is used to load bits 32-47 of the pc-relative address of
+a plt entry, and it also checks that the value does not overflow.
+
@item hw0_tls_gd
This modifier is used to load bits 0-15 of the offset of the GOT entry
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 362dc452b5..ece126a62f 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,20 @@
+2012-08-27 Walter Lee <walt@tilera.com>
+
+ * tilegx.h (R_TILEGX_IMM16_X0_HW0_PLT_PCREL): New relocation.
+ (R_TILEGX_IMM16_X1_HW0_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW1_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X1_HW1_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW2_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X1_HW2_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW3_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X1_HW3_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL): Ditto.
+ (R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL ): Ditto.
+ (R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL): Ditto.
+
2012-08-13 Ian Bolton <ian.bolton@arm.com>
Laurent Desnogues <laurent.desnogues@arm.com>
Jim MacArthur <jim.macarthur@arm.com>
diff --git a/include/elf/tilegx.h b/include/elf/tilegx.h
index 004ce28caa..e838b8097d 100644
--- a/include/elf/tilegx.h
+++ b/include/elf/tilegx.h
@@ -104,13 +104,21 @@ 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)
- /* Relocs 66-71 are currently not defined. */
+
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_PLT_PCREL, 66)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_PLT_PCREL, 67)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_PLT_PCREL, 68)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_PLT_PCREL, 69)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_PLT_PCREL, 70)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_PLT_PCREL, 71)
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)
- /* Relocs 76-77 are currently not defined. */
+
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW3_PLT_PCREL, 76)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW3_PLT_PCREL, 77)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_TLS_GD, 78)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_TLS_GD, 79)
@@ -128,7 +136,13 @@ START_RELOC_NUMBERS (elf_tilegx_reloc_type)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_TLS_IE, 92)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_TLS_IE, 93)
- /* Relocs 94-99 are currently not defined. */
+
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, 94)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, 95)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, 96)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, 97)
+ RELOC_NUMBER (R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, 98)
+ RELOC_NUMBER (R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, 99)
RELOC_NUMBER (R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, 100)
RELOC_NUMBER (R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, 101)