$OpenBSD: patch-language_modula3_m3compiler_m3cc_gcc_config_i386_i386_c,v 1.2 2004/01/04 22:35:01 espie Exp $
--- language/modula3/m3compiler/m3cc/gcc/config/i386/i386.c.orig	1997-02-06 22:32:29.000000000 +0100
+++ language/modula3/m3compiler/m3cc/gcc/config/i386/i386.c	2004-01-04 22:46:59.000000000 +0100
@@ -1785,7 +1785,7 @@ function_prologue (file, size)
       xops[1] = pic_label_rtx;
 
       output_asm_insn (AS1 (call,%P1), xops);
-      output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_,%0", xops);
+      output_asm_insn ("addl $%__GLOBAL_OFFSET_TABLE_,%0", xops);
     }
   else if (pic_reg_used)
     {
@@ -1795,7 +1795,7 @@ function_prologue (file, size)
       output_asm_insn (AS1 (call,%P1), xops);
       ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (xops[1]));
       output_asm_insn (AS1 (pop%L0,%0), xops);
-      output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops);
+      output_asm_insn ("addl $%__GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops);
   } 
 }
 
@@ -1893,7 +1893,11 @@ ix86_expand_prologue ()
 
       emit_insn (gen_prologue_get_pc (xops[0], gen_rtx (CONST_INT, Pmode, CODE_LABEL_NUMBER(xops[1]))));
       emit_insn (gen_prologue_set_got (xops[0], 
+#ifdef YES_UNDERSCORES
+		 gen_rtx (SYMBOL_REF, Pmode, "$__GLOBAL_OFFSET_TABLE_"), 
+#else
 		 gen_rtx (SYMBOL_REF, Pmode, "$_GLOBAL_OFFSET_TABLE_"), 
+#endif
 		 gen_rtx (CONST_INT, Pmode, CODE_LABEL_NUMBER(xops[1]))));
     }
   else if (pic_reg_used)
@@ -1904,7 +1908,11 @@ ix86_expand_prologue ()
       emit_insn (gen_prologue_get_pc (xops[0], gen_rtx (CONST_INT, Pmode, CODE_LABEL_NUMBER(xops[1]))));
       emit_insn (gen_pop (xops[0]));
       emit_insn (gen_prologue_set_got (xops[0], 
+#ifdef YES_UNDERSCORES
+		 gen_rtx (SYMBOL_REF, Pmode, "$__GLOBAL_OFFSET_TABLE_"), 
+#else
 		 gen_rtx (SYMBOL_REF, Pmode, "$_GLOBAL_OFFSET_TABLE_"), 
+#endif
 		 gen_rtx (CONST_INT, Pmode, CODE_LABEL_NUMBER (xops[1]))));
   } 
 }
@@ -2807,6 +2815,12 @@ print_operand (file, x, code)
 	    putc ('*', file);
 	  return;
 
+	case '_':
+#ifdef YES_UNDERSCORES
+	  putc ('_', file);
+#endif
+	  return;
+
 	case 'L':
 	  PUT_OP_SIZE (code, 'l', file);
 	  return;
