diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2002-09-30 06:32:00 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2002-09-30 06:32:00 +0000 |
commit | 7a49a8c2b494a6e398ab861ba31564d0bd854f68 (patch) | |
tree | 9d08f7211ad7462b48118d363114f7c2fae7f337 /gas | |
parent | b1e61c4bf31b56dd042a06297d01799cb5f4ae37 (diff) | |
download | gdb-7a49a8c2b494a6e398ab861ba31564d0bd854f68.zip gdb-7a49a8c2b494a6e398ab861ba31564d0bd854f68.tar.gz gdb-7a49a8c2b494a6e398ab861ba31564d0bd854f68.tar.bz2 |
2002-09-29 H.J. Lu <hjl@gnu.org>
* config/tc-mips.c (md_apply_fix3): Subtract the symbol value
twice if howto->pcrel_offset is true.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index cf754ab..13ed1e8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2002-09-29 H.J. Lu <hjl@gnu.org> + + * config/tc-mips.c (md_apply_fix3): Subtract the symbol value + twice if howto->pcrel_offset is true. + 2002-09-28 Matt Thomas <matt@3am-software.com> Jason Thorpe <thorpej@wasabisystems.com> diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 6d0c13f..7c8be07 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -10754,11 +10754,23 @@ md_apply_fix3 (fixP, valP, seg) value -= symval; howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); - if (value != 0 && howto->partial_inplace && ! fixP->fx_pcrel) + if (value != 0 && howto->partial_inplace + && (! fixP->fx_pcrel || howto->pcrel_offset)) { /* In this case, the bfd_install_relocation routine will incorrectly add the symbol value back in. We just want - the addend to appear in the object file. */ + the addend to appear in the object file. + + howto->pcrel_offset is added for R_MIPS_PC16, which is + generated for code like + + globl g1 .text + .text + .space 20 + g1: + x: + bal g1 + */ value -= symval; /* Make sure the addend is still non-zero. If it became zero |