* config/tc-mips.c (md_apply_fix): If this is an undefined symbol,
authorIan Lance Taylor <ian@airs.com>
Fri, 4 Feb 1994 02:32:54 +0000 (02:32 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 4 Feb 1994 02:32:54 +0000 (02:32 +0000)
subtract the value from fx_addnumber to since
bfd_perform_relocation is going to add it in.

gas/ChangeLog
gas/config/tc-mips.c

index 322fafa7bcdb5ca5e1e14b6eec9433fe12510917..305b19a259f90318ba72ab73972814e9669542f3 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb  3 21:29:42 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
+
+       * config/tc-mips.c (md_apply_fix): If this is an undefined symbol,
+       subtract the value from fx_addnumber to since
+       bfd_perform_relocation is going to add it in.
+
 Wed Feb  2 13:55:08 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
 
        * Makefile.in:  Avoid bug in losing hpux sed.
index d99f2a11dea9035feb150974a7b3482813b2dcf5..1305857a3804cada1cd7d536b74486c17c487e9d 100644 (file)
@@ -4750,6 +4750,14 @@ md_apply_fix (fixP, valueP)
   value = *valueP;
   fixP->fx_addnumber = value;  /* Remember value for tc_gen_reloc */
 
+  /* bfd_perform_relocation is going to add in the symbol value.  If
+     this is an external symbol, it will have a non-zero value, but we
+     do not want to add in.  Therefore, we subtract it out of
+     fx_addnumber.  FIXME: relocations in gas are very confusing.  */
+  if (fixP->fx_addsy != (symbolS *) NULL
+      && fixP->fx_addsy->ecoff_undefined)
+    fixP->fx_addnumber -= S_GET_VALUE (fixP->fx_addsy);
+
   switch (fixP->fx_r_type)
     {
     case BFD_RELOC_32:
This page took 0.034104 seconds and 4 git commands to generate.