bfd/
[deliverable/binutils-gdb.git] / bfd / elf32-mips.c
index 2e6eeb9f5d0aa9cacfc39b575582f8d661ebb45c..188fa1c0c3fa8ff4c141defd9e74565a39f5ac5a 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>.
@@ -824,6 +824,7 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
 {
   bfd_vma relocation;
   bfd_vma val;
+  bfd_size_type sz;
 
   if (bfd_is_com_section (symbol->section))
     relocation = 0;
@@ -833,7 +834,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;
 
   /* Set val to the offset into the section or symbol.  */
@@ -941,6 +943,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 we're relocating, and this is an external symbol, we don't want
      to change anything.  */
@@ -965,7 +968,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))
@@ -1209,7 +1213,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)
     {
@@ -1225,14 +1229,14 @@ elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 
        /* pr_reg */
        offset = 72;
-       raw_size = 180;
+       size = 180;
 
        break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-                                         raw_size, note->descpos + offset);
+                                         size, note->descpos + offset);
 }
 
 static bfd_boolean
This page took 0.026952 seconds and 4 git commands to generate.