i386/50598: gcc -pg -fPIC creates garbage assembly output [patch]

Don Lewis truckman at FreeBSD.org
Fri Apr 4 02:40:06 PST 2003


>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 at 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 at GOT(%%ebx)\n");		\
+      fprintf ((FILE), "\tcall *.mcount at GOT(%%ebx)\n");			\
     else								\
       fprintf ((FILE), "\tcall .mcount\n");				\
   } while (0)
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list