From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Received: (qmail 23634 invoked by uid 71); 10 Jan 2003 18:56:05 -0000 Resent-Date: 10 Jan 2003 18:56:05 -0000 Resent-Message-ID: <20030110185605.23633.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, cc@pi3.informatik.uni-mannheim.de Resent-Reply-To: gcc-gnats@gcc.gnu.org, rschiele@uni-mannheim.de Received: (qmail 13860 invoked by uid 61); 10 Jan 2003 18:48:26 -0000 Message-Id: <20030110184826.13858.qmail@sources.redhat.com> Date: Fri, 10 Jan 2003 18:56:00 -0000 From: rschiele@uni-mannheim.de Reply-To: rschiele@uni-mannheim.de To: gcc-gnats@gcc.gnu.org Cc: cc@pi3.informatik.uni-mannheim.de X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: cc@pi3.informatik.uni-mannheim.de Subject: c++/9265: exception handling faulty wenn linking PIC objects to non PIC ones X-SW-Source: 2003-01/txt/msg00654.txt.bz2 List-Id: >Number: 9265 >Category: c++ >Synopsis: exception handling faulty wenn linking PIC objects to non PIC ones >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Jan 10 10:56:02 PST 2003 >Closed-Date: >Last-Modified: >Originator: Robert Schiele >Release: 3.2.1, 3.2.2 20030109 (prerelease), 3.3 20030109 (prerelease) and 3.4 20030109 (experimental) >Organization: >Environment: System: Linux scavenger 2.4.19-4GB #1 Mon Oct 14 22:11:39 UTC 2002 i686 unknown Architecture: i686 host: i486-suse-linux-gnu build: i486-suse-linux-gnu target: i486-suse-linux-gnu configured with: /home/schiele/gcccvs/gcc-3.2.1/configure --enable-threads=posix --prefix=/opt/Pkg/Linux/i686/gcc321 --enable-languages=c,c++,f77,objc --disable-libgcj --with-gxx-include-dir=/opt/Pkg/Linux/i686/gcc321/include/g++ --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux >Description: When linking a PIC object to a non PIC one that calls a function by a function pointer, exception handling is no longer working in the PIC object. I could reproduce this on ia32 arch. On sparc it did not happen for me. Note, I am not abolutely sure whether this is a bug, as I do not now what the specs say about linking PIC to non PIC objects in C++. But as I do not sea a reason, why this should not be allowed, I assume this is a bug. The attached lines of code should output nothing, as the thrown exception is expected to be called immediately, but they print out an "Aborted". >How-To-Repeat: echo 'int main() { try { throw 0; } catch (...) {}}' | \ g++ -fpic -c -x c++ -o pic.o - echo 'void (*b)(); void a() { (*b)(); }' | g++ pic.o -x c++ - a.out >Fix: >Release-Note: >Audit-Trail: >Unformatted: