]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elfn32-mips.c
bfd/
[thirdparty/binutils-gdb.git] / bfd / elfn32-mips.c
index 973edd52daf735e018dfba52f912f17e50cf187e..dc93e17b8444e015d24bf29e80fd897bc5e4798d 100644 (file)
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003  Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
@@ -1415,6 +1415,7 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
                 void *data, bfd_vma gp)
 {
   bfd_vma relocation;
+  bfd_size_type sz;
   unsigned long val;
 
   if (bfd_is_com_section (symbol->section))
@@ -1425,7 +1426,8 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (reloc_entry->address > sz)
     return bfd_reloc_outofrange;
 
   if (reloc_entry->howto->src_mask == 0)
@@ -1506,6 +1508,7 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
   unsigned short insn = 0;
   bfd_signed_vma val;
   bfd_vma relocation;
+  bfd_size_type sz;
 
   if (output_bfd != NULL)
     relocatable = TRUE;
@@ -1520,7 +1523,8 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
   if (ret != bfd_reloc_ok)
     return ret;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (reloc_entry->address > sz)
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -1760,7 +1764,7 @@ static bfd_boolean
 elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -1776,13 +1780,13 @@ elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 
        /* pr_reg */
        offset = 72;
-       raw_size = 360;
+       size = 360;
 
        break;
     }
 
   /* Make a ".reg/999" section.  */
-  return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size,
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg", size,
                                          note->descpos + offset);
 }