OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [bfd/] [elf32-rx.c] - Diff between revs 163 and 166

Show entire file | Details | Blame | View Log

Rev 163 Rev 166
Line 30... Line 30...
 
 
/* This is a meta-target that's used only with objcopy, to avoid the
/* This is a meta-target that's used only with objcopy, to avoid the
   endian-swap we would otherwise get.  We check for this in
   endian-swap we would otherwise get.  We check for this in
   rx_elf_object_p().  */
   rx_elf_object_p().  */
const bfd_target bfd_elf32_rx_be_ns_vec;
const bfd_target bfd_elf32_rx_be_ns_vec;
 
const bfd_target bfd_elf32_rx_be_vec;
 
 
#ifdef DEBUG
#ifdef DEBUG
char * rx_get_reloc (long);
char * rx_get_reloc (long);
void rx_dump_symtab (bfd *, void *, void *);
void rx_dump_symtab (bfd *, void *, void *);
#endif
#endif
Line 2112... Line 2113...
          /* Special case DSP:5 format: MOV.bwl dsp:5[Rsrc],Rdst.  */
          /* Special case DSP:5 format: MOV.bwl dsp:5[Rsrc],Rdst.  */
          else if (code == 1 && symval/scale <= 31
          else if (code == 1 && symval/scale <= 31
                   /* Decodable bits.  */
                   /* Decodable bits.  */
                   && (insn[0] & 0xcc) == 0xcc
                   && (insn[0] & 0xcc) == 0xcc
                   /* Width.  */
                   /* Width.  */
                   && (insn[0] & 0x30) != 3
                   && (insn[0] & 0x30) != 0x30
                   /* Register MSBs.  */
                   /* Register MSBs.  */
                   && (insn[1] & 0x88)  == 0x00)
                   && (insn[1] & 0x88)  == 0x00)
            {
            {
              int newrel = 0;
              int newrel = 0;
 
 
Line 2216... Line 2217...
          /* Special case DSP:5 format: MOV.bwl Rsrc,dsp:5[Rdst] */
          /* Special case DSP:5 format: MOV.bwl Rsrc,dsp:5[Rdst] */
          else if (code == 1 && symval/scale <= 31
          else if (code == 1 && symval/scale <= 31
                   /* Decodable bits.  */
                   /* Decodable bits.  */
                   && (insn[0] & 0xc3) == 0xc3
                   && (insn[0] & 0xc3) == 0xc3
                   /* Width.  */
                   /* Width.  */
                   && (insn[0] & 0x30) != 3
                   && (insn[0] & 0x30) != 0x30
                   /* Register MSBs.  */
                   /* Register MSBs.  */
                   && (insn[1] & 0x88)  == 0x00)
                   && (insn[1] & 0x88)  == 0x00)
            {
            {
              int newrel = 0;
              int newrel = 0;
 
 
Line 3026... Line 3027...
  int i;
  int i;
  unsigned int u;
  unsigned int u;
  Elf_Internal_Phdr *phdr = elf_tdata (abfd)->phdr;
  Elf_Internal_Phdr *phdr = elf_tdata (abfd)->phdr;
  int nphdrs = elf_elfheader (abfd)->e_phnum;
  int nphdrs = elf_elfheader (abfd)->e_phnum;
  sec_ptr bsec;
  sec_ptr bsec;
 
  static int saw_be = FALSE;
 
 
  /* We never want to automatically choose the non-swapping big-endian
  /* We never want to automatically choose the non-swapping big-endian
     target.  The user can only get that explicitly, such as with -I
     target.  The user can only get that explicitly, such as with -I
     and objcopy.  */
     and objcopy.  */
  if (abfd->xvec == &bfd_elf32_rx_be_ns_vec
  if (abfd->xvec == &bfd_elf32_rx_be_ns_vec
      && abfd->target_defaulted)
      && abfd->target_defaulted)
    return FALSE;
    return FALSE;
 
 
 
  /* BFD->target_defaulted is not set to TRUE when a target is chosen
 
     as a fallback, so we check for "scanning" to know when to stop
 
     using the non-swapping target.  */
 
  if (abfd->xvec == &bfd_elf32_rx_be_ns_vec
 
      && saw_be)
 
    return FALSE;
 
  if (abfd->xvec == &bfd_elf32_rx_be_vec)
 
    saw_be = TRUE;
 
 
  bfd_default_set_arch_mach (abfd, bfd_arch_rx,
  bfd_default_set_arch_mach (abfd, bfd_arch_rx,
                             elf32_rx_machine (abfd));
                             elf32_rx_machine (abfd));
 
 
  /* For each PHDR in the object, we must find some section that
  /* For each PHDR in the object, we must find some section that
     corresponds (based on matching file offsets) and use its VMA
     corresponds (based on matching file offsets) and use its VMA
Line 3071... Line 3082...
      /* We must update the bfd sections as well, so we don't stop
      /* We must update the bfd sections as well, so we don't stop
         with one match.  */
         with one match.  */
      bsec = abfd->sections;
      bsec = abfd->sections;
      while (bsec)
      while (bsec)
        {
        {
          if (phdr[i].p_vaddr <= bsec->lma
          if (phdr[i].p_vaddr <= bsec->vma
              && bsec->vma <= phdr[i].p_vaddr + (phdr[i].p_filesz - 1))
              && bsec->vma <= phdr[i].p_vaddr + (phdr[i].p_filesz - 1))
            {
            {
              bsec->lma = phdr[i].p_paddr + (bsec->vma - phdr[i].p_vaddr);
              bsec->lma = phdr[i].p_paddr + (bsec->vma - phdr[i].p_vaddr);
            }
            }
          bsec = bsec->next;
          bsec = bsec->next;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.