|| S_IS_EXTERNAL (fixp->fx_addsy))
|| S_IS_EXTERNAL (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
tc_gen_reloc (section, fixp)     asection *section;     fixS *fixp;{  arelent *reloc;  bfd_reloc_code_real_type code;  reloc = (arelent *) bfd_alloc_by_size_t (stdoutput, sizeof (arelent));  assert (reloc != 0);  reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;  reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;  switch (fixp->fx_r_type)    {    case BFD_RELOC_16:    case BFD_RELOC_32:    case BFD_RELOC_HI22:    case BFD_RELOC_LO10:    case BFD_RELOC_32_PCREL_S2:    case BFD_RELOC_SPARC13:    case BFD_RELOC_SPARC_BASE13:    case BFD_RELOC_SPARC_WDISP16:    case BFD_RELOC_SPARC_WDISP19:    case BFD_RELOC_SPARC_WDISP22:    case BFD_RELOC_64:    case BFD_RELOC_SPARC_10:    case BFD_RELOC_SPARC_11:    case BFD_RELOC_SPARC_HH22:    case BFD_RELOC_SPARC_HM10:    case BFD_RELOC_SPARC_LM22:    case BFD_RELOC_SPARC_PC_HH22:    case BFD_RELOC_SPARC_PC_HM10:    case BFD_RELOC_SPARC_PC_LM22:      code = fixp->fx_r_type;      break;    default:      abort ();    }#if defined (OBJ_ELF) || defined (OBJ_AOUT)  /* If we are generating PIC code, we need to generate a different     set of relocs.  */#ifdef OBJ_ELF#define GOT_NAME "_GLOBAL_OFFSET_TABLE_"#else#define GOT_NAME "__GLOBAL_OFFSET_TABLE_"#endif  if (sparc_pic_code)    {      switch (code)	{	case BFD_RELOC_32_PCREL_S2:	  if (! S_IS_DEFINED (fixp->fx_addsy)	      || S_IS_EXTERNAL (fixp->fx_addsy))	    code = BFD_RELOC_SPARC_WPLT30;	  break;	case BFD_RELOC_HI22:	  if (fixp->fx_addsy != NULL	      && strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)	    code = BFD_RELOC_SPARC_PC22;	  else	    code = BFD_RELOC_SPARC_GOT22;	  break;	case BFD_RELOC_LO10:	  if (fixp->fx_addsy != NULL	      && strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)	    code = BFD_RELOC_SPARC_PC10;	  else	    code = BFD_RELOC_SPARC_GOT10;	  break;	case BFD_RELOC_SPARC13:	  code = BFD_RELOC_SPARC_GOT13;	  break;	default:	  break;	}    }#endif /* defined (OBJ_ELF) || defined (OBJ_AOUT) */  reloc->howto = bfd_reloc_type_lookup (stdoutput, code);  if (reloc->howto == 0)    {      as_bad_where (fixp->fx_file, fixp->fx_line,		    "internal error: can't export reloc type %d (`%s')",		    fixp->fx_r_type, bfd_get_reloc_code_name (code));      return 0;    }  /* @@ Why fx_addnumber sometimes and fx_offset other times?  */#ifdef OBJ_AOUT  if (reloc->howto->pc_relative == 0      || code == BFD_RELOC_SPARC_PC10      || code == BFD_RELOC_SPARC_PC22)    reloc->addend = fixp->fx_addnumber;  else    reloc->addend = fixp->fx_offset - reloc->address;#else /* elf or coff */  if (reloc->howto->pc_relative == 0      || code == BFD_RELOC_SPARC_PC10      || code == BFD_RELOC_SPARC_PC22)    reloc->addend = fixp->fx_addnumber;  else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)    reloc->addend = (section->vma		     + fixp->fx_addnumber		     + md_pcrel_from (fixp));  else    reloc->addend = fixp->fx_offset;#endif  return reloc;}