[gnu.g++.bug] fix for sparc alignment problems

jjc@UUNET.UU.NET (James Clark) (05/11/89)

Here are the patches needed to newld.c to make it align doubles
properly on the sparc (these are straight from the old ld.c):

*** newld.c.distrib	Thu May 11 10:33:27 1989
--- newld.c	Thu May 11 11:06:28 1989
***************
*** 2838,2843 ****
--- 2838,2847 ----
  
    outheader.a_text = text_size;
  
+ #ifdef sparc
+   data_size = (data_size + sizeof(double) - 1) & ~(sizeof(double)-1);
+ #endif
+ 
    /* Make the data segment address start in memory on a suitable boundary.  */
  
    if (! Tdata_flag_specified)
***************
*** 2926,2931 ****
--- 2930,2946 ----
  		  com = (com + sizeof (int) - 1) & (- sizeof (int));
  
  		  sp->value = data_start + data_size + bss_size;
+ #ifdef sparc
+ 		  /* Make common space aligned.  */
+ 		  if (com > 4)
+ 		    {
+ 		      int off = 0;
+ 
+ 		      off = sp->value & (sizeof (double) - 1);
+ 		      sp->value += off;
+ 		      com += off;
+ 		    }
+ #endif
  		  sp->defined = N_BSS | N_EXT;
  		  bss_size += com;
  		  if (write_map)

James Clark
jjc@jclark.uucp