From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,463f43cb921b8322,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p37g2000prp.googlegroups.com!not-for-mail From: ytomino Newsgroups: comp.lang.ada Subject: -dead_strip and exception handling Date: Sat, 20 Aug 2011 12:07:28 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 114.150.103.115 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1313867678 15338 127.0.0.1 (20 Aug 2011 19:14:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 20 Aug 2011 19:14:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p37g2000prp.googlegroups.com; posting-host=114.150.103.115; posting-account=Mi71UQoAAACnFhXo1NVxPlurinchtkIj User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKRUAELSC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21669 Date: 2011-08-20T12:07:28-07:00 List-Id: Hello. I'm using Mac (Leopard), and found -dead_strip option of Apple's ld. (instead of --gc-sections) It's good, The size of my executable file has been reduced to half. But I found it causes an exception handler is ignored. with Ada.Text_IO; procedure test1 is begin raise Constraint_Error; exception when Constraint_Error => Ada.Text_IO.Put_Line ("OK"); end test1; $ gnatmake test1.adb -largs -dead_strip gcc -c test1.adb gnatbind -x test1.ali gnatlink test1.ali -dead_strip ~/projects/exam/ada/compiler/dead_strip_and_eh $ ./test1 raised CONSTRAINT_ERROR : test1.adb:4 explicit raise ~/projects/exam/ada/compiler/dead_strip_and_eh $ gnatclean test1 "./test1.ali" has been deleted "./test1.o" has been deleted "test1" has been deleted ~/projects/exam/ada/compiler/dead_strip_and_eh $ gnatmake test1.adb gcc -c test1.adb gnatbind -x test1.ali gnatlink test1.ali ~/projects/exam/ada/compiler/dead_strip_and_eh $ ./test1 OK And I tried g++ with -dead_strip, it's ok. It could catch the exception I threw. Could you try it if you are Mac user ? Thank you.