public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* input sections difference "ax" vs "axG" ?
@ 2020-09-01 16:11 Akhilesh Chirlancha
  2020-09-01 17:20 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Akhilesh Chirlancha @ 2020-09-01 16:11 UTC (permalink / raw)
  To: iant; +Cc: gcc-help

Why the same ARM gcc creating 2 different types of input sections?
(.gnu.linkonce.t "ax") and (.group "axG")

I have 2 ARM toolchain releases. one toolchain is generating the input
sections with ".gnu.linkonce.t" prefix('ax') and another toolchain is with
".group" sections('axG').
And the toolchain with the .gnu.linkonce.t is throwing an error sometimes
""defined in discarded section" and "undefined reference"".
I do not have any clue why it's choosing 2 different types of input
sections even if there are no changes in the toolchain sources.

What could be the reason behind this? If there is somewhere better for me
to be looking, I would appreciate a pointer.

FYI, my toolchain components versions are gcc-5.2.0, binutils-2.25.1,
glibc-2.22

<----------------------------------------------------------------------------------------------------------------------------------------------->
toolchain-1:
=========
        .file   "sample.cpp"
        .section        .gnu.linkonce.t._ZN6SampleC1Ev,"ax",%progbits
        .align  2
        .weak   _ZN6SampleC1Ev


        .section
 .gnu.linkonce.t._ZN6Sample10inline_funEv,"ax",%progbits
        .align  2
        .weak   _ZN6Sample10inline_funEv

toolchain-2:
=========
        .file   "sample.cpp"
        .section
 .text._ZN6SampleC2Ev,"axG",%progbits,_ZN6SampleC5Ev,comdat
        .align  2
        .weak   _ZN6SampleC2Ev

        .section
 .text._ZN6Sample10inline_funEv,"axG",%progbits,_ZN6Sample10inline_funEv,comdat
        .align  2
        .weak   _ZN6Sample10inline_funEv
<----------------------------------------------------------------------------------------------------------------------------------------------->

-Akhilesh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: input sections difference "ax" vs "axG" ?
  2020-09-01 16:11 input sections difference "ax" vs "axG" ? Akhilesh Chirlancha
@ 2020-09-01 17:20 ` Ian Lance Taylor
  2020-09-02  8:03   ` Akhilesh Chirlancha
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2020-09-01 17:20 UTC (permalink / raw)
  To: Akhilesh Chirlancha; +Cc: gcc-help

On Tue, Sep 1, 2020 at 9:11 AM Akhilesh Chirlancha
<akhileshchirlancha.linux@gmail.com> wrote:
>
>
> Why the same ARM gcc creating 2 different types of input sections? (.gnu.linkonce.t "ax") and (.group "axG")
>
> I have 2 ARM toolchain releases. one toolchain is generating the input sections with ".gnu.linkonce.t" prefix('ax') and another toolchain is with ".group" sections('axG').
> And the toolchain with the .gnu.linkonce.t is throwing an error sometimes ""defined in discarded section" and "undefined reference"".
> I do not have any clue why it's choosing 2 different types of input sections even if there are no changes in the toolchain sources.
>
> What could be the reason behind this? If there is somewhere better for me to be looking, I would appreciate a pointer.

.gnu.linkince and .group are two different ways of addressing the same
problem.  The .group approach is newer and can handle more cases.  So
a newer toolchain should expect to use .group.  The choice between
them will depend not just on the compiler, but also on whether the
assembler and linker support the .group option.

You say that you have two toolchain releases, so your question as to
exactly why it changed might be better addressed to whoever created
those releases.

Hope this helps.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: input sections difference "ax" vs "axG" ?
  2020-09-01 17:20 ` Ian Lance Taylor
@ 2020-09-02  8:03   ` Akhilesh Chirlancha
  2020-09-02 19:57     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Akhilesh Chirlancha @ 2020-09-02  8:03 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

Hi Ian,

Many thanks for the clarification.

Unfortunately, both the toolchain configurations and all the component
sources are the same.
Here my question is, Are there any configuration options or compiler
options to support the .group option for toolchain to avoid the
.gnu.linkonce sections ??
and Do you think that any other dependency packages could also cause this
problem, or any machine definition files ??

