From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22325 invoked by alias); 7 Apr 2012 07:54:09 -0000 Received: (qmail 22306 invoked by uid 22791); 7 Apr 2012 07:54:07 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_BJ,TW_GC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 07 Apr 2012 07:53:56 +0000 From: "licheng.1212 at gmail dot com" To: java-prs@gcc.gnu.org Subject: [Bug java/49258] -ffunction-sections and --gc-sectinons have no effect at gcj Date: Sat, 07 Apr 2012 07:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: licheng.1212 at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Severity Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2012-q2/txt/msg00014.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49258 licheng.1212@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |blocker --- Comment #2 from licheng.1212 at gmail dot com 2012-04-07 07:53:34 UTC --- [licheng@rda ~]$ cat hello.java class hello{ public void notused() { System.out.println("not used"); } public static void main(String argv[]) { System.out.println("Hello"); } } [licheng@rda ~]$ gcj --main=hello hello.java -o hello -ffunction-sections -Wl,--gc-sections,--print-gc-sections /usr/bin/ld: Removing unused section '.rodata' in file '/usr/lib/gcc/i686-redhat-linux/4.6.3/../../../crt1.o' /usr/bin/ld: Removing unused section '.rodata' in file '/usr/lib/gcc/i686-redhat-linux/4.6.3/crtbegin.o' [licheng@rda ~]$ ./hello Hello [licheng@rda ~]$ objdump -d hello > hello.asm [licheng@rda ~]$ cat hello.asm | grep notused -C 5 8048866: e8 a5 fe ff ff call 8048710 <_ZN4java4lang6ObjectC1Ev@plt> 804886b: c9 leave 804886c: c3 ret 804886d: 90 nop 0804886e <_ZN5hello7notusedEJvv>: 804886e: 55 push %ebp 804886f: 89 e5 mov %esp,%ebp 8048871: 53 push %ebx 8048872: 83 ec 24 sub $0x24,%esp 8048875: bb 00 00 00 00 mov $0x0,%ebx 804887a: 84 db test %bl,%bl 804887c: 75 0c jne 804888a <_ZN5hello7notusedEJvv+0x1c> 804887e: c7 04 24 c0 9e 04 08 movl $0x8049ec0,(%esp) 8048885: e8 46 fe ff ff call 80486d0 <_Jv_InitClass@plt> 804888a: a1 a0 9e 04 08 mov 0x8049ea0,%eax 804888f: 89 45 f4 mov %eax,-0xc(%ebp) 8048892: 8b 45 f4 mov -0xc(%ebp),%eax [licheng@rda ~]$ my gcj version is gcj (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)