[Bug java/49258] -ffunction-sections and --gc-sectinons have no effect at gcj
licheng.1212 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 9 11:15:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49258
--- Comment #6 from licheng.1212 at gmail dot com <licheng.1212 at gmail dot com> 2012-04-09 11:14:56 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > Yes,but why we can't remove the function notused() form vtable, since this
> > function will never used.
>
> How can you tell? Without the full exectuable and knowing the entry point,
> there is no way (-fwhole-program can help but it becomes a turning machine at
> that point).
class hello{
public void notused()
{
System.out.println("not used");
}
public static void main(String argv[])
{
System.out.println("Hello");
}
}
this is a full execlutable program,and it hava only one entry point "main"!
and i test a c++ file,it will remove the unused funcitons "notused":
[licheng@Soft04 ~]$ cat hello.cpp
#include <iostream>
class hello
{
public:
hello()
{
}
void notused()
{
std::cout << "not used";
}
void used()
{
std::cout << "used";
}
~hello()
{
}
}hi;
int main()
{ hello t;
t.used();
return 0;
}
[licheng@Soft04 ~]$
More information about the Java-prs
mailing list