-Akhilesh

On Tue, Sep 1, 2020 at 10:50 PM Ian Lance Taylor <iant@google.com> wrote:

> On Tue, Sep 1, 2020 at 9:11 AM Akhilesh Chirlancha
> <akhileshchirlancha.linux@gmail.com> wrote:
> >
> >
> > Why the same ARM gcc creating 2 different types of input sections?
> (.gnu.linkonce.t "ax") and (.group "axG")
> >
> > I have 2 ARM toolchain releases. one toolchain is generating the input
> sections with ".gnu.linkonce.t" prefix('ax') and another toolchain is with
> ".group" sections('axG').
> > And the toolchain with the .gnu.linkonce.t is throwing an error
> sometimes ""defined in discarded section" and "undefined reference"".
> > I do not have any clue why it's choosing 2 different types of input
> sections even if there are no changes in the toolchain sources.
> >
> > What could be the reason behind this? If there is somewhere better for
> me to be looking, I would appreciate a pointer.
>
> .gnu.linkince and .group are two different ways of addressing the same
> problem.  The .group approach is newer and can handle more cases.  So
> a newer toolchain should expect to use .group.  The choice between
> them will depend not just on the compiler, but also on whether the
> assembler and linker support the .group option.
>
> You say that you have two toolchain releases, so your question as to
> exactly why it changed might be better addressed to whoever created
> those releases.
>
> Hope this helps.
>
> Ian
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: input sections difference "ax" vs "axG" ?
  2020-09-02  8:03   ` Akhilesh Chirlancha
@ 2020-09-02 19:57     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2020-09-02 19:57 UTC (permalink / raw)
  To: Akhilesh Chirlancha; +Cc: gcc-help

On Wed, Sep 2, 2020 at 1:04 AM Akhilesh Chirlancha
<akhileshchirlancha.linux@gmail.com> wrote:
>
> Many thanks for the clarification.
>
> Unfortunately, both the toolchain configurations and all the component sources are the same.
> Here my question is, Are there any configuration options or compiler options to support the .group option for toolchain to avoid the .gnu.linkonce sections ??

I don't know.

> and Do you think that any other dependency packages could also cause this problem, or any machine definition files ??

If your toolchain includes the GNU binutils, then, no, I don't think
any other dependency would matter.

Ian


> On Tue, Sep 1, 2020 at 10:50 PM Ian Lance Taylor <iant@google.com> wrote:
>>
>> On Tue, Sep 1, 2020 at 9:11 AM Akhilesh Chirlancha
>> <akhileshchirlancha.linux@gmail.com> wrote:
>> >
>> >
>> > Why the same ARM gcc creating 2 different types of input sections? (.gnu.linkonce.t "ax") and (.group "axG")
>> >
>> > I have 2 ARM toolchain releases. one toolchain is generating the input sections with ".gnu.linkonce.t" prefix('ax') and another toolchain is with ".group" sections('axG').
>> > And the toolchain with the .gnu.linkonce.t is throwing an error sometimes ""defined in discarded section" and "undefined reference"".
>> > I do not have any clue why it's choosing 2 different types of input sections even if there are no changes in the toolchain sources.
>> >
>> > What could be the reason behind this? If there is somewhere better for me to be looking, I would appreciate a pointer.
>>
>> .gnu.linkince and .group are two different ways of addressing the same
>> problem.  The .group approach is newer and can handle more cases.  So
>> a newer toolchain should expect to use .group.  The choice between
>> them will depend not just on the compiler, but also on whether the
>> assembler and linker support the .group option.
>>
>> You say that you have two toolchain releases, so your question as to
>> exactly why it changed might be better addressed to whoever created
>> those releases.
>>
>> Hope this helps.
>>
>> Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-02 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 16:11 input sections difference "ax" vs "axG" ? Akhilesh Chirlancha
2020-09-01 17:20 ` Ian Lance Taylor
2020-09-02  8:03   ` Akhilesh Chirlancha
2020-09-02 19:57     ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).