Article View: gnu.g++.bug
Article #1982fix for sparc alignment problems
From: James Clark
Date: Thu, 11 May 1989 10:16
Date: Thu, 11 May 1989 10:16
41 lines
1453 bytes
1453 bytes
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
Technical Details
Message-ID:
<8905111016.AA25086@jclark.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!jclark!jjcShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!jclark!jjc From: jclark!jjc@UUNET.UU.NET (James Clark) Newsgroups: gnu.g++.bug Subject: fix for sparc alignment problems Message-ID: <8905111016.AA25086@jclark.uucp> Date: 11 May 89 10:16:46 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41