delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/11/21:56:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20030812015543.72918.qmail@web21406.mail.yahoo.com>
Date: Tue, 12 Aug 2003 11:55:43 +1000 (EST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001 AT yahoo DOT co DOT nz>
Subject: Re: ld -r errors with C++ objects
To: gaeke AT uiuc DOT edu
Cc: cygwin AT cygwin DOT com
MIME-Version: 1.0

From: "Brian R. Gaeke" <gaeke at uiuc dot edu> 

--------------------------------------------------------------------------------
> 
> > > When I link two particular .o files together into a new relocatable
> > > (using ld -r) I get errors from ld, instead of a new .o file. This
> > > happens in many of our C++ projects, but only on Cygwin. I have
> > > reduced the test cases significantly.
> > 
> > ld doesn't speak C++. Use g++ to link C++ modules.
> 
> Thanks for the advice.  I tried using g++ for the link step. Ordinarily
> that results in ld complaining that it can't find WinMain, which makes
> sense because I am trying to link two .o files which do not constitute
> an entire program.
> 
> I tried passing the -r option to ld using g++'s -Wl,-r option, so that
> it would not expect to see WinMain; that resulted in an error very similar
> to the one that I got before when I simply used ld -r.
> 

The problem is with the .stabs debugging symbols in C++ - and it has been
around for awhile as you have already noted. Debugging symbols don't seem to cause
problem in C. 

This should work (strip the debug info) but may not be what you want.

ld  -r  -S -o 3,o 1.o 2.o

You may wish to report to binutils list as a bug.

Danny

> -- 
> gaeke AT uiuc DOT edu
> 
> 

http://personals.yahoo.com.au - Yahoo! Personals
-  New people, new possibilities! Try Yahoo! Personals, FREE for a limited period!

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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