From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5558 invoked by alias); 23 Nov 2013 16:40:34 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5548 invoked by uid 89); 23 Nov 2013 16:40:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-la0-f42.google.com Received: from Unknown (HELO mail-la0-f42.google.com) (209.85.215.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 23 Nov 2013 16:40:33 +0000 Received: by mail-la0-f42.google.com with SMTP id ec20so1826544lab.29 for ; Sat, 23 Nov 2013 08:40:23 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.44.225 with SMTP id h1mr1640369lam.22.1385224823457; Sat, 23 Nov 2013 08:40:23 -0800 (PST) Received: by 10.112.173.195 with HTTP; Sat, 23 Nov 2013 08:40:23 -0800 (PST) In-Reply-To: References: Date: Sat, 23 Nov 2013 16:42:00 -0000 Message-ID: Subject: Re: C++ exceptions From: Jonathan Wakely To: vijay nag Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00191.txt.bz2 On 23 November 2013 16:11, vijay nag wrote: > Ok I found the problem. There seems to exist stack similar stack > unwind definition in glibc as well and linker was picking definitions > from libc rather than from libgcc_s.so since libc was first in the > default link order although I don't understand why linker is not > throwing multiple definition error. Because the first definition that is found gets used, that's how shared libraries work. > So I had to explicitly specify this order "-Wl,--start-group -lgcc_s > -lgcc -lc -Wl,--end-group" in linker command line arguments to pick-up > definitions from libgcc_s.so rather than from libc. If you'd using ld to link then it's your job to get the command right. If you use gcc to link then it should get it right automatically. I've asked twice what commands you're using to compile and link, but you won't provide that information for some reason.