This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Issue while using -rdynamic with binutils 2.22-8
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Makarand Pradhan <makarandpradhan at ruggedcom dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 29 Jan 2014 13:38:51 -0800
- Subject: Re: Issue while using -rdynamic with binutils 2.22-8
- Authentication-results: sourceware.org; auth=none
- References: <52E97343 dot 6030004 at ruggedcom dot com>
On Wed, Jan 29, 2014 at 1:31 PM, Makarand Pradhan
<makarandpradhan@ruggedcom.com> wrote:
> Hi All,
>
> We are in the process of migrating from binutils 2.20.1-16 to 2.22-8.
>
> I notice an issue while using linker option -rdynamic. Details below:
>
> I'm using the sample code given at the end of this email for the test. The
> code links fine in 2.20.1-16, but fails in 2.22-8.
>
> e.g.:
> In 2.20.1-16:
> # g++ -ffunction-sections -fdata-sections -rdynamic -Wl,--gc-sections t.cpp
> #
>
> In 2.22-8:
> # g++ -ffunction-sections -fdata-sections -rdynamic -Wl,--gc-sections t.cpp
> /tmp/ccU6re3d.o: In function `c1_type::c1_func1()':
> t.cpp:(.text._ZN7c1_type8c1_func1Ev+0x12): undefined reference to
> `c1_type::int_1'
> t.cpp:(.text._ZN7c1_type8c1_func1Ev+0x1e): undefined reference to
> `c1_type::int_1'
> collect2: ld returned 1 exit status
>
> Problem:
> The unused code is supposed to be stripped of by -Wl,--gc-sections. When
> used alone it works as expected. All the same when paied with ïrdynamic the
> build fails in the newer version.
>
> Would appreciate any opinions if this is a bug or if I'm missing anything.
>
Please open a bug report.
Thanks.
--
H.J.