public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "licheng.1212 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-49258-8172-h9mlXaM8sG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49258-8172@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49258

licheng.1212@gmail.com <licheng.1212 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker

--- Comment #2 from licheng.1212 at gmail dot com <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)


  parent reply	other threads:[~2012-04-07  7:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 15:56 [Bug java/49258] New: " licheng.1212 at gmail dot com
2011-06-01 16:08 ` [Bug java/49258] " licheng.1212 at gmail dot com
2011-12-31  0:05 ` pinskia at gcc dot gnu.org
2012-04-07  7:54 ` licheng.1212 at gmail dot com [this message]
2012-04-07  8:50 ` pinskia at gcc dot gnu.org
2012-04-07  9:02 ` licheng.1212 at gmail dot com
2012-04-07 12:11 ` schwab@linux-m68k.org
2012-04-07 18:09 ` pinskia at gcc dot gnu.org
2012-04-09 11:15 ` licheng.1212 at gmail dot com
2012-04-09 19:41 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49258-8172-h9mlXaM8sG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).