diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2012-11-14 13:44:45 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2012-11-14 13:44:45 +0000 |
commit | 46b596ff8c4997f2774e832fe503a9af2bc6f4b3 (patch) | |
tree | 2856a257d0678775c7de1d07514d88ebbee57a10 /gas/config | |
parent | 1778ad74b30a4873b8288ef88918677d333164e2 (diff) | |
download | gdb-46b596ff8c4997f2774e832fe503a9af2bc6f4b3.zip gdb-46b596ff8c4997f2774e832fe503a9af2bc6f4b3.tar.gz gdb-46b596ff8c4997f2774e832fe503a9af2bc6f4b3.tar.bz2 |
gas/ChangeLog:
* config/tc-ppc.c (md_apply_fix): Leave field zero when emitting
an ELF reloc on data as well.
gas/testsuite/ChangeLog:
* gas/ppc/astest.d: Update for fixup changes.
* gas/ppc/astest64.d: Likewise.
* gas/ppc/astest2.d: Likewise.
* gas/ppc/astest2_64.d: Likewise.
* gas/ppc/test1elf32.d: Likewise.
* gas/ppc/test1elf64.d: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-ppc.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 1b12f57..de13ab1 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -6620,6 +6620,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) } else { + int size = 0; + offsetT fieldval = value; + /* Handle relocs in data. */ switch (fixP->fx_r_type) { @@ -6635,8 +6638,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_32_PCREL: case BFD_RELOC_RVA: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 4); + size = 4; break; case BFD_RELOC_64: @@ -6646,8 +6648,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* fall through */ case BFD_RELOC_64_PCREL: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 8); + size = 8; break; case BFD_RELOC_16: @@ -6656,8 +6657,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* fall through */ case BFD_RELOC_16_PCREL: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 2); + size = 2; break; case BFD_RELOC_8: @@ -6690,8 +6690,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) fixP->fx_done = 1; } else - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 1); + size = 1; break; case BFD_RELOC_VTABLE_INHERIT: @@ -6711,52 +6710,51 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_pcrel) fixP->fx_r_type = BFD_RELOC_LO16_PCREL; case BFD_RELOC_LO16_PCREL: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 2); + size = 2; break; case BFD_RELOC_HI16: if (fixP->fx_pcrel) fixP->fx_r_type = BFD_RELOC_HI16_PCREL; case BFD_RELOC_HI16_PCREL: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HI (value), 2); + size = 2; + fieldval = PPC_HI (value); break; case BFD_RELOC_HI16_S: if (fixP->fx_pcrel) fixP->fx_r_type = BFD_RELOC_HI16_S_PCREL; case BFD_RELOC_HI16_S_PCREL: - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HA (value), 2); + size = 2; + fieldval = PPC_HA (value); break; case BFD_RELOC_PPC64_HIGHER: if (fixP->fx_pcrel) goto bad_pcrel; - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HIGHER (value), 2); + size = 2; + fieldval = PPC_HIGHER (value); break; case BFD_RELOC_PPC64_HIGHER_S: if (fixP->fx_pcrel) goto bad_pcrel; - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HIGHERA (value), 2); + size = 2; + fieldval = PPC_HIGHERA (value); break; case BFD_RELOC_PPC64_HIGHEST: if (fixP->fx_pcrel) goto bad_pcrel; - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HIGHEST (value), 2); + size = 2; + fieldval = PPC_HIGHEST (value); break; case BFD_RELOC_PPC64_HIGHEST_S: if (fixP->fx_pcrel) goto bad_pcrel; - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - PPC_HIGHESTA (value), 2); + size = 2; + fieldval = PPC_HIGHESTA (value); break; case BFD_RELOC_PPC_DTPMOD: @@ -6856,6 +6854,10 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) fflush (stderr); abort (); } + + if (size && APPLY_RELOC) + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + fieldval, size); } #ifdef OBJ_ELF |