aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2001-10-01 00:06:58 +0000
committerHans-Peter Nilsson <hp@axis.com>2001-10-01 00:06:58 +0000
commitef17112f8d8a644394d6bab7addff457c0b623fd (patch)
tree222f0fde440e917218f23857b24974bfa93ca503 /gas
parentc7faceac8d0cd58027f9aed573bcdba44f9e5870 (diff)
downloadgdb-ef17112f8d8a644394d6bab7addff457c0b623fd.zip
gdb-ef17112f8d8a644394d6bab7addff457c0b623fd.tar.gz
gdb-ef17112f8d8a644394d6bab7addff457c0b623fd.tar.bz2
* config/tc-sh.c (md_pcrel_from_section): Transformed from
md_pcrel_from. Handle pc-relativeness against link-time symbol. Handle relativeness to elsewhere than the fixup.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-sh.c16
2 files changed, 21 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 250b8ee..a31a459 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2001-09-17 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/tc-sh.c (md_pcrel_from_section): Transformed from
+ md_pcrel_from. Handle pc-relativeness against link-time
+ symbol. Handle relativeness to elsewhere than the fixup.
+
2001-09-30 Hans-Peter Nilsson <hp@bitrange.com>
* Makefile.am: Update dependencies with "make dep-am".
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index b574e68..46eafdd 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -3108,9 +3108,23 @@ md_number_to_chars (ptr, use, nbytes)
}
long
-md_pcrel_from (fixP)
+md_pcrel_from_section (fixP, sec)
fixS *fixP;
+ segT sec;
{
+ if (fixP->fx_addsy != (symbolS *) NULL
+ && (! S_IS_DEFINED (fixP->fx_addsy)
+ || S_IS_EXTERN (fixP->fx_addsy)
+ || S_IS_WEAK (fixP->fx_addsy)
+ || S_GET_SEGMENT (fixP->fx_addsy) != sec))
+ {
+ /* The symbol is undefined (or is defined but not in this section,
+ or we're not sure about it being the final definition). Let the
+ linker figure it out. We need to adjust the subtraction of a
+ symbol to the position of the relocated data, though. */
+ return fixP->fx_subsy ? fixP->fx_where + fixP->fx_frag->fr_address : 0;
+ }
+
return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address + 2;
}