This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vms/committed] bfd/vms-alpha.c don't crash if relocs in absolute section


Hi,

vms-alpha.c crashed if there was relocs in absolute sections (which isn't allowed).
Add a guard to avoid the crash.

Committed on trunk.

Tristan.

bfd/
2011-06-24  Tristan Gingold  <gingold@adacore.com>

	* vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the
	absolute section.


RCS file: /cvs/src/src/bfd/vms-alpha.c,v
retrieving revision 1.47
diff -c -r1.47 vms-alpha.c
*** bfd/vms-alpha.c	13 Jun 2011 00:59:15 -0000	1.47
--- bfd/vms-alpha.c	24 Jun 2011 15:20:38 -0000
***************
*** 5106,5112 ****
--- 5106,5119 ----
                  (*_bfd_error_handler) (_("Invalid section index in ETIR"));
                  return FALSE;
                }
+ 
              sec = PRIV (sections)[cur_psect];
+             if (sec == bfd_abs_section_ptr)
+               {
+                 (*_bfd_error_handler) (_("Relocation for non-REL psect"));
+                 return FALSE;
+               }
+ 
              vms_sec = vms_section_data (sec);
  
              /* Allocate a reloc entry.  */
***************
*** 5117,5123 ****
                      vms_sec->reloc_max = 64;
                      sec->relocation = bfd_zmalloc
                        (vms_sec->reloc_max * sizeof (arelent));
!                 }
                  else
                    {
                      vms_sec->reloc_max *= 2;
--- 5124,5130 ----
                      vms_sec->reloc_max = 64;
                      sec->relocation = bfd_zmalloc
                        (vms_sec->reloc_max * sizeof (arelent));
!                   }
                  else
                    {
                      vms_sec->reloc_max *= 2;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]