Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2003 02:37:00 -0800 (PST)
From:      Don Lewis <truckman@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        obrien@FreeBSD.org
Subject:   i386/50598: gcc -pg -fPIC creates garbage assembly output [patch]
Message-ID:  <200304041037.h34Ab00A045132@scratch.catspoiler.org>
Resent-Message-ID: <200304041040.h34Ae4pc070003@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         50598
>Category:       i386
>Synopsis:       gcc -pg -fPIC creates garbage assembly output [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 04 02:40:04 PST 2003
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304041037.h34Ab00A045132>