[vms/committed]: Always set vms of absolute sections to 0.

Tristan Gingold gingold@adacore.com
Fri Jun 11 15:30:00 GMT 2010


Hi,

while the sections are read (in vms-alpha.c), they are assigned a vma so that they do not overlap.  Not sure if this is very useful, but for sure we must set the vma of absolute sections to 0.  This is now fixed by this patch.

Tristan.

bfd/
2010-06-11  Tristan Gingold  <gingold@adacore.com>

	* vms-alpha.c (_bfd_vms_slurp_egsd): Always set vma of absolute
	sections to 0.


Index: vms-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-alpha.c,v
retrieving revision 1.23
diff -c -r1.23 vms-alpha.c
*** vms-alpha.c	11 Jun 2010 15:21:15 -0000	1.23
--- vms-alpha.c	11 Jun 2010 15:26:27 -0000
***************
*** 1154,1165 ****
  	    if (!bfd_set_section_flags (abfd, section, new_flags))
  	      return FALSE;
  	    section->alignment_power = egps->align;
! 	    align_addr = (1 << section->alignment_power);
! 	    if ((base_addr % align_addr) != 0)
! 	      base_addr += (align_addr - (base_addr % align_addr));
! 	    section->vma = (bfd_vma)base_addr;
! 	    base_addr += section->size;
! 	    section->filepos = (unsigned int)-1;
  
              /* Append it to the section array.  */
              if (PRIV (section_count) >= PRIV (section_max))
--- 1154,1171 ----
  	    if (!bfd_set_section_flags (abfd, section, new_flags))
  	      return FALSE;
  	    section->alignment_power = egps->align;
!             if ((old_flags & EGPS__V_REL) != 0)
!               {
!                 /* Give a non-overlapping vma to non absolute sections.  */
!                 align_addr = (1 << section->alignment_power);
!                 if ((base_addr % align_addr) != 0)
!                   base_addr += (align_addr - (base_addr % align_addr));
!                 section->vma = (bfd_vma)base_addr;
!                 base_addr += section->size;
!               }
!             else
!               section->vma = 0;
! 	    section->filepos = 0;
  
              /* Append it to the section array.  */
              if (PRIV (section_count) >= PRIV (section_max))



More information about the Binutils mailing list