public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
@ 2014-01-16 14:47 tg at mirbsd dot org
  2014-01-16 14:51 ` [Bug target/59842] " tg at mirbsd dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tg at mirbsd dot org @ 2014-01-16 14:47 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 5204 bytes --]

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

            Bug ID: 59842
           Summary: `__x86.get_pc_thunk.bx' referenced in section `.text':
                    defined in discarded section…
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tg at mirbsd dot org

Created attachment 31855
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31855&action=edit
test runner

Hi *,

I originally filed this as Debian #735564 but a user informed me they are also
seeing this on other GNU/Linux distributions, and with GCC 4.7.1 on Slackware.

Since a while, I’m getting errors like these:

`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o

I used to be able to avoid them (although, back then, the symbol
was named “__i686.get_pc_thunk.bx”) by adding -march=i486, but
this no longer helps.

Screen log (the files x.sh, x.i and x.sym are attached):

tglase@tglase:~ $ mksh x.sh
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
`__x86.get_pc_thunk.bx' referenced in section `.text' of x3.o: defined in
discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' of x3.o
collect2: error: ld returned 1 exit status

IMHO, GCC may not mark symbols as discardable that it uses by itself. Adding
this to the symbol file is no solution either, as this becomes highly platform-
and compiler-dependent.
>From gcc-bugs-return-440558-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 14:48:07 2014
Return-Path: <gcc-bugs-return-440558-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25214 invoked by alias); 16 Jan 2014 14:48:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25078 invoked by uid 48); 16 Jan 2014 14:47:59 -0000
From: "tg at mirbsd dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text':=?UTF-8?Q? defined in discarded section…?Date: Thu, 16 Jan 2014 14:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tg at mirbsd dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-59842-4-Zvt4WJFc68@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59842-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59842-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01700.txt.bz2
Content-length: 235

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY842

--- Comment #1 from Thorsten Glaser <tg at mirbsd dot org> ---
Created attachment 31856
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1856&actioníit
preprocessed source code


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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
@ 2014-01-16 14:51 ` tg at mirbsd dot org
  2014-01-16 14:58 ` tg at mirbsd dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tg at mirbsd dot org @ 2014-01-16 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Thorsten Glaser <tg at mirbsd dot org> ---
Created attachment 31857
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31857&action=edit
symbols file


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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
  2014-01-16 14:51 ` [Bug target/59842] " tg at mirbsd dot org
@ 2014-01-16 14:58 ` tg at mirbsd dot org
  2014-01-16 16:46 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tg at mirbsd dot org @ 2014-01-16 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Thorsten Glaser <tg at mirbsd dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i486-linux-gnu
                URL|                            |http://bugs.debian.org/cgi-
                   |                            |bin/bugreport.cgi?bug=73556
                   |                            |4
      Known to work|                            |4.6.4
               Host|                            |i486-linux-gnu
      Known to fail|                            |4.7.1, 4.8.2
              Build|                            |i486-linux-gnu

--- Comment #3 from Thorsten Glaser <tg at mirbsd dot org> ---
Adding extra info. GCC 4.6 (Debian sid) works iff you add -march=i486 but
exhibits the same problem (with different symbol) otherwise. GCC 3.4.6 (MirBSD)
works.


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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
  2014-01-16 14:51 ` [Bug target/59842] " tg at mirbsd dot org
  2014-01-16 14:58 ` tg at mirbsd dot org
@ 2014-01-16 16:46 ` pinskia at gcc dot gnu.org
  2014-01-16 17:54 ` tg at mirbsd dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-16 16:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://bugs.debian.org/cgi- |
                   |bin/bugreport.cgi?bug=73556 |
                   |4                           |
           See Also|                            |http://bugs.debian.org/7355
                   |                            |64

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't think this is a GCC bug but rather a bug using objcopy and thinking
that will not get rid of hidden global symbols.

