Add CRX insns: pushx, popx
[deliverable/binutils-gdb.git] / bfd / elf32-xtensa.c
index 495c275027d5d5e91de4548353bd965182b893d4..c2596625ee3c4105aac9ae0ba80d589d4bc684b3 100644 (file)
@@ -1650,7 +1650,6 @@ bfd_elf_xtensa_reloc (abfd, reloc_entry, symbol, data, input_section,
   bfd_vma relocation;
   bfd_reloc_status_type flag;
   bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
-  bfd_size_type sz;
   bfd_vma output_base = 0;
   reloc_howto_type *howto = reloc_entry->howto;
   asection *reloc_target_output_section;
@@ -1675,8 +1674,7 @@ bfd_elf_xtensa_reloc (abfd, reloc_entry, symbol, data, input_section,
     }
 
   /* Is the address of the relocation really within the section?  */
-  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
-  if (reloc_entry->address > sz / bfd_octets_per_byte (abfd))
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1990,7 +1988,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd,
        }
 
       /* Sanity check the address.  */
-      if (rel->r_offset >= input_section->size
+      if (rel->r_offset >= bfd_get_section_limit (input_bfd, input_section)
          && ELF32_R_TYPE (rel->r_info) != R_XTENSA_NONE)
        {
          bfd_set_error (bfd_error_bad_value);
@@ -2279,10 +2277,7 @@ elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc)
 
   /* Clear the removed bytes.  */
   if ((bfd_size_type) (num * 8) < section_size)
-    {
-      memset (&contents[num * 8], 0, section_size - num * 8);
-      sxtlit->size = num * 8;
-    }
+    memset (&contents[num * 8], 0, section_size - num * 8);
 
   if (! bfd_set_section_contents (output_bfd, sxtlit, contents, 0,
                                  section_size))
This page took 0.024796 seconds and 4 git commands to generate.