delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/10/16:22:31

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Date: Fri, 11 Mar 2005 10:21:15 +1300
From: Danny Smith <dannysmith AT clear DOT net DOT nz>
Subject: Re: Possible bug in gas/ld when using .linkonce
To: Pavel Tsekov <ptsekov AT gmx DOT net>, cygwin AT cygwin DOT com
Cc: binutils AT sourceware DOT org
Reply-to: Danny Smith <dannysmith AT users DOT sourceforge DOT net>
Message-id: <001001c525b7$20881800$2d4861cb@DANNY>
MIME-version: 1.0
References: <Pine DOT CYG DOT 4 DOT 58 DOT 0503101607001 DOT 624 AT mordor>

Pavel Tsekov wrote:
> Hello,
>
> I found this one while playing with Cygwin's code which takes care of
> seamless loading of dll functions (autoload.cc). It seems that when a
> symbol in a section marked .linkonce is referenced, wrong relocation info
> is generated for that symbol.
>
> For example if you have several symbols - symbol1, symbol2 and symbol3,
> - which are placed like this:
>
> offset name
>      0 symbol1
>      3 symbol2
>     15 symbol3
>
> References to this symbols will be generated like this:
>
> symbol1 -> 0
> symbol2 -> 6
> symbol3 -> 30
>
> I am attaching a testcase. linkonce.cc is the code which demonstrates the
> problem. linkonce1.cc is the same code but with .linkonce directives
> removed and doesn't suffer from the problem. Here is also the output of
> `objdump -r' on both object files.
>
I don't think your usage of .linkonce in your example is quite corect.

In PECOFF, each linkonce symbol needs to have its own unique section.  When you
try to put  more than one linkonce symbol into a section you get problems like
those mentioned here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14808


Secondly, I believe you need to specify a linkonce type (ie, one_only, discard,
same_size, same_content)
'
Danny


--
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