* bfd-in.h (bfd_get_section_limit): Define.
[deliverable/binutils-gdb.git] / bfd / elf32-sparc.c
index f895220cf813a4643a04373af83b62271b71fb8a..15868eb54d4f9898f641628cd50a8d59262a11db 100644 (file)
@@ -374,7 +374,6 @@ sparc_elf_wdisp16_reloc (abfd,
 {
   bfd_vma relocation;
   bfd_vma x;
-  bfd_size_type sz;
 
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0
@@ -388,8 +387,7 @@ sparc_elf_wdisp16_reloc (abfd,
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
-  if (reloc_entry->address > sz)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -432,7 +430,6 @@ sparc_elf_hix22_reloc (abfd,
 {
   bfd_vma relocation;
   bfd_vma insn;
-  bfd_size_type sz;
 
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0)
@@ -444,8 +441,7 @@ sparc_elf_hix22_reloc (abfd,
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
-  if (reloc_entry->address > sz)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -480,7 +476,6 @@ sparc_elf_lox10_reloc (abfd,
 {
   bfd_vma relocation;
   bfd_vma insn;
-  bfd_size_type sz;
 
   if (output_bfd != (bfd *) NULL
       && (symbol->flags & BSF_SECTION_SYM) == 0)
@@ -492,8 +487,7 @@ sparc_elf_lox10_reloc (abfd,
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
-  if (reloc_entry->address > sz)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
This page took 0.03476 seconds and 4 git commands to generate.