This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Programs compiled with "-fPIE" + "-pie" seg fault on sparc-linux [testcase].


Hi !

	First hope on right list, just remarked that programs compiled with -fPIE and linked with -pie
instead -ldl not work it seg fault.

As most simple test case:
-----------------------------------/////-------------------------------------------->
[root@sun server]# uname -a
Linux sun.rdsor.ro 2.6.1 #1 Sun Jan 11 06:27:42 EST 2004 sparc sparc sparc GNU/Linux
[root@sun server]# cat pietest.c
int main()

{

        printf("Pie crash ?");
        return 0;
}
[root@sun server]# gcc -pie -fPIE pietest.c -o pietest
[root@sun server]# ./pietest
Segmentation fault

Of course without PIE:
gcc  pietest.c -o pietest
[root@sun server]# ./pietest
Pie crash ?[root@sun server]#
-------------------------------/////-------------------------------------------------->

-fpie or -fPIE (-fPIE guessing on sparc is more correct, make the same seg fault)

Software/compiler version used was fedora's latest:

#gcc -v
Reading specs from /usr/lib/gcc-lib/sparc64-redhat-linux/3.3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix 
--disable-checking --with-system-zlib --enable-__cxa_atexit --host=sparc64-redhat-linux --build=sparc64-redhat-linux -
-target=sparc64-redhat-linux --with-cpu=v7

Thread model: posix
gcc version 3.3.2 20031218 (Red Hat Linux 3.3.2-5)

# ld --version
GNU ld version 2.14.90.0.6 20030820
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

Fedora's one glibc-2.3.3-3.sparcv9.rpm (with nptl enabled/builed)


	Hope I am on right list, i Cc it to gcc-devel, unfotunetly i am not experienced hacker
and rigth now havent an gdb at hand to see where crash to be more exact.

thx a lot !

cristian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]