aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-a29k.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coff-a29k.c')
-rw-r--r--bfd/coff-a29k.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c
index ef41bdb..7161d40 100644
--- a/bfd/coff-a29k.c
+++ b/bfd/coff-a29k.c
@@ -28,6 +28,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "coff/internal.h"
#include "libcoff.h"
+static long get_symbol_value PARAMS ((asymbol *));
+static bfd_reloc_status_type a29k_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+
#define INSERT_HWORD(WORD,HWORD) \
(((WORD) & 0xff00ff00) | (((HWORD) & 0xff00) << 8) | ((HWORD)& 0xff))
#define EXTRACT_HWORD(WORD) \
@@ -36,9 +40,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
((HWORD) & 0x8000 ? (HWORD)|0xffff0000 : (HWORD))
/* Provided the symbol, returns the value reffed */
-static long
-get_symbol_value(symbol)
-asymbol *symbol;
+static long
+get_symbol_value (symbol)
+ asymbol *symbol;
{
long relocation = 0;
@@ -59,13 +63,15 @@ asymbol *symbol;
/* this function is in charge of performing all the 29k relocations */
static bfd_reloc_status_type
-DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd),
- bfd *abfd AND
- arelent *reloc_entry AND
- asymbol *symbol_in AND
- PTR data AND
- asection *input_section AND
- bfd *output_bfd)
+a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol_in;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
{
/* the consth relocation comes in two parts, we have to remember
the state between calls, in these variables */
@@ -103,9 +109,8 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
if ((part1_consth_active) && (r_type != R_IHCONST))
{
- fprintf(stderr,"Relocation problem : ");
- fprintf(stderr,"Missing IHCONST in module %s\n",abfd->filename);
part1_consth_active = false;
+ *error_message = (char *) "Missing IHCONST";
return(bfd_reloc_dangerous);
}
@@ -133,7 +138,7 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
signed_value -= (input_section->output_section->vma
+ input_section->output_offset);
if (signed_value>0x1ffff || signed_value<-0x20000)
- return(bfd_reloc_outofrange);
+ return(bfd_reloc_overflow);
}
signed_value >>= 2;
insn = INSERT_HWORD(insn, signed_value);
@@ -159,9 +164,7 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
/* consth, part 2
Now relocate the reference */
if (part1_consth_active == false) {
- fprintf(stderr,"Relocation problem : ");
- fprintf(stderr,"IHIHALF missing in module %s\n",
- abfd->filename);
+ *error_message = (char *) "Missing IHIHALF";
return(bfd_reloc_dangerous);
}
/* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */
@@ -202,9 +205,7 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
bfd_put_32(abfd, insn, hit_data);
break;
default:
- fprintf(stderr,"Relocation problem : ");
- fprintf(stderr,"Unrecognized reloc type %d, in module %s\n",
- r_type,abfd->filename);
+ *error_message = "Unrecognized reloc";
return (bfd_reloc_dangerous);
}