* config/tc-ppc.c (md_assemble <DS relocs>): Test ppc_size as well

as BFD_DEFAULT_TARGET_SIZE.
	(ppc_tc): Likewise.
	(ppc_is_toc_sym): Likewise.
	(md_apply_fix3): Likewise.
This commit is contained in:
Alan Modra
2001-10-04 05:03:44 +00:00
parent f983ac445d
commit 9c7977b3bd
2 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2001-10-04 Alan Modra <amodra@bigpond.net.au>
* config/tc-ppc.c (md_assemble <DS relocs>): Test ppc_size as well
as BFD_DEFAULT_TARGET_SIZE.
(ppc_tc): Likewise.
(ppc_is_toc_sym): Likewise.
(md_apply_fix3): Likewise.
2001-10-03 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> 2001-10-03 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config/tc-mips.c (mips_64): Remove. * config/tc-mips.c (mips_64): Remove.

View File

@ -2176,6 +2176,7 @@ md_assemble (str)
} }
if (BFD_DEFAULT_TARGET_SIZE == 64 if (BFD_DEFAULT_TARGET_SIZE == 64
&& ppc_size == PPC_OPCODE_64
&& (operand->flags & PPC_OPERAND_DS) != 0) && (operand->flags & PPC_OPERAND_DS) != 0)
{ {
switch (reloc) switch (reloc)
@ -3586,6 +3587,7 @@ ppc_tc (ignore)
#endif /* OBJ_XCOFF */ #endif /* OBJ_XCOFF */
#ifdef OBJ_ELF #ifdef OBJ_ELF
int align;
/* Skip the TOC symbol name. */ /* Skip the TOC symbol name. */
while (is_part_of_name (*input_line_pointer) while (is_part_of_name (*input_line_pointer)
@ -3596,8 +3598,9 @@ ppc_tc (ignore)
++input_line_pointer; ++input_line_pointer;
/* Align to a four/eight byte boundary. */ /* Align to a four/eight byte boundary. */
frag_align (BFD_DEFAULT_TARGET_SIZE == 64 ? 3 : 2, 0, 0); align = BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64 ? 3 : 2;
record_alignment (now_seg, BFD_DEFAULT_TARGET_SIZE == 64 ? 3 : 2); frag_align (align, 0, 0);
record_alignment (now_seg, align);
#endif /* OBJ_ELF */ #endif /* OBJ_ELF */
if (*input_line_pointer != ',') if (*input_line_pointer != ',')
@ -3630,7 +3633,7 @@ ppc_is_toc_sym (sym)
#endif #endif
#ifdef OBJ_ELF #ifdef OBJ_ELF
const char *sname = segment_name (S_GET_SEGMENT (sym)); const char *sname = segment_name (S_GET_SEGMENT (sym));
if (BFD_DEFAULT_TARGET_SIZE == 64) if (BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64)
return strcmp (sname, ".toc") == 0; return strcmp (sname, ".toc") == 0;
else else
return strcmp (sname, ".got") == 0; return strcmp (sname, ".got") == 0;
@ -5174,6 +5177,7 @@ md_apply_fix3 (fixp, valuep, seg)
fixp->fx_r_type = BFD_RELOC_PPC_TOC16; fixp->fx_r_type = BFD_RELOC_PPC_TOC16;
#ifdef OBJ_ELF #ifdef OBJ_ELF
if (BFD_DEFAULT_TARGET_SIZE == 64 if (BFD_DEFAULT_TARGET_SIZE == 64
&& ppc_size == PPC_OPCODE_64
&& (operand->flags & PPC_OPERAND_DS) != 0) && (operand->flags & PPC_OPERAND_DS) != 0)
fixp->fx_r_type = BFD_RELOC_PPC64_TOC16_DS; fixp->fx_r_type = BFD_RELOC_PPC64_TOC16_DS;
#endif #endif
@ -5207,9 +5211,11 @@ md_apply_fix3 (fixp, valuep, seg)
#endif #endif
switch (fixp->fx_r_type) switch (fixp->fx_r_type)
{ {
#if BFD_DEFAULT_TARGET_SIZE != 64
case BFD_RELOC_CTOR: case BFD_RELOC_CTOR:
#endif if (BFD_DEFAULT_TARGET_SIZE == 64 && ppc_size == PPC_OPCODE_64)
goto ctor64;
/* fall through */
case BFD_RELOC_32: case BFD_RELOC_32:
if (fixp->fx_pcrel) if (fixp->fx_pcrel)
fixp->fx_r_type = BFD_RELOC_32_PCREL; fixp->fx_r_type = BFD_RELOC_32_PCREL;
@ -5223,10 +5229,8 @@ md_apply_fix3 (fixp, valuep, seg)
value, 4); value, 4);
break; break;
#if BFD_DEFAULT_TARGET_SIZE == 64
case BFD_RELOC_CTOR:
#endif
case BFD_RELOC_64: case BFD_RELOC_64:
ctor64:
if (fixp->fx_pcrel) if (fixp->fx_pcrel)
fixp->fx_r_type = BFD_RELOC_64_PCREL; fixp->fx_r_type = BFD_RELOC_64_PCREL;
/* fall through */ /* fall through */