delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/15/14:30:34

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199911151929.NAA06072@mercury.xraylith.wisc.edu>
To: JSONCRAIG AT aol DOT com
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: GCC 2.95.2 + C++ + -pg = ?
In-Reply-To: Your message of "Wed, 10 Nov 1999 21:53:37 EST."
<0 DOT 67fd80e4 DOT 255b89b1 AT aol DOT com>
Date: Mon, 15 Nov 1999 13:29:54 -0600
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

JSONCRAIG AT aol DOT com writes:
> I just downloaded and unpacked the GCC-2.95.2 Mingw32-crtdll release.  I 
> tried to compile a simple program:
> 
> #include <iostream>
> using namespace std;
> int main()
> {
> cout << "Test" << endl; 
> return 0;
> }
> 
>     c++ -o test.exe test.cpp
> works like a charm.  But then, I decided to try out the profiling:
>     C++ -o test.exe -pg test.cpp
> during linking:
> 
> 
> linking:C:\GCC-29~1.2\BIN\..\lib\gcc-lib\i386-mingw32\2.95.2\libstdc++.a(io
> stream.o)(.text$__
> ls__7ostreamPFR7ostream_R7ostream+0x0): multiple definition of 
> `ostream::operator<<(ostream &(*)(ostream &))'
> 
> &))'C:\WINDOWS\TEMP\ccriT9fb.o(.text$__ls__7ostreamPFR7ostream_R7ostream+0x0
> ):test.cpp: first defined here

It's a bug in binutils, not gcc. This is due to two bugs:

  1 a small bug in the assembler that resets the section flags after
    switching back 
  2 a more complex bug in BFD (Binary File Descriptor library that forms
    the backend of the assembler, linker, etc).

I don't have a solution yet. If I fix (1), the final executable is 
unloadable due to backend bugs. The bug is the following: let's say
you're in the middle of a "linkonce" section (as is common for C++
template instantiations and inline functions), and then you switch
to .data or .text to put some other data (eg., jump table), and switch
back to the linkonce section.

Can't fix (1) without fixing (2) first. I don't know enough about the 
PE-COFF implementation to know what's going on.

I'll file a bug report with binutils folks with the testcases. 

Thanks for pointing out this problem.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019