* coff-a29k.c: defined RELOC_PROCESSING to take the #ifdef out of

coffcode.h
	* coffcode.h: use the new macro if available
This commit is contained in:
Steve Chamberlain 1991-12-01 07:37:33 +00:00
parent 9b4f91b556
commit 6cba8f4b78
2 changed files with 41 additions and 10 deletions

View File

@ -1,5 +1,9 @@
Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com) Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
* coff-a29k.c: defined RELOC_PROCESSING to take the #ifdef out of
coffcode.h
* coffcode.h: use the new macro if available
* elf.c (elf_corefile_note): cast malloc to avoid warning. * elf.c (elf_corefile_note): cast malloc to avoid warning.
* Makefile.in: Fixed dependencies due to file rename * Makefile.in: Fixed dependencies due to file rename

View File

@ -230,18 +230,45 @@ static reloc_howto_type howto_table[] =
#define BADMAG(x) A29KBADMAG(x) #define BADMAG(x) A29KBADMAG(x)
/* This macro translates an external r_type field into a pointer to an #define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \
entry in the above table */ reloc_processing(relent, reloc, symbols, abfd, section)
void DEFUN(reloc_processing,(relent,reloc, symbols, abfd, section) ,
arelent *relent AND
struct internal_reloc *reloc AND
asymbol **symbols AND
bfd *abfd AND
asection *section)
{
relent->address = reloc->r_vaddr;
relent->howto = howto_table + reloc->r_type;
if (reloc->r_type == R_IHCONST)
{
relent->addend = reloc->r_symndx;
relent->sym_ptr_ptr= 0;
}
else
{
asymbol *ptr;
relent->sym_ptr_ptr = symbols + obj_convert(abfd)[reloc->r_symndx];
#define RTYPE2HOWTO(cache_ptr, dst) \ ptr = *(relent->sym_ptr_ptr);
if (dst.r_type == R_IHCONST) { \
/* Add in the value which was stored in the symbol index */\ if (ptr
cache_ptr->addend += dst.r_symndx; \ && ptr->the_bfd == abfd
/* Throw away the bogus symbol pointer */ \ && ptr->section != (asection *) NULL
cache_ptr->sym_ptr_ptr = 0; \ && ((ptr->flags & BSF_OLD_COMMON)== 0))
} \ {
cache_ptr->howto = howto_table + dst.r_type; \ relent->addend = -(ptr->section->vma + ptr->value);
}
else
{
relent->addend = 0;
}
relent->address-= section->vma;
relent->section = 0;
}
}
#include "coffcode.h" #include "coffcode.h"