aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-m32r.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-11-29 15:09:28 +0000
committerNick Clifton <nickc@redhat.com>2004-11-29 15:09:28 +0000
commita7498ae6da27216b89836d96a72ce166ef883030 (patch)
tree36601ceb21230e79520ace3aeb6c9c948238b6a5 /gas/config/tc-m32r.c
parent68800d83aefc1d6651260898e7b2c9b2323f0aa5 (diff)
downloadgdb-a7498ae6da27216b89836d96a72ce166ef883030.zip
gdb-a7498ae6da27216b89836d96a72ce166ef883030.tar.gz
gdb-a7498ae6da27216b89836d96a72ce166ef883030.tar.bz2
Fixed a pcrel relocte miss between different section in the same module.
Diffstat (limited to 'gas/config/tc-m32r.c')
-rw-r--r--gas/config/tc-m32r.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 207ac01..f7a9537 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -1999,6 +1999,12 @@ md_pcrel_from_section (fixP, sec)
|| S_IS_EXTERNAL (fixP->fx_addsy)
|| S_IS_WEAK (fixP->fx_addsy)))
{
+ if (S_GET_SEGMENT (fixP->fx_addsy) != sec
+ && S_IS_DEFINED (fixP->fx_addsy)
+ && ! S_IS_EXTERNAL (fixP->fx_addsy)
+ && ! S_IS_WEAK (fixP->fx_addsy))
+ return fixP->fx_offset;
+
/* The symbol is undefined (or is defined but not in this section).
Let the linker figure it out. */
return 0;
@@ -2488,7 +2494,7 @@ printf(" => %s\n",reloc->howto->name);
&& ! S_IS_EXTERNAL(fixP->fx_addsy)
&& ! S_IS_WEAK(fixP->fx_addsy))
/* Already used fx_offset in the opcode field itseld. */
- reloc->addend = 0;
+ reloc->addend = fixP->fx_offset;
else
reloc->addend = fixP->fx_addnumber;