From: Jeff Law Date: Thu, 30 Aug 2001 20:15:06 +0000 (+0000) Subject: Thu Aug 30 12:05:13 2001 J"orn Rennecke X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f333765ffdd8e9928ff398b02dd04c8938f507cb;p=binutils-gdb.git Thu Aug 30 12:05:13 2001 J"orn Rennecke * tc-h8300.c (tc_crawl_symbol_chain, tc_headers_hook): Don't define for BFD_ASSEMBLER. (tc_reloc_mangle): Likewise. (tc_gen_reloc): New function for BFD_ASSEMBLER. More of Joern's patches with minor changes s/OBJ_ELF/BFD_ASSEMBLER/ --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 732d60f7161..05b2b4f1dea 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +Thu Aug 30 12:05:13 2001 J"orn Rennecke + + * tc-h8300.c (tc_crawl_symbol_chain, tc_headers_hook): Don't + define for BFD_ASSEMBLER. + (tc_reloc_mangle): Likewise. + (tc_gen_reloc): New function for BFD_ASSEMBLER. + Wed Aug 29 12:49:58 2001 Jeffrey A Law (law@cygnus.com) * config/tc-h8300.c (h8300hmode): Record the machine type diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index 1965ba33a5a..6775d928945 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -1329,12 +1329,14 @@ md_assemble (str) build_bytes (opcode, operand); } +#ifndef OBJ_ELF void tc_crawl_symbol_chain (headers) object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_crawl_symbol_chain \n")); } +#endif symbolS * md_undefined_symbol (name) @@ -1343,12 +1345,14 @@ md_undefined_symbol (name) return 0; } +#ifndef OBJ_ELF void tc_headers_hook (headers) object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_headers_hook \n")); } +#endif /* Various routines to kill one day */ /* Equal to MAX_PRECISION in atof-ieee.c */ @@ -1576,3 +1580,37 @@ tc_reloc_mangle (fix_ptr, intr, base) else intr->r_symndx = -1; } +#else /* OBJ_ELF */ +arelent * +tc_gen_reloc (section, fixp) + asection *section ATTRIBUTE_UNUSED; + fixS *fixp; +{ + arelent *rel; + bfd_reloc_code_real_type r_type; + + rel = (arelent *) xmalloc (sizeof (arelent)); + rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + rel->address = fixp->fx_frag->fr_address + fixp->fx_where; + rel->addend = fixp->fx_offset; + + r_type = fixp->fx_r_type; + +#define DEBUG 0 +#if DEBUG + fprintf (stderr, "%s\n", bfd_get_reloc_code_name (r_type)); + fflush(stderr); +#endif + rel->howto = bfd_reloc_type_lookup (stdoutput, r_type); + if (rel->howto == NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("Cannot represent relocation type %s"), + bfd_get_reloc_code_name (r_type)); + return NULL; + } + + return rel; +} +#endif