* ld-tic6x/pcr-reloc.d: New test.
* ld-tic6x/pcr-reloc.s: New test.
gas/testsuite/
* gas/tic6x/pcr-relocs.d: New test.
* gas/tic6x/pcr-relocs.s: New test.
* gas/tic6x/pcr-relocs-undef.d: New test.
* gas/tic6x/pcr-relocs-undef.s: New test.
* gas/tic6x/reloc-bad-2.s: Update for pcr_offset.
* gas/tic6x/reloc-bad-2.l: Update for pcr_offset.
bfd/
* elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
R_C6000_PCR_H16 and R_C6000_PCR_L16.
(elf32_tic6x_relocate_section): Handle them.
gas/
* config/tc-tic6x.c (tic6x_operators): Add "pcr_offset".
(tic6x_parse_name): Handle it.
(tic6x_fix_new_exp): Handle O_pcr_offset.
(tic6x_fix_adjustable): Return 0 for the new relocs.
(md_apply_fix): Handle them.
(tc_gen_reloc): Likewise.
* config/tc-tic6x.h (tic6x_fix_info): Add a fix_subsy member.
+2011-05-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
+ R_C6000_PCR_H16 and R_C6000_PCR_L16.
+ (elf32_tic6x_relocate_section): Handle them.
+
2011-05-18 Nick Clifton <nickc@redhat.com>
PR ld/12761
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
- EMPTY_HOWTO (29),
- EMPTY_HOWTO (30),
+ HOWTO (R_C6000_PCR_H16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_C6000_PCR_H16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x007fff80, /* dst_mask */
+ TRUE), /* pcrel_offset */
+ HOWTO (R_C6000_PCR_L16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_C6000_PCR_L16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x007fff80, /* dst_mask */
+ TRUE), /* pcrel_offset */
EMPTY_HOWTO (31),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
- EMPTY_HOWTO (29),
- EMPTY_HOWTO (30),
+ EMPTY_HOWTO (R_C6000_PCR_H16),
+ EMPTY_HOWTO (R_C6000_PCR_L16),
EMPTY_HOWTO (31),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
- bfd_vma off, relocation;
+ bfd_vma off, off2, relocation;
bfd_boolean unresolved_reloc;
bfd_reloc_status_type r;
struct bfd_link_hash_entry *sbh;
unresolved_reloc = FALSE;
break;
+ case R_C6000_PCR_H16:
+ case R_C6000_PCR_L16:
+ off = (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ /* These must be calculated as R = S - FP(FP(PC) - A).
+ PC, here, is the value we just computed in OFF. RELOCATION
+ has the address of S + A. */
+ relocation -= rel->r_addend;
+ off2 = ((off & ~(bfd_vma)0x1f) - rel->r_addend) & (bfd_vma)~0x1f;
+ off2 = relocation - off2;
+ relocation = off + off2;
+ break;
+
case R_C6000_DSBT_INDEX:
relocation = elf32_tic6x_hash_table (info)->params.dsbt_index;
if (!info->shared || relocation != 0)
+2011-05-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * config/tc-tic6x.c (tic6x_operators): Add "pcr_offset".
+ (tic6x_parse_name): Handle it.
+ (tic6x_fix_new_exp): Handle O_pcr_offset.
+ (tic6x_fix_adjustable): Return 0 for the new relocs.
+ (md_apply_fix): Handle them.
+ (tc_gen_reloc): Likewise.
+ * config/tc-tic6x.h (tic6x_fix_info): Add a fix_subsy member.
+
2011-05-18 Nick Clifton <nickc@redhat.com>
PR gas/12754
{ "dpr_hword", O_dpr_hword },
#define O_dpr_word O_md6
{ "dpr_word", O_dpr_word },
+#define O_pcr_offset O_md7
+ { "pcr_offset", O_pcr_offset }
};
/* Parse a name in some machine-specific way. Used on C6X to handle
const char *inner_name;
unsigned int i;
operatorT op = O_illegal;
- symbolS *sym;
+ symbolS *sym, *op_sym = NULL;
if (*name != '$')
return 0;
name_end = p;
skip_whitespace (p);
+ if (op == O_pcr_offset)
+ {
+ char *op_name_start, *op_name_end;
+
+ if (*p != ',')
+ {
+ *input_line_pointer = 0;
+ return 0;
+ }
+ p++;
+ skip_whitespace (p);
+
+ if (!is_name_beginner (*p))
+ {
+ *input_line_pointer = 0;
+ return 0;
+ }
+
+ op_name_start = p;
+ p++;
+ while (is_part_of_name (*p))
+ p++;
+ op_name_end = p;
+ skip_whitespace (p);
+
+ c = *op_name_end;
+ *op_name_end = 0;
+ op_sym = symbol_find_or_make (op_name_start);
+ *op_name_end = c;
+ }
+
if (*p != ')')
{
*input_line_pointer = 0;
exprP->X_op = op;
exprP->X_add_symbol = sym;
exprP->X_add_number = 0;
- exprP->X_op_symbol = NULL;
+ exprP->X_op_symbol = op_sym;
exprP->X_md = 0;
return 1;
bfd_boolean fix_adda)
{
bfd_reloc_code_real_type new_reloc = BFD_RELOC_UNUSED;
+ symbolS *subsy = NULL;
fixS *fix;
switch (exp->X_op)
}
break;
+ case O_pcr_offset:
+ subsy = exp->X_op_symbol;
+ switch (r_type)
+ {
+ case BFD_RELOC_C6000_ABS_S16:
+ case BFD_RELOC_C6000_ABS_L16:
+ new_reloc = BFD_RELOC_C6000_PCR_L16;
+ break;
+
+ case BFD_RELOC_C6000_ABS_H16:
+ new_reloc = BFD_RELOC_C6000_PCR_H16;
+ break;
+
+ default:
+ as_bad (_("$PCR_OFFSET not supported in this context"));
+ return;
+ }
+ break;
+
case O_symbol:
break;
else
fix = fix_new (frag, where, size, exp->X_add_symbol, exp->X_add_number,
pcrel, new_reloc);
+ fix->tc_fix_data.fix_subsy = subsy;
fix->tc_fix_data.fix_adda = fix_adda;
}
tic6x_init_fix_data (fixS *fixP)
{
fixP->tc_fix_data.fix_adda = FALSE;
+ fixP->tc_fix_data.fix_subsy = NULL;
}
/* Return true if the fix can be handled by GAS, false if it must
case BFD_RELOC_C6000_PREL31:
return 0;
+ case BFD_RELOC_C6000_PCR_H16:
+ case BFD_RELOC_C6000_PCR_L16:
+ return 0;
+
default:
return 1;
}
abort ();
break;
+ case BFD_RELOC_C6000_PCR_H16:
+ case BFD_RELOC_C6000_PCR_L16:
+ if (fixP->fx_done || !seg->use_rela_p)
+ {
+ offsetT newval = md_chars_to_number (buf, 4);
+ int shift = fixP->fx_r_type == BFD_RELOC_C6000_PCR_H16 ? 16 : 0;
+
+ MODIFY_VALUE (newval, value, shift, 7, 16);
+
+ md_number_to_chars (buf, newval, 4);
+ }
+ break;
+
case BFD_RELOC_C6000_SBR_U15_B:
if (fixP->fx_done || !seg->use_rela_p)
{
if (!bfd_is_com_section (symbol))
reloc->addend -= symbol->value;
}
-
+ if (r_type == BFD_RELOC_C6000_PCR_H16
+ || r_type == BFD_RELOC_C6000_PCR_L16)
+ {
+ symbolS *t = fixp->tc_fix_data.fix_subsy;
+ segT sub_symbol_segment;
+
+ resolve_symbol_value (t);
+ sub_symbol_segment = S_GET_SEGMENT (t);
+ if (sub_symbol_segment == undefined_section)
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ _("undefined symbol %s in PCR relocation"),
+ S_GET_NAME (t));
+ else
+ {
+ reloc->addend = reloc->address & ~0x1F;
+ reloc->addend -= S_GET_VALUE (t);
+ }
+ }
return reloc;
}
instruction, whereas a non-constant represents a DP-relative
value counting in the appropriate units). */
bfd_boolean fix_adda;
+ /* The symbol to be subtracted in case of a PCR_H16 or PCR_L16
+ reloc. */
+ symbolS *fix_subsy;
} tic6x_fix_info;
#define TC_FIX_TYPE tic6x_fix_info
#define TC_INIT_FIX_DATA(fixP) tic6x_init_fix_data (fixP)
+2011-05-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * gas/tic6x/pcr-relocs.d: New test.
+ * gas/tic6x/pcr-relocs.s: New test.
+ * gas/tic6x/pcr-relocs-undef.d: New test.
+ * gas/tic6x/pcr-relocs-undef.s: New test.
+ * gas/tic6x/reloc-bad-2.s: Update for pcr_offset.
+ * gas/tic6x/reloc-bad-2.l: Update for pcr_offset.
+
2011-05-18 Nick Clifton <nickc@redhat.com>
* gas/arm/req.l: Updated expected warning message.
--- /dev/null
+#name: C6X PCR relocs against undefined symbol
+#as:
+#source: pcr-relocs-undef.s
+#error: undefined symbol
--- /dev/null
+ .text
+ .align 5
+ mvk .s2 $PCR_OFFSET (S0,L1), b2
--- /dev/null
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: C6X PCR H16/L16 relocs
+#as: -mlittle-endian
+
+.*: *file format elf32-tic6x-le
+
+Disassembly of section \.text:
+0+00 <[^>]*> 00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+0+04 <[^>]*> 00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+0+08 <[^>]*> 00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+0+0c <[^>]*> 004003e2[ \t]+mvc \.S2 pce1,b0
+0+10 <[^>]*> 01000264[ \t]+ldw \.D1T1 \*\+a0\(0\),a2
+0+14 <[^>]*> 0100002a[ \t]+mvk \.S2 0,b2
+[ \t]+14: R_C6000_PCR_L16 S0\+0xfffffff4
+0+18 <[^>]*> 0100006a[ \t]+mvkh \.S2 0,b2
+[ \t]+18: R_C6000_PCR_H16 S0\+0xfffffff4
+0+1c <[^>]*> 0100002a[ \t]+mvk \.S2 0,b2
+[ \t]+1c: R_C6000_PCR_L16 S0\+0xffffffc8
+0+20 <[^>]*> 0100006a[ \t]+mvkh \.S2 0,b2
+[ \t]+20: R_C6000_PCR_H16 S0\+0xffffffe8
+0+24 <[^>]*> 0100002a[ \t]+mvk \.S2 0,b2
+[ \t]+24: R_C6000_PCR_L16 S1\+0x14
+0+28 <[^>]*> 0100006a[ \t]+mvkh \.S2 0,b2
+[ \t]+28: R_C6000_PCR_H16 S1\+0x14
+0+2c <[^>]*> 0100002a[ \t]+mvk \.S2 0,b2
+[ \t]+2c: R_C6000_PCR_L16 S1\+0xffffffe8
+0+30 <[^>]*> 0100006a[ \t]+mvkh \.S2 0,b2
+[ \t]+30: R_C6000_PCR_H16 S1\+0xffffffe8
+0+34 <[^>]*> 00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+0+38 <[^>]*> 004003e2[ \t]+mvc \.S2 pce1,b0
+0+3c <[^>]*> 00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
--- /dev/null
+ .text
+ .align 5
+L0:
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+L1:
+ MVC .s2 PCE1, b0
+ ldw .d1t1 *a0,a2
+ mvk .s2 $PCR_OFFSET (S0,L1), b2
+ mvkh .s2 $PCR_OFFSET (S0,L1), b2
+ mvk .s2 $PCR_OFFSET (S0,L2), b2
+ mvkh .s2 $PCR_OFFSET (S0,L2), b2
+ mvkl .s2 $PCR_OFFSET (S1,L1), b2
+ mvkh .s2 $PCR_OFFSET (S1,L1), b2
+ mvkl .s2 $PCR_OFFSET (S1,L2), b2
+ mvkh .s2 $PCR_OFFSET (S1,L2), b2
+
+S0:
+ ldw .d1t1 *a0,a1
+L2:
+ MVC .s2 PCE1, b0
+
+S1:
+ ldw .d1t1 *a0,a1
[^:]*:9: Error: \$DPR_BYTE not supported in this context
[^:]*:10: Error: \$DPR_HWORD not supported in this context
[^:]*:11: Error: \$DPR_WORD not supported in this context
-[^:]*:16: Error: \$DSBT_INDEX not supported in this context
-[^:]*:17: Error: \$GOT not supported in this context
-[^:]*:18: Error: \$DPR_GOT not supported in this context
-[^:]*:19: Error: \$DPR_BYTE not supported in this context
-[^:]*:20: Error: \$DPR_HWORD not supported in this context
-[^:]*:21: Error: \$DPR_WORD not supported in this context
-[^:]*:22: Error: \$DSBT_INDEX not supported in this context
-[^:]*:23: Error: \$GOT not supported in this context
-[^:]*:24: Error: \$DPR_GOT not supported in this context
-[^:]*:25: Error: \$DPR_BYTE not supported in this context
-[^:]*:26: Error: \$DPR_HWORD not supported in this context
-[^:]*:27: Error: \$DPR_WORD not supported in this context
-[^:]*:28: Error: \$DPR_GOT not supported in this context
-[^:]*:29: Error: \$DPR_BYTE not supported in this context
-[^:]*:30: Error: \$DPR_HWORD not supported in this context
-[^:]*:31: Error: \$DPR_WORD not supported in this context
-[^:]*:32: Error: \$DSBT_INDEX not supported in this context
-[^:]*:33: Error: \$GOT not supported in this context
-[^:]*:34: Error: \$DPR_GOT not supported in this context
-[^:]*:35: Error: \$DPR_HWORD not supported in this context
-[^:]*:36: Error: \$DPR_WORD not supported in this context
-[^:]*:37: Error: \$DSBT_INDEX not supported in this context
-[^:]*:38: Error: \$GOT not supported in this context
-[^:]*:39: Error: \$DPR_GOT not supported in this context
-[^:]*:40: Error: \$DPR_HWORD not supported in this context
-[^:]*:41: Error: \$DPR_WORD not supported in this context
+[^:]*:12: Error: \$PCR_OFFSET not supported in this context
+[^:]*:17: Error: \$DSBT_INDEX not supported in this context
+[^:]*:18: Error: \$GOT not supported in this context
+[^:]*:19: Error: \$DPR_GOT not supported in this context
+[^:]*:20: Error: \$DPR_BYTE not supported in this context
+[^:]*:21: Error: \$DPR_HWORD not supported in this context
+[^:]*:22: Error: \$DPR_WORD not supported in this context
+[^:]*:23: Error: \$PCR_OFFSET not supported in this context
+[^:]*:24: Error: \$DSBT_INDEX not supported in this context
+[^:]*:25: Error: \$GOT not supported in this context
+[^:]*:26: Error: \$DPR_GOT not supported in this context
+[^:]*:27: Error: \$DPR_BYTE not supported in this context
+[^:]*:28: Error: \$DPR_HWORD not supported in this context
+[^:]*:29: Error: \$DPR_WORD not supported in this context
+[^:]*:30: Error: \$PCR_OFFSET not supported in this context
+[^:]*:31: Error: \$DPR_GOT not supported in this context
+[^:]*:32: Error: \$DPR_BYTE not supported in this context
+[^:]*:33: Error: \$DPR_HWORD not supported in this context
+[^:]*:34: Error: \$DPR_WORD not supported in this context
+[^:]*:35: Error: \$PCR_OFFSET not supported in this context
+[^:]*:36: Error: \$DSBT_INDEX not supported in this context
+[^:]*:37: Error: \$GOT not supported in this context
+[^:]*:38: Error: \$DPR_GOT not supported in this context
+[^:]*:39: Error: \$DPR_HWORD not supported in this context
+[^:]*:40: Error: \$DPR_WORD not supported in this context
[^:]*:42: Error: \$DSBT_INDEX not supported in this context
[^:]*:43: Error: \$GOT not supported in this context
-[^:]*:44: Error: \$DSBT_INDEX not supported in this context
-[^:]*:45: Error: \$GOT not supported in this context
-[^:]*:46: Error: \$DSBT_INDEX not supported in this context
-[^:]*:47: Error: \$GOT not supported in this context
-[^:]*:48: Error: \$DSBT_INDEX not supported in this context
-[^:]*:49: Error: \$GOT not supported in this context
-[^:]*:50: Error: \$DPR_GOT not supported in this context
-[^:]*:51: Error: \$DPR_BYTE not supported in this context
-[^:]*:52: Error: \$DPR_HWORD not supported in this context
-[^:]*:53: Error: \$DPR_WORD not supported in this context
-[^:]*:54: Error: \$DSBT_INDEX not supported in this context
-[^:]*:55: Error: \$GOT not supported in this context
-[^:]*:56: Error: \$DPR_GOT not supported in this context
-[^:]*:57: Error: \$DPR_BYTE not supported in this context
-[^:]*:58: Error: \$DPR_HWORD not supported in this context
-[^:]*:59: Error: \$DPR_WORD not supported in this context
+[^:]*:44: Error: \$DPR_GOT not supported in this context
+[^:]*:45: Error: \$DPR_HWORD not supported in this context
+[^:]*:46: Error: \$DPR_WORD not supported in this context
+[^:]*:47: Error: \$DSBT_INDEX not supported in this context
+[^:]*:48: Error: \$GOT not supported in this context
+[^:]*:49: Error: \$DSBT_INDEX not supported in this context
+[^:]*:50: Error: \$GOT not supported in this context
+[^:]*:51: Error: \$DSBT_INDEX not supported in this context
+[^:]*:52: Error: \$GOT not supported in this context
+[^:]*:53: Error: \$DSBT_INDEX not supported in this context
+[^:]*:54: Error: \$GOT not supported in this context
+[^:]*:55: Error: \$DPR_GOT not supported in this context
+[^:]*:56: Error: \$DPR_BYTE not supported in this context
+[^:]*:57: Error: \$DPR_HWORD not supported in this context
+[^:]*:58: Error: \$DPR_WORD not supported in this context
+[^:]*:59: Error: \$PCR_OFFSET not supported in this context
[^:]*:60: Error: \$DSBT_INDEX not supported in this context
[^:]*:61: Error: \$GOT not supported in this context
[^:]*:62: Error: \$DPR_GOT not supported in this context
[^:]*:63: Error: \$DPR_BYTE not supported in this context
[^:]*:64: Error: \$DPR_HWORD not supported in this context
[^:]*:65: Error: \$DPR_WORD not supported in this context
-[^:]*:66: Error: \$DSBT_INDEX not supported in this context
-[^:]*:67: Error: \$GOT not supported in this context
-[^:]*:68: Error: \$DPR_GOT not supported in this context
-[^:]*:69: Error: \$DPR_BYTE not supported in this context
-[^:]*:70: Error: \$DPR_HWORD not supported in this context
-[^:]*:71: Error: \$DPR_WORD not supported in this context
-[^:]*:72: Error: \$DSBT_INDEX not supported in this context
-[^:]*:73: Error: \$GOT not supported in this context
-[^:]*:74: Error: \$DPR_GOT not supported in this context
-[^:]*:75: Error: \$DPR_BYTE not supported in this context
-[^:]*:76: Error: \$DPR_HWORD not supported in this context
-[^:]*:77: Error: \$DPR_WORD not supported in this context
-[^:]*:78: Error: \$DSBT_INDEX not supported in this context
-[^:]*:79: Error: \$GOT not supported in this context
-[^:]*:80: Error: \$DPR_GOT not supported in this context
-[^:]*:81: Error: \$DPR_BYTE not supported in this context
-[^:]*:82: Error: \$DPR_HWORD not supported in this context
-[^:]*:83: Error: \$DPR_WORD not supported in this context
-[^:]*:84: Error: \$DSBT_INDEX not supported in this context
-[^:]*:85: Error: \$GOT not supported in this context
-[^:]*:86: Error: \$DPR_GOT not supported in this context
-[^:]*:87: Error: \$DPR_BYTE not supported in this context
-[^:]*:88: Error: \$DPR_HWORD not supported in this context
-[^:]*:89: Error: \$DPR_WORD not supported in this context
-[^:]*:90: Error: \$DSBT_INDEX not supported in this context
-[^:]*:91: Error: \$GOT not supported in this context
-[^:]*:92: Error: \$DPR_GOT not supported in this context
-[^:]*:93: Error: \$DPR_BYTE not supported in this context
-[^:]*:94: Error: \$DPR_HWORD not supported in this context
-[^:]*:95: Error: \$DPR_WORD not supported in this context
-[^:]*:96: Error: \$DSBT_INDEX not supported in this context
-[^:]*:97: Error: \$GOT not supported in this context
-[^:]*:98: Error: \$DPR_GOT not supported in this context
-[^:]*:99: Error: \$DPR_BYTE not supported in this context
-[^:]*:100: Error: \$DPR_HWORD not supported in this context
-[^:]*:101: Error: \$DPR_WORD not supported in this context
+[^:]*:66: Error: \$PCR_OFFSET not supported in this context
+[^:]*:67: Error: \$DSBT_INDEX not supported in this context
+[^:]*:68: Error: \$GOT not supported in this context
+[^:]*:69: Error: \$DPR_GOT not supported in this context
+[^:]*:70: Error: \$DPR_BYTE not supported in this context
+[^:]*:71: Error: \$DPR_HWORD not supported in this context
+[^:]*:72: Error: \$DPR_WORD not supported in this context
+[^:]*:73: Error: \$PCR_OFFSET not supported in this context
+[^:]*:74: Error: \$DSBT_INDEX not supported in this context
+[^:]*:75: Error: \$GOT not supported in this context
+[^:]*:76: Error: \$DPR_GOT not supported in this context
+[^:]*:77: Error: \$DPR_BYTE not supported in this context
+[^:]*:78: Error: \$DPR_HWORD not supported in this context
+[^:]*:79: Error: \$DPR_WORD not supported in this context
+[^:]*:80: Error: \$PCR_OFFSET not supported in this context
+[^:]*:81: Error: \$DSBT_INDEX not supported in this context
+[^:]*:82: Error: \$GOT not supported in this context
+[^:]*:83: Error: \$DPR_GOT not supported in this context
+[^:]*:84: Error: \$DPR_BYTE not supported in this context
+[^:]*:85: Error: \$DPR_HWORD not supported in this context
+[^:]*:86: Error: \$DPR_WORD not supported in this context
+[^:]*:87: Error: \$PCR_OFFSET not supported in this context
+[^:]*:88: Error: \$DSBT_INDEX not supported in this context
+[^:]*:89: Error: \$GOT not supported in this context
+[^:]*:90: Error: \$DPR_GOT not supported in this context
+[^:]*:91: Error: \$DPR_BYTE not supported in this context
+[^:]*:92: Error: \$DPR_HWORD not supported in this context
+[^:]*:93: Error: \$DPR_WORD not supported in this context
+[^:]*:94: Error: \$PCR_OFFSET not supported in this context
+[^:]*:95: Error: \$DSBT_INDEX not supported in this context
+[^:]*:96: Error: \$GOT not supported in this context
+[^:]*:97: Error: \$DPR_GOT not supported in this context
+[^:]*:98: Error: \$DPR_BYTE not supported in this context
+[^:]*:99: Error: \$DPR_HWORD not supported in this context
+[^:]*:100: Error: \$DPR_WORD not supported in this context
+[^:]*:101: Error: \$PCR_OFFSET not supported in this context
[^:]*:102: Error: \$DSBT_INDEX not supported in this context
[^:]*:103: Error: \$GOT not supported in this context
[^:]*:104: Error: \$DPR_GOT not supported in this context
[^:]*:105: Error: \$DPR_BYTE not supported in this context
[^:]*:106: Error: \$DPR_HWORD not supported in this context
[^:]*:107: Error: \$DPR_WORD not supported in this context
-[^:]*:108: Error: \$DSBT_INDEX not supported in this context
-[^:]*:109: Error: \$GOT not supported in this context
-[^:]*:110: Error: \$DPR_GOT not supported in this context
-[^:]*:111: Error: \$DPR_BYTE not supported in this context
-[^:]*:112: Error: \$DPR_HWORD not supported in this context
-[^:]*:113: Error: \$DPR_WORD not supported in this context
-[^:]*:114: Error: \$DSBT_INDEX not supported in this context
-[^:]*:115: Error: \$GOT not supported in this context
-[^:]*:116: Error: \$DPR_GOT not supported in this context
-[^:]*:117: Error: \$DPR_BYTE not supported in this context
-[^:]*:118: Error: \$DPR_HWORD not supported in this context
-[^:]*:119: Error: \$DPR_WORD not supported in this context
-[^:]*:120: Error: \$DSBT_INDEX not supported in this context
-[^:]*:121: Error: \$GOT not supported in this context
-[^:]*:122: Error: \$DPR_GOT not supported in this context
-[^:]*:123: Error: \$DPR_BYTE not supported in this context
-[^:]*:124: Error: \$DPR_HWORD not supported in this context
-[^:]*:125: Error: \$DPR_WORD not supported in this context
-[^:]*:126: Error: \$DSBT_INDEX not supported in this context
-[^:]*:127: Error: \$GOT not supported in this context
-[^:]*:128: Error: \$DPR_GOT not supported in this context
-[^:]*:129: Error: \$DPR_BYTE not supported in this context
-[^:]*:130: Error: \$DPR_HWORD not supported in this context
-[^:]*:131: Error: \$DPR_WORD not supported in this context
-[^:]*:132: Error: \$DSBT_INDEX not supported in this context
-[^:]*:133: Error: \$GOT not supported in this context
-[^:]*:134: Error: \$DPR_GOT not supported in this context
-[^:]*:135: Error: \$DPR_BYTE not supported in this context
-[^:]*:136: Error: \$DPR_HWORD not supported in this context
-[^:]*:137: Error: \$DPR_WORD not supported in this context
-[^:]*:138: Error: \$DPR_GOT not supported in this context
-[^:]*:139: Error: \$DPR_BYTE not supported in this context
-[^:]*:140: Error: \$DPR_HWORD not supported in this context
-[^:]*:141: Error: \$DPR_WORD not supported in this context
-[^:]*:142: Error: \$DSBT_INDEX not supported in this context
-[^:]*:143: Error: \$GOT not supported in this context
-[^:]*:144: Error: \$DPR_GOT not supported in this context
-[^:]*:145: Error: \$DPR_BYTE not supported in this context
-[^:]*:146: Error: \$DPR_HWORD not supported in this context
-[^:]*:147: Error: \$DPR_WORD not supported in this context
-[^:]*:148: Error: \$DSBT_INDEX not supported in this context
-[^:]*:149: Error: \$GOT not supported in this context
-[^:]*:150: Error: \$DPR_GOT not supported in this context
-[^:]*:151: Error: \$DPR_BYTE not supported in this context
-[^:]*:152: Error: \$DPR_HWORD not supported in this context
-[^:]*:153: Error: \$DPR_WORD not supported in this context
-[^:]*:154: Error: \$DPR_GOT not supported in this context
-[^:]*:155: Error: \$DPR_BYTE not supported in this context
-[^:]*:156: Error: \$DPR_HWORD not supported in this context
-[^:]*:157: Error: \$DPR_WORD not supported in this context
+[^:]*:108: Error: \$PCR_OFFSET not supported in this context
+[^:]*:109: Error: \$DSBT_INDEX not supported in this context
+[^:]*:110: Error: \$GOT not supported in this context
+[^:]*:111: Error: \$DPR_GOT not supported in this context
+[^:]*:112: Error: \$DPR_BYTE not supported in this context
+[^:]*:113: Error: \$DPR_HWORD not supported in this context
+[^:]*:114: Error: \$DPR_WORD not supported in this context
+[^:]*:115: Error: \$PCR_OFFSET not supported in this context
+[^:]*:116: Error: \$DSBT_INDEX not supported in this context
+[^:]*:117: Error: \$GOT not supported in this context
+[^:]*:118: Error: \$DPR_GOT not supported in this context
+[^:]*:119: Error: \$DPR_BYTE not supported in this context
+[^:]*:120: Error: \$DPR_HWORD not supported in this context
+[^:]*:121: Error: \$DPR_WORD not supported in this context
+[^:]*:122: Error: \$PCR_OFFSET not supported in this context
+[^:]*:123: Error: \$DSBT_INDEX not supported in this context
+[^:]*:124: Error: \$GOT not supported in this context
+[^:]*:125: Error: \$DPR_GOT not supported in this context
+[^:]*:126: Error: \$DPR_BYTE not supported in this context
+[^:]*:127: Error: \$DPR_HWORD not supported in this context
+[^:]*:128: Error: \$DPR_WORD not supported in this context
+[^:]*:129: Error: \$PCR_OFFSET not supported in this context
+[^:]*:130: Error: \$DSBT_INDEX not supported in this context
+[^:]*:131: Error: \$GOT not supported in this context
+[^:]*:132: Error: \$DPR_GOT not supported in this context
+[^:]*:133: Error: \$DPR_BYTE not supported in this context
+[^:]*:134: Error: \$DPR_HWORD not supported in this context
+[^:]*:135: Error: \$DPR_WORD not supported in this context
+[^:]*:136: Error: \$PCR_OFFSET not supported in this context
+[^:]*:137: Error: \$DSBT_INDEX not supported in this context
+[^:]*:138: Error: \$GOT not supported in this context
+[^:]*:139: Error: \$DPR_GOT not supported in this context
+[^:]*:140: Error: \$DPR_BYTE not supported in this context
+[^:]*:141: Error: \$DPR_HWORD not supported in this context
+[^:]*:142: Error: \$DPR_WORD not supported in this context
+[^:]*:143: Error: \$PCR_OFFSET not supported in this context
+[^:]*:144: Error: \$DSBT_INDEX not supported in this context
+[^:]*:145: Error: \$GOT not supported in this context
+[^:]*:146: Error: \$DPR_GOT not supported in this context
+[^:]*:147: Error: \$DPR_BYTE not supported in this context
+[^:]*:148: Error: \$DPR_HWORD not supported in this context
+[^:]*:149: Error: \$DPR_WORD not supported in this context
+[^:]*:150: Error: \$PCR_OFFSET not supported in this context
+[^:]*:151: Error: \$DSBT_INDEX not supported in this context
+[^:]*:152: Error: \$GOT not supported in this context
+[^:]*:153: Error: \$DPR_GOT not supported in this context
+[^:]*:154: Error: \$DPR_BYTE not supported in this context
+[^:]*:155: Error: \$DPR_HWORD not supported in this context
+[^:]*:156: Error: \$DPR_WORD not supported in this context
+[^:]*:157: Error: \$PCR_OFFSET not supported in this context
+[^:]*:158: Error: \$DPR_GOT not supported in this context
+[^:]*:159: Error: \$DPR_BYTE not supported in this context
+[^:]*:160: Error: \$DPR_HWORD not supported in this context
+[^:]*:161: Error: \$DPR_WORD not supported in this context
+[^:]*:162: Error: \$PCR_OFFSET not supported in this context
+[^:]*:163: Error: \$DSBT_INDEX not supported in this context
+[^:]*:164: Error: \$GOT not supported in this context
+[^:]*:165: Error: \$DPR_GOT not supported in this context
+[^:]*:166: Error: \$DPR_BYTE not supported in this context
+[^:]*:167: Error: \$DPR_HWORD not supported in this context
+[^:]*:168: Error: \$DPR_WORD not supported in this context
+[^:]*:169: Error: \$PCR_OFFSET not supported in this context
+[^:]*:170: Error: \$DSBT_INDEX not supported in this context
+[^:]*:171: Error: \$GOT not supported in this context
+[^:]*:172: Error: \$DPR_GOT not supported in this context
+[^:]*:173: Error: \$DPR_BYTE not supported in this context
+[^:]*:174: Error: \$DPR_HWORD not supported in this context
+[^:]*:175: Error: \$DPR_WORD not supported in this context
+[^:]*:176: Error: \$PCR_OFFSET not supported in this context
+[^:]*:177: Error: \$DPR_GOT not supported in this context
+[^:]*:178: Error: \$DPR_BYTE not supported in this context
+[^:]*:179: Error: \$DPR_HWORD not supported in this context
+[^:]*:180: Error: \$DPR_WORD not supported in this context
+[^:]*:181: Error: \$PCR_OFFSET not supported in this context
.word $dpr_byte(b)
.word $dpr_hword(a)
.word $dpr_word(b)
+ .word $pcr_offset(b,f)
.text
.nocmp
.globl f
addab .D1X b14,$DPR_BYTE(b),a5
addab .D1X b14,$DPR_HWORD(b),a5
addab .D1X b14,$DPR_WORD(b),a5
+ addab .D1X b14,$PCR_OFFSET(b,f),a5
addah .D1X b14,$dsbt_index(__c6xabi_DSBT_BASE),a5
addah .D1X b14,$GOT(b),a5
addah .D1X b14,$DPR_GOT(b),a5
addah .D1X b14,$DPR_BYTE(b),a5
addah .D1X b14,$DPR_HWORD(b),a5
addah .D1X b14,$DPR_WORD(b),a5
+ addah .D1X b14,$PCR_OFFSET(b,f),a5
addaw .D1X b14,$DPR_GOT(b),a5
addaw .D1X b14,$DPR_BYTE(b),a5
addaw .D1X b14,$DPR_HWORD(b),a5
addaw .D1X b14,$DPR_WORD(b),a5
+ addaw .D1X b14,$PCR_OFFSET(b,f),a5
addk .S1 $dsbt_index(__c6xabi_DSBT_BASE),a7
addk .S1 $got(b),a7
addk .S1 $dpr_got(b),a7
addk .S1 $dpr_hword(b),a7
addk .S1 $dpr_word(b),a7
+ addk .S1 $pcr_offset(b,f),a7
mvk .S1 $dsbt_index(__c6xabi_DSBT_BASE),a7
mvk .S1 $got(b),a7
mvk .S1 $dpr_got(b),a7
addkpc .S2 $DPR_BYTE(b),b3,0
addkpc .S2 $DPR_HWORD(b),b3,0
addkpc .S2 $DPR_WORD(b),b3,0
+ addkpc .S2 $PCR_OFFSET(b,f),b3,0
b .S1 $dsbt_index(__c6xabi_DSBT_BASE)
b .S1 $GOT(b)
b .S1 $DPR_GOT(b)
b .S1 $DPR_BYTE(b)
b .S1 $DPR_HWORD(b)
b .S1 $DPR_WORD(b)
+ b .S1 $PCR_OFFSET(b,f)
call .S1 $dsbt_index(__c6xabi_DSBT_BASE)
call .S1 $GOT(b)
call .S1 $DPR_GOT(b)
call .S1 $DPR_BYTE(b)
call .S1 $DPR_HWORD(b)
call .S1 $DPR_WORD(b)
+ call .S1 $PCR_OFFSET(b,f)
bdec .S1 $dsbt_index(__c6xabi_DSBT_BASE),a1
bdec .S1 $GOT(b),a1
bdec .S1 $DPR_GOT(b),a1
bdec .S1 $DPR_BYTE(b),a1
bdec .S1 $DPR_HWORD(b),a1
bdec .S1 $DPR_WORD(b),a1
+ bdec .S1 $PCR_OFFSET(b,f),a1
bpos .S2 $dsbt_index(__c6xabi_DSBT_BASE),b1
bpos .S2 $GOT(b),b1
bpos .S2 $DPR_GOT(b),b1
bpos .S2 $DPR_BYTE(b),b1
bpos .S2 $DPR_HWORD(b),b1
bpos .S2 $DPR_WORD(b),b1
+ bpos .S2 $PCR_OFFSET(b,f),b1
bnop .S1 $dsbt_index(__c6xabi_DSBT_BASE),1
bnop .S1 $GOT(b),1
bnop .S1 $DPR_GOT(b),1
bnop .S1 $DPR_BYTE(b),1
bnop .S1 $DPR_HWORD(b),1
bnop .S1 $DPR_WORD(b),1
+ bnop .S1 $PCR_OFFSET(b,f),1
callnop $dsbt_index(__c6xabi_DSBT_BASE),1
callnop $GOT(b),1
callnop $DPR_GOT(b),1
callnop $DPR_BYTE(b),1
callnop $DPR_HWORD(b),1
callnop $DPR_WORD(b),1
+ callnop $PCR_OFFSET(b,f),1
callp .S1 $dsbt_index(__c6xabi_DSBT_BASE),a3
callp .S1 $GOT(b),a3
callp .S1 $DPR_GOT(b),a3
callp .S1 $DPR_BYTE(b),a3
callp .S1 $DPR_HWORD(b),a3
callp .S1 $DPR_WORD(b),a3
+ callp .S1 $PCR_OFFSET(b,f),a3
callret .S1 $dsbt_index(__c6xabi_DSBT_BASE)
callret .S1 $GOT(b)
callret .S1 $DPR_GOT(b)
callret .S1 $DPR_BYTE(b)
callret .S1 $DPR_HWORD(b)
callret .S1 $DPR_WORD(b)
+ callret .S1 $PCR_OFFSET(b,f)
ret .S1 $dsbt_index(__c6xabi_DSBT_BASE)
ret .S1 $GOT(b)
ret .S1 $DPR_GOT(b)
ret .S1 $DPR_BYTE(b)
ret .S1 $DPR_HWORD(b)
ret .S1 $DPR_WORD(b)
+ ret .S1 $PCR_OFFSET(b,f)
retp .S1 $dsbt_index(__c6xabi_DSBT_BASE),a3
retp .S1 $GOT(b),a3
retp .S1 $DPR_GOT(b),a3
retp .S1 $DPR_BYTE(b),a3
retp .S1 $DPR_HWORD(b),a3
retp .S1 $DPR_WORD(b),a3
+ retp .S1 $PCR_OFFSET(b,f),a3
ldb .D2T2 *+b14($dsbt_index(__c6xabi_DSBT_BASE)),b1
ldb .D2T2 *+b14($GOT(b)),b1
ldb .D2T2 *+b14($DPR_GOT(b)),b1
ldb .D2T2 *+b14($DPR_BYTE(b)),b1
ldb .D2T2 *+b14($DPR_HWORD(b)),b1
ldb .D2T2 *+b14($DPR_WORD(b)),b1
+ ldb .D2T2 *+b14($PCR_OFFSET(b,f)),b1
ldbu .D2T2 *+b14($dsbt_index(__c6xabi_DSBT_BASE)),b1
ldbu .D2T2 *+b14($GOT(b)),b1
ldbu .D2T2 *+b14($DPR_GOT(b)),b1
ldbu .D2T2 *+b14($DPR_BYTE(b)),b1
ldbu .D2T2 *+b14($DPR_HWORD(b)),b1
ldbu .D2T2 *+b14($DPR_WORD(b)),b1
+ ldbu .D2T2 *+b14($PCR_OFFSET(b,f)),b1
ldh .D2T2 *+b14($dsbt_index(__c6xabi_DSBT_BASE)),b1
ldh .D2T2 *+b14($GOT(b)),b1
ldh .D2T2 *+b14($DPR_GOT(b)),b1
ldh .D2T2 *+b14($DPR_BYTE(b)),b1
ldh .D2T2 *+b14($DPR_HWORD(b)),b1
ldh .D2T2 *+b14($DPR_WORD(b)),b1
+ ldh .D2T2 *+b14($PCR_OFFSET(b,f)),b1
ldhu .D2T2 *+b14($dsbt_index(__c6xabi_DSBT_BASE)),b1
ldhu .D2T2 *+b14($GOT(b)),b1
ldhu .D2T2 *+b14($DPR_GOT(b)),b1
ldhu .D2T2 *+b14($DPR_BYTE(b)),b1
ldhu .D2T2 *+b14($DPR_HWORD(b)),b1
ldhu .D2T2 *+b14($DPR_WORD(b)),b1
+ ldhu .D2T2 *+b14($PCR_OFFSET(b,f)),b1
ldw .D2T2 *+b14($DPR_GOT(b)),b1
ldw .D2T2 *+b14($DPR_BYTE(b)),b1
ldw .D2T2 *+b14($DPR_HWORD(b)),b1
ldw .D2T2 *+b14($DPR_WORD(b)),b1
+ ldw .D2T2 *+b14($PCR_OFFSET(b,f)),b1
stb .D2T2 b1,*+b14($dsbt_index(__c6xabi_DSBT_BASE))
stb .D2T2 b1,*+b14($GOT(b))
stb .D2T2 b1,*+b14($DPR_GOT(b))
stb .D2T2 b1,*+b14($DPR_BYTE(b))
stb .D2T2 b1,*+b14($DPR_HWORD(b))
stb .D2T2 b1,*+b14($DPR_WORD(b))
+ stb .D2T2 b1,*+b14($PCR_OFFSET(b,f))
sth .D2T2 b1,*+b14($dsbt_index(__c6xabi_DSBT_BASE))
sth .D2T2 b1,*+b14($GOT(b))
sth .D2T2 b1,*+b14($DPR_GOT(b))
sth .D2T2 b1,*+b14($DPR_BYTE(b))
sth .D2T2 b1,*+b14($DPR_HWORD(b))
sth .D2T2 b1,*+b14($DPR_WORD(b))
+ sth .D2T2 b1,*+b14($PCR_OFFSET(b,f))
stw .D2T2 b1,*+b14($DPR_GOT(b))
stw .D2T2 b1,*+b14($DPR_BYTE(b))
stw .D2T2 b1,*+b14($DPR_HWORD(b))
stw .D2T2 b1,*+b14($DPR_WORD(b))
+ stw .D2T2 b1,*+b14($PCR_OFFSET(b,f))
+2011-05-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * ld-tic6x/pcr-reloc.d: New test.
+ * ld-tic6x/pcr-reloc.s: New test.
+
2011-05-18 Nick Clifton <nickc@redhat.com>
PR ld/12761
--- /dev/null
+#name: C6X PCR relocations
+#as: -mlittle-endian
+#ld: -melf32_tic6x_le -Tgeneric.ld
+#source: pcr-reloc.s
+#objdump: -dr
+
+.*: *file format elf32-tic6x-le
+
+
+Disassembly of section \.text:
+
+10000000 <[^>]*>:
+10000000:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000004:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000008:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+
+1000000c <[^>]*>:
+1000000c:[ \t]+004003e2[ \t]+mvc \.S2 pce1,b0
+10000010:[ \t]+01000264[ \t]+ldw \.D1T1 \*\+a0\(0\),a2
+10000014:[ \t]+01001a2a[ \t]+mvk \.S2 52,b2
+10000018:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+1000001c:[ \t]+01000a2a[ \t]+mvk \.S2 20,b2
+10000020:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+10000024:[ \t]+01001e2a[ \t]+mvk \.S2 60,b2
+10000028:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+1000002c:[ \t]+01000e2a[ \t]+mvk \.S2 28,b2
+10000030:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+
+10000034 <[^>]*>:
+10000034:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+
+10000038 <[^>]*>:
+10000038:[ \t]+004003e2[ \t]+mvc \.S2 pce1,b0
+
+1000003c <[^>]*>:
+1000003c:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000040:[ \t]+017ff02a[ \t]+mvk \.S2 -32,b2
+10000044:[ \t]+017fffea[ \t]+mvkh \.S2 4294901760,b2
+[ \t]*\.\.\.
--- /dev/null
+ .text
+ .align 5
+_start:
+L0:
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+L1:
+ MVC .s2 PCE1, b0
+ ldw .d1t1 *a0,a2
+ mvk .s2 $PCR_OFFSET (S0,L1), b2
+ mvkh .s2 $PCR_OFFSET (S0,L1), b2
+ mvk .s2 $PCR_OFFSET (S0,L2), b2
+ mvkh .s2 $PCR_OFFSET (S0,L2), b2
+ mvk .s2 $PCR_OFFSET (S1,L1), b2
+ mvkh .s2 $PCR_OFFSET (S1,L1), b2
+ mvk .s2 $PCR_OFFSET (S1,L2), b2
+ mvkh .s2 $PCR_OFFSET (S1,L2), b2
+
+S0:
+ ldw .d1t1 *a0,a1
+L2:
+ MVC .s2 PCE1, b0
+
+S1:
+ ldw .d1t1 *a0,a1
+ mvkl .s2 $PCR_OFFSET (L0,L2), b2
+ mvkh .s2 $PCR_OFFSET (L0,L2), b2