aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-04-08 23:01:47 +0000
committerAlan Modra <amodra@gmail.com>2003-04-08 23:01:47 +0000
commita7fc733f393cf349a03757bdf1c66c2576b387ca (patch)
tree3a6536eb1c19ae7b3bd55fc643c87823053283f4 /gas/config/tc-ppc.c
parent4443bd8373866e76ec700a8bb3f5df8a50ba3714 (diff)
downloadgdb-a7fc733f393cf349a03757bdf1c66c2576b387ca.zip
gdb-a7fc733f393cf349a03757bdf1c66c2576b387ca.tar.gz
gdb-a7fc733f393cf349a03757bdf1c66c2576b387ca.tar.bz2
* config/tc-ppc.c (md_apply_fix3): Generate ADDR16 relocs.
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 293627e..7436fbd 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -5522,15 +5522,26 @@ md_apply_fix3 (fixP, valP, seg)
#if defined (OBJ_XCOFF) || defined (OBJ_ELF)
else if ((operand->flags & PPC_OPERAND_PARENS) != 0
&& operand->bits == 16
- && operand->shift == 0
- && ppc_is_toc_sym (fixP->fx_addsy))
+ && operand->shift == 0)
{
- fixP->fx_r_type = BFD_RELOC_PPC_TOC16;
+ if (ppc_is_toc_sym (fixP->fx_addsy))
+ {
+ fixP->fx_r_type = BFD_RELOC_PPC_TOC16;
#ifdef OBJ_ELF
- if (ppc_obj64
- && (operand->flags & PPC_OPERAND_DS) != 0)
- fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS;
+ if (ppc_obj64
+ && (operand->flags & PPC_OPERAND_DS) != 0)
+ fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS;
+#endif
+ }
+ else
+ {
+ fixP->fx_r_type = BFD_RELOC_16;
+#ifdef OBJ_ELF
+ if (ppc_obj64
+ && (operand->flags & PPC_OPERAND_DS) != 0)
+ fixP->fx_r_type = BFD_RELOC_PPC64_ADDR16_DS;
#endif
+ }
fixP->fx_size = 2;
if (target_big_endian)
fixP->fx_where += 2;