aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJean Marie Diaz <ambar@cygnus>1994-08-02 15:26:26 +0000
committerJean Marie Diaz <ambar@cygnus>1994-08-02 15:26:26 +0000
commit5e694c29a54aa4de49c5b10cfe3382c3e3d04c25 (patch)
treeda9541cf1afaa41f8829959e30c3f4b34555868d /bfd
parente0566e19aa775ec20b2ef3b089deeee071768472 (diff)
downloadfsf-binutils-gdb-5e694c29a54aa4de49c5b10cfe3382c3e3d04c25.zip
fsf-binutils-gdb-5e694c29a54aa4de49c5b10cfe3382c3e3d04c25.tar.gz
fsf-binutils-gdb-5e694c29a54aa4de49c5b10cfe3382c3e3d04c25.tar.bz2
* coff-i960.c (coff_i960_relocate): New function.
(howto_rellong, howto_iprmed): Use it as special_function.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/coff-i960.c37
2 files changed, 35 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 393f0a9..4b901c6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c
index f9b8251..b911f9c 100644
--- a/bfd/coff-i960.c
+++ b/bfd/coff-i960.c
@@ -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);