From dl@scratch.catspoiler.org  Fri Apr  4 02:37:09 2003
Return-Path: <dl@scratch.catspoiler.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 0B1B137B401; Fri,  4 Apr 2003 02:37:09 -0800 (PST)
Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 2848543FA3; Fri,  4 Apr 2003 02:37:08 -0800 (PST)
	(envelope-from dl@scratch.catspoiler.org)
Received: from scratch.catspoiler.org (scratch.catspoiler.org [192.168.101.3])
	by gw.catspoiler.org (8.12.6/8.12.6) with ESMTP id h34Ab78V047269;
	Fri, 4 Apr 2003 02:37:07 -0800 (PST)
	(envelope-from dl@scratch.catspoiler.org)
Received: from scratch.catspoiler.org (localhost [127.0.0.1])
	by scratch.catspoiler.org (8.12.9/8.12.9) with ESMTP id h34Ab0ks045133;
	Fri, 4 Apr 2003 02:37:00 -0800 (PST)
	(envelope-from dl@scratch.catspoiler.org)
Received: (from dl@localhost)
	by scratch.catspoiler.org (8.12.9/8.12.9/Submit) id h34Ab00A045132;
	Fri, 4 Apr 2003 02:37:00 -0800 (PST)
Message-Id: <200304041037.h34Ab00A045132@scratch.catspoiler.org>
Date: Fri, 4 Apr 2003 02:37:00 -0800 (PST)
From: Don Lewis <truckman@freebsd.org>
Reply-To: Don Lewis <truckman@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: obrien@freebsd.org
Subject: gcc -pg -fPIC creates garbage assembly output [patch]
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         50598
>Category:       i386
>Synopsis:       gcc -pg -fPIC creates garbage assembly output [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gerald
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 04 02:40:04 PST 2003
>Closed-Date:    Thu May 08 09:03:08 PDT 2003
>Last-Modified:  Thu May 08 09:03:08 PDT 2003
>Originator:     Don Lewis
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD scratch.catspoiler.org 5.0-CURRENT FreeBSD 5.0-CURRENT #57: Wed Apr 2 20:46:56 PST 2003 dl@scratch.catspoiler.org:/usr/obj/usr/src/sys/GENERICSMB i386

FreeBSD 5.0 with gcc 3.2.1 or 3.2.2 inserts garbage into its assembly
code when the gcc -pg and -fPIC options are used together.  The assembler
complains about syntax errors in the assembly code.

The problem is caused by a leftover %s in a format string that was not
removed when it's matching parameter was removed when a.out support was
removed from the compiler.  The error crept in to rev 1.59 of
src/contrib/gcc/config/i386/freebsd.h.

Index: contrib/gcc/config/i386/freebsd.h
===================================================================
RCS file: /home/ncvs/src/contrib/gcc/config/i386/freebsd.h,v
retrieving revision 1.59
diff -u -r1.59 freebsd.h
--- contrib/gcc/config/i386/freebsd.h	26 Nov 2002 18:25:20 -0000	1.59
+++ contrib/gcc/config/i386/freebsd.h	3 Apr 2003 09:53:21 -0000
@@ -137,7 +137,7 @@
 #define FUNCTION_PROFILER(FILE, LABELNO)  \
   do {									\
     if (flag_pic)							\
-      fprintf ((FILE), "\tcall *.mcount%s@GOT(%%ebx)\n");		\
+      fprintf ((FILE), "\tcall *.mcount@GOT(%%ebx)\n");			\
     else								\
       fprintf ((FILE), "\tcall .mcount\n");				\
   } while (0)
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gerald 
Responsible-Changed-By: gerald 
Responsible-Changed-When: Tue May 6 16:12:17 PDT 2003 
Responsible-Changed-Why:  
I'll try to resolve this, one way or the other. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=50598 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Thu May 8 09:02:58 PDT 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=50598 
>Unformatted:
