public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/19520] protected function pointer doesn't work right
Date: Wed, 18 Jan 2012 09:35:00 -0000	[thread overview]
Message-ID: <bug-19520-4-AWMeEbLBuR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-19520-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #25 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-18 09:21:14 UTC ---
LD bug: http://sourceware.org/bugzilla/show_bug.cgi?id=13600

The GCC side is a QOI thing and maybe a conformance thing.  ICC generates
for

__attribute__((visibility("protected")))
void * foo (void) { return (void *)foo; }

        .protected foo
        .globl foo
foo:
..B1.1:                         # Preds ..B1.0
..___tag_value_foo.1:                                           #1.60
        movq      foo@GOTPCREL(%rip), %rax                      #1.77

thus does not resolve the function address to the local symbol, which GCC
does and which confuses LD (thus the linker bug):

        .globl  foo
        .protected      foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        leaq    foo(%rip), %rax

I think ICC this way avoids the function pointer comparison issues with
symbols with protected visibility (can someone double-check?  HJs testcase
doesn't compile for me).


  parent reply	other threads:[~2012-01-18  9:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19520-4@http.gcc.gnu.org/bugzilla/>
2012-01-16 15:25 ` thiago at kde dot org
2012-01-17 20:38 ` pinskia at gcc dot gnu.org
2012-01-18  9:35 ` rguenth at gcc dot gnu.org [this message]
2012-01-18 13:37 ` thiago at kde dot org
2012-01-18 17:13 ` rguenth at gcc dot gnu.org
2012-01-19 13:50 ` rguenth at gcc dot gnu.org
2012-01-19 19:02 ` hjl.tools at gmail dot com
2012-01-19 19:03 ` thiago at kde dot org
2012-04-29  4:40 ` bugdal at aerifal dot cx
2012-10-21 21:35 ` [Bug target/19520] protected function pointer and copy relocation don't " hjl.tools at gmail dot com
     [not found] <bug-19520-682@http.gcc.gnu.org/bugzilla/>
2005-11-06  9:50 ` [Bug target/19520] protected function pointer doesn't " simon dot strandman at telia dot com
2007-01-11 18:42 ` thiago at kde dot org
2005-01-19  0:25 [Bug target/19520] New: " hjl at lucon dot org
2005-01-19  0:27 ` [Bug target/19520] " hjl at lucon dot org
2005-01-19  0:34 ` pinskia at gcc dot gnu dot org
2005-01-19  0:36 ` hjl at lucon dot org
2005-01-19  0:41 ` hjl at lucon dot org
2005-01-19  0:47 ` pinskia at gcc dot gnu dot org
2005-01-19  0:56 ` pinskia at gcc dot gnu dot org
2005-01-19  1:48 ` hjl at lucon dot org
2005-01-19  3:11 ` pinskia at gcc dot gnu dot org
2005-01-19  3:31 ` pinskia at gcc dot gnu dot org
2005-01-19  3:41 ` pinskia at gcc dot gnu dot org
2005-01-20 19:28 ` hjl at lucon dot org
2005-01-20 22:34 ` hjl at lucon dot org
2005-01-21  6:35 ` ian at airs dot com
2005-01-21  6:36 ` ian at airs dot com
2005-01-21  6:47 ` hjl at lucon dot org
2005-01-24 18:35 ` hjl at lucon dot org
2005-02-02 13:16 ` amodra at bigpond dot net dot au
2005-02-02 16:17 ` hjl at lucon dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-19520-4-AWMeEbLBuR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).