2011-05-03 Paul Brook <paul@codesourcery.com>

bfd/
	* elf32-tic6x.c (elf32_tic6x_howto_table,
	elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
	elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
	Add R_C6000_EHTYPE.

	gas/
	* config/tc-tic6x.c (s_ehtype): New function.
	(md_pseudo_table): Add "ehtype".
	(tic6x_fix_adjustable, md_apply_fix): BFD_RELOC_C6000_EHTYPE.
	* doc/c-tic6x.texi: Document .ehtype directive.

	ld/testsuite/
	* ld-tic6x/ehtype-reloc-1-rel.d: New test.
	* ld-tic6x/ehtype-reloc-1.d: New test.
	* ld-tic6x/ehtype-reloc-1.s: New test.
This commit is contained in:
Paul Brook 2011-05-03 11:17:22 +00:00
parent f83a48cea0
commit 2fbb87f627
9 changed files with 134 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2011-05-03 Paul Brook <paul@codesourcery.com>
* elf32-tic6x.c (elf32_tic6x_howto_table,
elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
Add R_C6000_EHTYPE.
2011-05-01 Alan Modra <amodra@gmail.com>
PR ld/12718

View file

@ -468,7 +468,19 @@ static reloc_howto_type elf32_tic6x_howto_table[] =
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
EMPTY_HOWTO (28),
HOWTO (R_C6000_EHTYPE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_C6000_EHTYPE", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
EMPTY_HOWTO (29),
EMPTY_HOWTO (30),
EMPTY_HOWTO (31),
@ -1040,7 +1052,19 @@ static reloc_howto_type elf32_tic6x_howto_table_rel[] =
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
EMPTY_HOWTO (28),
HOWTO (R_C6000_EHTYPE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_C6000_EHTYPE", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
EMPTY_HOWTO (29),
EMPTY_HOWTO (30),
EMPTY_HOWTO (31),
@ -1853,6 +1877,7 @@ elf32_tic6x_gc_sweep_hook (bfd *abfd,
case R_C6000_SBR_GOT_U15_W:
case R_C6000_SBR_GOT_L16_W:
case R_C6000_SBR_GOT_H16_W:
case R_C6000_EHTYPE:
if (h != NULL)
{
if (h->got.refcount > 0)
@ -2323,6 +2348,7 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
case R_C6000_SBR_GOT_U15_W:
case R_C6000_SBR_GOT_L16_W:
case R_C6000_SBR_GOT_H16_W:
case R_C6000_EHTYPE:
/* Relocation is to the entry for this symbol in the global
offset table. */
if (htab->elf.sgot == NULL)
@ -2646,6 +2672,7 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_C6000_SBR_GOT_U15_W:
case R_C6000_SBR_GOT_L16_W:
case R_C6000_SBR_GOT_H16_W:
case R_C6000_EHTYPE:
/* This symbol requires a global offset table entry. */
if (h != NULL)
{

View file

@ -1,3 +1,11 @@
2011-05-03 Paul Brook <paul@codesourcery.com>
* config/tc-tic6x.c (s_ehtype): New function.
(md_pseudo_table): Add "ehtype".
(tic6x_fix_adjustable, md_apply_fix): BFD_RELOC_C6000_EHTYPE.
* doc/c-tic6x.texi: Document .ehtype directive.
2011-04-26 Kai Tietz <ktietz@redhat.com>
* dw2gencfi.c (dwcfi_seg_list): New struct.

View file

@ -345,6 +345,44 @@ s_tic6x_arch (int ignored ATTRIBUTE_UNUSED)
demand_empty_rest_of_line ();
}
/* Parse a .ehtype directive. */
static void
s_tic6x_ehtype (int ignored ATTRIBUTE_UNUSED)
{
expressionS exp;
char *p;
#ifdef md_flush_pending_output
md_flush_pending_output ();
#endif
if (is_it_end_of_statement ())
{
demand_empty_rest_of_line ();
return;
}
#ifdef md_cons_align
md_cons_align (4);
#endif
expression (&exp);
if (exp.X_op != O_symbol)
{
as_bad (_("expected symbol"));
return;
}
p = frag_more (4);
fix_new_exp (frag_now, p - frag_now->fr_literal, 4,
&exp, 0, BFD_RELOC_C6000_EHTYPE);
demand_empty_rest_of_line ();
}
/* Parse a .nocmp directive. */
static void
@ -535,6 +573,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "nocmp", s_tic6x_nocmp, 0 },
{ "scomm", s_tic6x_scomm, 0 },
{ "word", cons, 4 },
{ "ehtype", s_tic6x_ehtype, 0 },
{ 0, 0, 0 }
};
@ -1801,6 +1840,7 @@ tic6x_fix_adjustable (fixS *fixP)
case BFD_RELOC_C6000_SBR_GOT_U15_W:
case BFD_RELOC_C6000_SBR_GOT_H16_W:
case BFD_RELOC_C6000_SBR_GOT_L16_W:
case BFD_RELOC_C6000_EHTYPE:
return 0;
default:
@ -3508,6 +3548,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
switch (fixP->fx_r_type)
{
case BFD_RELOC_NONE:
case BFD_RELOC_C6000_EHTYPE:
/* Force output to the object file. */
fixP->fx_done = 0;
break;

View file

@ -146,6 +146,10 @@ The @var{tag} is either an attribute number or one of
@var{value} is either a @code{number}, @code{"string"}, or
@code{number, "string"} depending on the tag.
@cindex @code{.ehtype} directive, TIC6X
@item .ehtype @var{symbol}
Output an exception type table reference to @var{symbol}.
@cindex @code{.nocmp} directive, TIC6X
@item .nocmp
Disallow use of C64x+ compact instructions in the current text

View file

@ -1,3 +1,10 @@
2011-05-03 Paul Brook <paul@codesourcery.com>
* ld-tic6x/ehtype-reloc-1-rel.d: New test.
* ld-tic6x/ehtype-reloc-1.d: New test.
* ld-tic6x/ehtype-reloc-1.s: New test.
2011-05-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/12718

View file

@ -0,0 +1,14 @@
#name: EHTYPE relocations (REL)
#as: -mlittle-endian -mgenerate-rel
#ld: -melf32_tic6x_le --defsym s1=0x2a -Tdsbt-inrange.ld
#source: ehtype-reloc-1.s
#objdump: -s -j.data -j.text -j.got
.*: *file format elf32-tic6x-le
Contents of section .data:
8018 78563412 .*
Contents of section .text:
10000000 08000000 0c000000 .*
Contents of section .got:
2001fff4 00000000 00000000 2a000000 18800000 .*

View file

@ -0,0 +1,14 @@
#name: EHTYPE relocations (RELA)
#as: -mlittle-endian
#ld: -melf32_tic6x_le --defsym s1=0x2a -Tdsbt-inrange.ld
#source: ehtype-reloc-1.s
#objdump: -s -j.data -j.text -j.got
.*: *file format elf32-tic6x-le
Contents of section .data:
8018 78563412 .*
Contents of section .text:
10000000 08000000 0c000000 .*
Contents of section .got:
2001fff4 00000000 00000000 2a000000 18800000 .*

View file

@ -0,0 +1,9 @@
.globl s2
.globl _start
.text
_start:
.ehtype s1
.ehtype s2
.data
s2:
.word 0x12345678