diff options
author | Dave Anglin <dave.anglin@nrc.ca> | 2005-11-07 18:53:10 +0000 |
---|---|---|
committer | Dave Anglin <dave.anglin@nrc.ca> | 2005-11-07 18:53:10 +0000 |
commit | 8973a37d31b14d0b90cd0046c1091e0e578dd16d (patch) | |
tree | 555db15c7b0696adeb269c314492f812106b18de /gas | |
parent | a0b7da7978512482b0eba1e038953c821c84ea84 (diff) | |
download | gdb-8973a37d31b14d0b90cd0046c1091e0e578dd16d.zip gdb-8973a37d31b14d0b90cd0046c1091e0e578dd16d.tar.gz gdb-8973a37d31b14d0b90cd0046c1091e0e578dd16d.tar.bz2 |
PR gas/1804
* config/tc-hppa.c (md_apply_fix): Use number_to_chars_bigendian to
output constant data.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-hppa.c | 19 |
2 files changed, 19 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 010cd72..f978963 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2005-11-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR gas/1804 + * config/tc-hppa.c (md_apply_fix): Use number_to_chars_bigendian to + output constant data. + 2005-11-07 Mark Mitchell <mark@codesourcery.com> * doc/Makefile.am (asconfig.texi): Set top_srcdir. diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index f02e475..3886cb8 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -4436,7 +4436,7 @@ md_apply_fix (fixP, valP, seg) valueT *valP; segT seg ATTRIBUTE_UNUSED; { - unsigned char *buf; + char *fixpos; struct hppa_fix_struct *hppa_fixP; offsetT new_val; int insn, val, fmt; @@ -4470,8 +4470,7 @@ md_apply_fix (fixP, valP, seg) if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) fixP->fx_done = 1; - /* There should have been an HPPA specific fixup associated - with the GAS fixup. */ + /* There should be a HPPA specific fixup associated with the GAS fixup. */ hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; if (hppa_fixP == NULL) { @@ -4481,8 +4480,16 @@ md_apply_fix (fixP, valP, seg) return; } - buf = (unsigned char *) (fixP->fx_frag->fr_literal + fixP->fx_where); - insn = bfd_get_32 (stdoutput, buf); + fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; + + if (fixP->fx_size != 4 || hppa_fixP->fx_r_format == 32) + { + /* Handle constant output. */ + number_to_chars_bigendian (fixpos, *valP, fixP->fx_size); + return; + } + + insn = bfd_get_32 (stdoutput, fixpos); fmt = bfd_hppa_insn2fmt (stdoutput, insn); /* If there is a symbol associated with this fixup, then it's something @@ -4652,7 +4659,7 @@ md_apply_fix (fixP, valP, seg) } /* Insert the relocation. */ - bfd_put_32 (stdoutput, insn, buf); + bfd_put_32 (stdoutput, insn, fixpos); } /* Exactly what point is a PC-relative offset relative TO? |