[Bug target/49833] [x32] PIC doesn't work

2011-07-29 Thread hjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #22 from hjl at gcc dot gnu.org 2011-07-29 16:00:48 UTC --- Author: hjl Date: Fri Jul 29 16:00:41 2011 New Revision: 176932 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176932 Log: Rewrite x86 lea support for x32. 2011-07-2

[Bug target/49833] [x32] PIC doesn't work

2011-07-26 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 Uros Bizjak changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED URL|

[Bug target/49833] [x32] PIC doesn't work

2011-07-26 Thread uros at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #20 from uros at gcc dot gnu.org 2011-07-26 12:00:36 UTC --- Author: uros Date: Tue Jul 26 12:00:33 2011 New Revision: 176788 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176788 Log: PR target/47381 PR target/49832

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #19 from H.J. Lu 2011-07-25 20:13:13 UTC --- (In reply to comment #18) > (In reply to comment #14) > > Another problem: > > > > [hjl@gnu-6 gcc]$ cat /tmp/bar.c > > typedef unsigned int Elf32_Addr; > > extern void _start (void); > > i

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #18 from H.J. Lu 2011-07-25 20:10:27 UTC --- (In reply to comment #14) > Another problem: > > [hjl@gnu-6 gcc]$ cat /tmp/bar.c > typedef unsigned int Elf32_Addr; > extern void _start (void); > int > dl_main ( Elf32_Addr *user_entry) >

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #17 from H.J. Lu 2011-07-25 20:00:45 UTC --- (In reply to comment #16) > (In reply to comment #15) > > (In reply to comment #14) > > > Another problem: > > > > > /tmp/bar.c:10:1: error: unrecognizable insn: > > > (insn 6 5 7 3 (set (

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #16 from H.J. Lu 2011-07-25 19:59:00 UTC --- (In reply to comment #15) > (In reply to comment #14) > > Another problem: > > > /tmp/bar.c:10:1: error: unrecognizable insn: > > (insn 6 5 7 3 (set (reg:SI 67) > > (symbol_ref:SI

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #15 from Uros Bizjak 2011-07-25 19:51:52 UTC --- (In reply to comment #14) > Another problem: > /tmp/bar.c:10:1: error: unrecognizable insn: > (insn 6 5 7 3 (set (reg:SI 67) > (symbol_ref:SI ("_start") [flags 0x41] _start>))

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #14 from H.J. Lu 2011-07-25 19:39:27 UTC --- Another problem: [hjl@gnu-6 gcc]$ cat /tmp/bar.c typedef unsigned int Elf32_Addr; extern void _start (void); int dl_main ( Elf32_Addr *user_entry) { if (*user_entry == (Elf32_Addr) _star

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 Pawel Sikora changed: What|Removed |Added CC||pluto at agmk dot net --- Comment #13 from

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #12 from H.J. Lu 2011-07-25 18:29:08 UTC --- Working x32 GCC generates: [hjl@gnu-6 gcc]$ cat foo.s .file"foo.c" .text .p2align 4,,15 .globldl_main .typedl_main, @function dl_main: .LFB0: .cfi_start

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #11 from H.J. Lu 2011-07-25 18:28:22 UTC --- [hjl@gnu-6 gcc]$ cat /tmp/foo.c typedef unsigned int Elf32_Addr; extern void _start (void) __attribute__ ((visibility ("hidden"))); int dl_main ( Elf32_Addr *user_entry) { if (*user_entry

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #10 from H.J. Lu 2011-07-25 18:03:51 UTC --- (In reply to comment #5) > Created attachment 24831 [details] > A testcase > > elf/rtld.c in glibc is miscompiled by > > -std=gnu99 -fgnu89-inline -O2 -fPIC GCC generates many relocation

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #9 from Uros Bizjak 2011-07-25 16:58:49 UTC --- (In reply to comment #8) > Working ld.so sets EDX properly with: Sorry, I need a testcase to debug this...

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #8 from H.J. Lu 2011-07-25 16:41:36 UTC --- (In reply to comment #7) > (In reply to comment #1) > > X32 dynamic linker is miscompiled: > > BTW: These two functions look the same to me. > > "lea(%rsi,%rdx,1),%edx" is the same as

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #7 from Uros Bizjak 2011-07-25 16:24:03 UTC --- (In reply to comment #1) > X32 dynamic linker is miscompiled: BTW: These two functions look the same to me. "lea(%rsi,%rdx,1),%edx" is the same as "add%esi,%edx". Can you plea

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #6 from H.J. Lu 2011-07-25 16:15:31 UTC --- (In reply to comment #4) > A shot-in-the-dark change: > > (define_insn "*add_1" > [(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm,r,r") > (plus:SWI48 > (match_operand

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #5 from H.J. Lu 2011-07-25 16:15:10 UTC --- Created attachment 24831 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24831 A testcase elf/rtld.c in glibc is miscompiled by -std=gnu99 -fgnu89-inline -O2 -fPIC

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #4 from Uros Bizjak 2011-07-25 15:20:42 UTC --- A shot-in-the-dark change: (define_insn "*add_1" [(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm,r,r") (plus:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #3 from Uros Bizjak 2011-07-25 14:52:12 UTC --- (In reply to comment #2) > The miscompiled function is Er, not a testcase ...

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #2 from H.J. Lu 2011-07-25 14:36:23 UTC --- The miscompiled function is auto inline void __attribute ((always_inline)) elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, void *const relo

[Bug target/49833] [x32] PIC doesn't work

2011-07-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833 --- Comment #1 from H.J. Lu 2011-07-25 13:59:10 UTC --- X32 dynamic linker is miscompiled: Program received signal SIGSEGV, Segmentation fault. 0x00114821 in elf_machine_rela_relative (reloc_addr_arg=, l_addr=1114112, reloc=) at ../sysd