diff options
author | Alan Modra <amodra@bigpond.net.au> | 2003-04-08 23:01:47 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2003-04-08 23:01:47 +0000 |
commit | e3871cf94c511a62bb4fbde7a8504d1f02e673db (patch) | |
tree | 3b1e1bc3600c79ec5ddab7709514620dae989e9a | |
parent | 87d0831f7992834926a02ab5dd722601e6fd7b1c (diff) | |
download | binutils-redhat-e3871cf94c511a62bb4fbde7a8504d1f02e673db.tar.gz |
* config/tc-ppc.c (md_apply_fix3): Generate ADDR16 relocs.
-rw-r--r-- | gas/ChangeLog | 4 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 23 |
2 files changed, 21 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 9918fc5577..cf54e8501f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2003-04-09 Alan Modra <amodra@bigpond.net.au> + + * config/tc-ppc.c (md_apply_fix3): Generate ADDR16 relocs. + 2003-04-08 Nick Clifton <nickc@redhat.com> * as.c (perform_an_assembly_pass): If using cgen, call diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 293627e3d8..7436fbdd37 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; |