BFD_ASSERT (abfd->xvec->header_byteorder_big_p == false);
BFD_ASSERT (bfd_little_endian (abfd));
nlm_alpha_write_import (abfd, sec, rel)     bfd *abfd;     asection *sec;     arelent *rel;{  asymbol *sym;  bfd_vma r_vaddr;  long r_symndx;  int r_type, r_extern, r_offset, r_size;  struct nlm32_alpha_external_reloc ext;  sym = *rel->sym_ptr_ptr;  /* Get values for the relocation fields.  */  r_type = rel->howto->type;  if (r_type != ALPHA_R_NW_RELOC)    {      r_vaddr = bfd_get_section_vma (abfd, sec) + rel->address;      if ((sec->flags & SEC_CODE) == 0)	r_vaddr += bfd_section_size (abfd,				     bfd_get_section_by_name (abfd,							      NLM_CODE_NAME));      if (bfd_is_und_section (bfd_get_section (sym)))	{	  r_extern = 1;	  r_symndx = 0;	}      else	{	  r_extern = 0;	  if (bfd_get_section_flags (abfd, bfd_get_section (sym)) & SEC_CODE)	    r_symndx = ALPHA_RELOC_SECTION_TEXT;	  else	    r_symndx = ALPHA_RELOC_SECTION_DATA;	}      r_offset = 0;      r_size = 0;      switch (r_type)	{	case ALPHA_R_LITUSE:	case ALPHA_R_GPDISP:	  r_symndx = rel->addend;	  break;	case ALPHA_R_OP_STORE:	  r_size = rel->addend & 0xff;	  r_offset = (rel->addend >> 8) & 0xff;	  break;	case ALPHA_R_OP_PUSH:	case ALPHA_R_OP_PSUB:	case ALPHA_R_OP_PRSHIFT:	  r_vaddr = rel->addend;	  break;	case ALPHA_R_IGNORE:	  r_vaddr = rel->address;	  break;	default:	  break;	}    }  else    {      /* r_type == ALPHA_R_NW_RELOC */      r_vaddr = rel->address;      if (rel->addend == 0)	{	  r_symndx = 0;	  r_size = ALPHA_R_NW_RELOC_SETGP;	}      else	{	  r_symndx = rel->addend - 1;	  r_size = ALPHA_R_NW_RELOC_LITA;	}      r_extern = 0;      r_offset = 0;    }  /* Swap out the relocation fields.  */  bfd_h_put_64 (abfd, r_vaddr, (bfd_byte *) ext.r_vaddr);  bfd_h_put_32 (abfd, r_symndx, (bfd_byte *) ext.r_symndx);  BFD_ASSERT (abfd->xvec->header_byteorder_big_p == false);  ext.r_bits[0] = ((r_type << RELOC_BITS0_TYPE_SH_LITTLE)		   & RELOC_BITS0_TYPE_LITTLE);  ext.r_bits[1] = ((r_extern ? RELOC_BITS1_EXTERN_LITTLE : 0)		   | ((r_offset << RELOC_BITS1_OFFSET_SH_LITTLE)		      & RELOC_BITS1_OFFSET_LITTLE));  ext.r_bits[2] = 0;  ext.r_bits[3] = ((r_size << RELOC_BITS3_SIZE_SH_LITTLE)		   & RELOC_BITS3_SIZE_LITTLE);  /* Write out the relocation.  */  if (bfd_write (&ext, sizeof ext, 1, abfd) != sizeof ext)    return false;  return true;}