Dlltool fix - do not munge padding entries in .reloc section

Nick Clifton nickc@cygnus.com
Thu Nov 18 10:35:00 GMT 1999


Hi Guys

  Does anyone have any objections to my applying the following small
  patch ?  It prevents flush_page() from munging padding entries in
  the .reloc section so that they come out as 0x0.  (Without the patch
  they come out as 0xf000, which is an illegal entry).

Cheers
	Nick


1999-11-18  Nick Clifton  <nickc@cygnus.com>

	* dlltool.c (flush_page): Do not munge padding entries in the
	.reloc section.

Index: binutils/dlltool.c
===================================================================
RCS file: /cvs/binutils/binutils/binutils/dlltool.c,v
retrieving revision 1.16
diff -p -r1.16 dlltool.c
*** dlltool.c	1999/11/03 18:16:52	1.16
--- dlltool.c	1999/11/18 18:32:52
*************** flush_page (f, need, page_addr, on_page)
*** 1574,1581 ****
  	   ASM_C);
    
    for (i = 0; i < on_page; i++)
!     fprintf (f, "\t%s\t0x%lx\n", ASM_SHORT,
! 	     ((need[i] - page_addr) | 0x3000) & 0xffff);
  
    /* And padding */
    if (on_page & 1)
--- 1574,1587 ----
  	   ASM_C);
    
    for (i = 0; i < on_page; i++)
!     {
!       long needed = need[i];
!       
!       if (needed)
! 	needed = ((needed - page_addr) | 0x3000) & 0xffff;
!   
!       fprintf (f, "\t%s\t0x%lx\n", ASM_SHORT, needed);
!     }
  
    /* And padding */
    if (on_page & 1)


More information about the Binutils mailing list