bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'as' bug


From: Douglas Katzman
Subject: 'as' bug
Date: Thu, 19 Feb 2004 23:42:41 -0500

Hello.

Compiling a file from Wine with gcc 2.95.3 and binutils 2.14 loses a
.comm symbol from the .o file when using '-g' option to gcc.
To observe the problem it suffices to start with the assembly code
emitted by 'cc1'.
Removing one .stabs line from the .s file will make the errant symbol
reappear in the output of 'nm'.  Adding the .stabs will undefine the
symbol.

Attached is a gzipped tar file containing the script below and 'main.c'
with its asm source so it needn't be compiled against Wine headers.
The C variable "pglTexCoordPointer" is missing from the output of the
stabs-ified version.
Skip to the bottom of the 'main.s' file (without stabs) to see quickly
the relevant common block.
Produced on Linux kernel version 2.6.0, glibc 2.2.4, AMD K6 processor,
i386 ELF target.
--
address@hidden ddraw]$ gcc -S -I. -I../../include -I/usr/X11R6/include
-D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe
-mpreferred-stack-boundary=2 -fno-strict-aliasing -O2 -o main.s main.c
address@hidden ddraw]$ gcc -S -I. -I../../include -I/usr/X11R6/include
-D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe
-mpreferred-stack-boundary=2 -fno-strict-aliasing -O2 -g -o main_g.s
main.c
address@hidden ddraw]$ ls -l main*.s
-rw-r--r--   1 wineuser wine        71437 Feb 19 21:36 main.s
-rw-r--r--   1 wineuser wine       589968 Feb 19 21:37 main_g.s

address@hidden ddraw]$ as -o main.o main.s
address@hidden ddraw]$ as -o main_g.o main_g.s
address@hidden ddraw]$ nm main.o | grep pglTexC
00000004 C pglTexCoord2f
00000004 C pglTexCoord2fv
00000004 C pglTexCoordPointer
address@hidden ddraw]$ nm main_g.o | grep pglTexC
00000004 C pglTexCoord2f
00000004 C pglTexCoord2fv

address@hidden ddraw]$ sed 's/\.stabs "pglTexCoordPointer/#&/' <
main_g.s > main_g_ed.s
address@hidden ddraw]$ diff main_g.s main_g_ed.s
10226c10226
< .stabs "pglTexCoordPointer:G(133,82)",32,0,103,0
---
> #.stabs "pglTexCoordPointer:G(133,82)",32,0,103,0
address@hidden ddraw]$ as -o main_g_ed.o main_g_ed.s
address@hidden ddraw]$ nm main_g_ed.o | grep pglTexC
00000004 C pglTexCoord2f
00000004 C pglTexCoord2fv
00000004 C pglTexCoordPointer

address@hidden ddraw]$ as --version
GNU assembler 2.14 20030612
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License.  This program has absolutely no
warranty.
This assembler was configured for a target of `i586-pc-linux-gnu'.
address@hidden ddraw]$ nm --version
GNU nm 2.14 20030612
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License.  This program has absolutely no
warranty.

Attachment: main.tgz
Description: application/compressed


reply via email to

[Prev in Thread] Current Thread [Next in Thread]