This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49833] [x32] PIC doesn't work
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Jul 2011 18:28:27 +0000
- Subject: [Bug target/49833] [x32] PIC doesn't work
- Auto-submitted: auto-generated
- References: <bug-49833-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49833
--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> 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 == (Elf32_Addr) _start)
return 0;
else
return 1;
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S -O2 -fPIC /tmp/foo.c -mx32 -std=gnu99 -dp
[hjl@gnu-6 gcc]$ cat foo.s
.file "foo.c"
.text
.p2align 4,,15
.globl dl_main
.type dl_main, @function
dl_main:
.LFB0:
.cfi_startproc
xorl %eax, %eax # 26 *movsi_xor [length = 2]
cmpl $_start, (%rdi) # 27 *cmpsi_1/1 [length = 6]
setne %al # 28 *setcc_qi_slp [length = 3]
ret # 24 return_internal [length = 1]
.cfi_endproc
.LFE0:
.size dl_main, .-dl_main
.hidden _start
.ident "GCC: (GNU) 4.7.0 20110725 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 gcc]$