The .text.__x86.get_pc_thunk.[bc]x symbols are defined as:
        .section       
.text.__x86.get_pc_thunk.cx,"axG",@progbits,__x86.get_pc_thunk.cx,comdat
        .globl  __x86.get_pc_thunk.cx
        .hidden __x86.get_pc_thunk.cx
        .type   __x86.get_pc_thunk.cx, @function
__x86.get_pc_thunk.cx:
.LFB15:
        .cfi_startproc
        movl    (%esp), %ecx
        ret
        .cfi_endproc
.LFE15:
        .section       
.text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
        .globl  __x86.get_pc_thunk.bx
        .hidden __x86.get_pc_thunk.bx
        .type   __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
.LFB16:
        .cfi_startproc
        movl    (%esp), %ebx
        ret

So they are already hidden so when doing the final link they will not show up
in the shared library.  The objcopy is removing the symbol names for these
section which is invalid as they are comdat and cannot be removed.


Really the code should move over to a versioning script instead of using
objcopy and that would work much better and be slightly more portable.


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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
                   ` (2 preceding siblings ...)
  2014-01-16 16:46 ` pinskia at gcc dot gnu.org
@ 2014-01-16 17:54 ` tg at mirbsd dot org
  2021-12-05  8:47 ` pinskia at gcc dot gnu.org
  2021-12-05  8:54 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: tg at mirbsd dot org @ 2014-01-16 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Thorsten Glaser <tg at mirbsd dot org> ---
Hm, unsure. These versioning scripts are pretty much recent GNU stuff. But if
you have input…

cvs -d _anoncvs@anoncvs.mirbsd.org:/cvs co -PA -d xchat-randex
contrib/hosted/tg/code/xchat-randex
>From gcc-bugs-return-440591-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 17:58:55 2014
Return-Path: <gcc-bugs-return-440591-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18839 invoked by alias); 16 Jan 2014 17:58:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18814 invoked by uid 48); 16 Jan 2014 17:58:51 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text':=?UTF-8?Q? defined in discarded section…?Date: Thu, 16 Jan 2014 17:58:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59842-4-r5BkNHFbU9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59842-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59842-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01733.txt.bz2
Content-length: 365

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY842

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Thorsten Glaser from comment #5)
> Hm, unsure. These versioning scripts are pretty much recent GNU stuff.

Recent as in the last 10 years maybe.  But not in the last 5 years.  Also they
are supported in Solaris and even Darwin too.


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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
                   ` (3 preceding siblings ...)
  2014-01-16 17:54 ` tg at mirbsd dot org
@ 2021-12-05  8:47 ` pinskia at gcc dot gnu.org
  2021-12-05  8:54 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-05  8:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59842

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |MOVED
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=27931

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
objcopy bug filed just recently:
https://sourceware.org/bugzilla/show_bug.cgi?id=27931

So closing as moved.

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

* [Bug target/59842] `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section…
  2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
                   ` (4 preceding siblings ...)
  2021-12-05  8:47 ` pinskia at gcc dot gnu.org
@ 2021-12-05  8:54 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-05  8:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59842

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=3182

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Or it is fixed by https://sourceware.org/bugzilla/show_bug.cgi?id=3182 .

Either way it is a binutils objcopy issue and not a GCC one really.

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

end of thread, other threads:[~2021-12-05  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 14:47 [Bug target/59842] New: `__x86.get_pc_thunk.bx' referenced in section `.text': defined in discarded section… tg at mirbsd dot org
2014-01-16 14:51 ` [Bug target/59842] " tg at mirbsd dot org
2014-01-16 14:58 ` tg at mirbsd dot org
2014-01-16 16:46 ` pinskia at gcc dot gnu.org
2014-01-16 17:54 ` tg at mirbsd dot org
2021-12-05  8:47 ` pinskia at gcc dot gnu.org
2021-12-05  8:54 ` pinskia at gcc dot gnu.org

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