diff mc-code-powerpc.c @ 544:dbfd6e88e2c3 s-dandy-ok

s-dandy compile OK
author kono
date Mon, 02 Jan 2006 12:55:17 +0900
parents 492f06738550
children 293f827ccfb2
line wrap: on
line diff
--- a/mc-code-powerpc.c	Mon Jan 02 09:49:35 2006 +0900
+++ b/mc-code-powerpc.c	Mon Jan 02 12:55:17 2006 +0900
@@ -351,7 +351,7 @@
 {
     char *rn;
     if (!large_offset_reg) {
-	if (fnptr->sc==CODE) {
+	if (is_code(fnptr)) {
 	    if (l>=ARG_LVAR_OFFSET) {  /* caller's arguments */
 		printf("lo16(%d)(r1)\n",CODE_CALLER_ARG);
 	    } else
@@ -365,7 +365,7 @@
 	}
     } else {
         rn = register_name(large_offset_reg);
-        if (fnptr->sc==CODE) {
+        if (is_code(fnptr)) {
             if (l>=ARG_LVAR_OFFSET) {  /* caller's arguments */
                 printf("lo16(%d)(%s)\n",CODE_CALLER_ARG,rn);
             } else
@@ -395,7 +395,7 @@
 {
     char *rn;
     large_offset_reg=0;
-    if (fnptr->sc==CODE) {
+    if (is_code(fnptr)) {
         if (l>=ARG_LVAR_OFFSET) {  /* caller's arguments */
             if (LARGE_OFFSET(CODE_CALLER_ARG)) {
                 rn=register_name(large_offset_reg=get_register());
@@ -1108,7 +1108,7 @@
 code_ptr_cache_def(int r,NMTBL *nptr)
 {
     char *rrn = register_name(r);
-    if (nptr->sc==STATIC) {
+    if (nptr->sc==STATIC && !(is_code(nptr)||is_function(nptr))) {
 	printf("\taddis %s,r31,ha16(_%s-L_%d)\n",
 		 rrn,nptr->nm,code_base);
 	printf("\tla %s,lo16(_%s-L_%d)(%s)\n",
@@ -3173,6 +3173,7 @@
 	    printf(".comm _%s,%d\n",n->nm,size(n->ty));
 	} else if ((n->sc==STATIC) && n->dsp != -1) {
 	    /* n->dsp = -1 means initialized global */
+	    if (is_code(n)||is_function(n)) continue;
 	    if (init==0) {
 		data_mode(0);
 		init=1;
@@ -3203,7 +3204,7 @@
 printf("L_%s$lazy_ptr:\n",extrn);
 printf("\t.indirect_symbol _%s\n",extrn);
 printf("\t.long dyld_stub_binding_helper\n");
-	    } else if (n->sc==FUNCTION||n->sc==CODE) {
+	    } else if (n->sc==STATIC) {
 		text_mode(0);
 printf("\t.set L_%s$stub,_%s\n",extrn,extrn);
 		data_mode(0);