public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/66232] New: -fPIC -fno-plt -mx32 fails to generate indirect branch via GOT
@ 2015-05-21  3:04 hjl.tools at gmail dot com
  2015-05-21  3:42 ` [Bug target/66232] " hjl.tools at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-05-21  3:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66232
           Summary: -fPIC -fno-plt -mx32 fails to generate indirect branch
                    via GOT
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
            Target: x86_64-pc-linux-gnu

[hjl@gnu-tools-1 plt-1]$ cat x.i
extern void bar (void);

void
foo (void)
{
  bar ();
}
[hjl@gnu-tools-1 plt-1]$ make
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -O2 -fPIC -fno-plt -mx32 -S
x.i
[hjl@gnu-tools-1 plt-1]$ cat x.s
        .file   "x.i"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        movl    bar@GOTPCREL(%rip), %eax
        jmp     *%rax
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:
        .ident  "GCC: (GNU) 6.0.0 20150521 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 plt-1]$ 

We should generate

jmp     *bar@GOTPCREL(%rip)

since GOT slot is 64-bit.


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

end of thread, other threads:[~2015-08-16 20:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21  3:04 [Bug target/66232] New: -fPIC -fno-plt -mx32 fails to generate indirect branch via GOT hjl.tools at gmail dot com
2015-05-21  3:42 ` [Bug target/66232] " hjl.tools at gmail dot com
2015-05-21 12:08 ` hjl.tools at gmail dot com
2015-05-21 15:31 ` hjl.tools at gmail dot com
2015-05-21 21:59 ` hjl at gcc dot gnu.org
2015-05-21 22:00 ` hjl.tools at gmail dot com
2015-07-27 16:25 ` hjl at gcc dot gnu.org
2015-08-16 20:18 ` hjl.tools at gmail dot com

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