* coff-i960.c (coff_i960_relocate): New function.
authorJean Marie Diaz <ambar@cygnus>
Tue, 2 Aug 1994 15:26:26 +0000 (15:26 +0000)
committerJean Marie Diaz <ambar@cygnus>
Tue, 2 Aug 1994 15:26:26 +0000 (15:26 +0000)
(howto_rellong, howto_iprmed): Use it as special_function.

bfd/ChangeLog
bfd/coff-i960.c

index 393f0a97dee7202512cd3de2c774db83702e89cf..4b901c6f91b5c6cf86aa5bcbd2f45ed35dea8e50 100644 (file)
@@ -1,5 +1,8 @@
 Tue Aug  2 10:43:21 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
+       * coff-i960.c (coff_i960_relocate): New function.
+       (howto_rellong, howto_iprmed): Use it as special_function.
+
        * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
        bfd_tell, bfd_flush, and bfd_stat from here...
        * bfd-in.h: ...to here, to make them visible to programs which
index f9b82511954f03614f800811ee6f926db1701756..b911f9c802c44eccedd71d41fabec8c9f6fb3171 100644 (file)
@@ -31,7 +31,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 static bfd_reloc_status_type optcall_callback
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-       
+static bfd_reloc_status_type coff_i960_relocate
+  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+
 #define COFF_LONG_FILENAMES
 
 #define CALLS   0x66003800     /* Template for 'calls' instruction     */
@@ -105,13 +107,38 @@ optcall_callback (abfd, reloc_entry, symbol_in, data,
   return result;
 }
 
+/* When generating relocateable output, we don't want to do anything
+   for a reloc against a globally visible symbol.  */
+
+static bfd_reloc_status_type 
+coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section,
+                   output_bfd, error_message)
+     bfd *abfd;
+     arelent *reloc_entry;
+     asymbol *symbol;
+     PTR data;
+     asection *input_section;
+     bfd *output_bfd;
+     char **error_message;
+{
+  if (output_bfd != (bfd *) NULL
+      && (symbol->flags & BSF_SECTION_SYM) == 0
+      && reloc_entry->addend == 0)
+    {
+      reloc_entry->address += input_section->output_offset;
+      return bfd_reloc_ok;
+    }
+
+  return bfd_reloc_continue;
+}
+
 static reloc_howto_type howto_rellong =
   HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,false, 0,
-        complain_overflow_bitfield, 0,"rellong", true, 0xffffffff,
-        0xffffffff, 0);
+        complain_overflow_bitfield, coff_i960_relocate,"rellong", true,
+        0xffffffff, 0xffffffff, 0);
 static reloc_howto_type howto_iprmed =
-  HOWTO (R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed,0,
-        "iprmed ", true, 0x00ffffff, 0x00ffffff, 0);
+  HOWTO (R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed,
+        coff_i960_relocate, "iprmed ", true, 0x00ffffff, 0x00ffffff, 0);
 static reloc_howto_type howto_optcall =
   HOWTO (R_OPTCALL, 0,2,24,true,0, complain_overflow_signed,
         optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff, 0);
This page took 0.028813 seconds and 4 git commands to generate.