public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/56353] New: libgcj should be listed on command line for libjava.jni/invocation/PR16923.c
@ 2013-02-15 23:47 hjl.tools at gmail dot com
  2013-02-15 23:52 ` [Bug libgcj/56353] " pinskia at gcc dot gnu.org
  2013-02-15 23:59 ` hjl.tools at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2013-02-15 23:47 UTC (permalink / raw)
  To: java-prs


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

             Bug #: 56353
           Summary: libgcj should be listed on command line for
                    libjava.jni/invocation/PR16923.c
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com


libjava.jni/invocation/PR16923.c behaves differently, depending
on linking with gold or ld. _Jv_RegisterClasses is weak reference
and libgcj.so isn't on the linker command line. Since libgcj.so isn't
on the linker command line, gold resolves _Jv_RegisterClasses to 0 and
ld silently resolves it to _Jv_RegisterClasses in libgcj.so:

[hjl@gnu-13 testsuite]$ readelf -sWr /tmp/PR16923.gold | grep
_Jv_RegisterClasses 
     8: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
    37: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
[hjl@gnu-13 testsuite]$ readelf -sWr /tmp/PR16923.bfd | grep
_Jv_RegisterClasses 
0000000000600cd0  0000000900000007 R_X86_64_JUMP_SLOT     00000000004005e0
_Jv_RegisterClasses + 0
     9: 00000000004005e0     0 FUNC    WEAK   DEFAULT  UND _Jv_RegisterClasses
    59: 00000000004005e0     0 FUNC    WEAK   DEFAULT  UND _Jv_RegisterClasses
[hjl@gnu-13 testsuite]$


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/56353] libgcj should be listed on command line for libjava.jni/invocation/PR16923.c
  2013-02-15 23:47 [Bug libgcj/56353] New: libgcj should be listed on command line for libjava.jni/invocation/PR16923.c hjl.tools at gmail dot com
@ 2013-02-15 23:52 ` pinskia at gcc dot gnu.org
  2013-02-15 23:59 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-02-15 23:52 UTC (permalink / raw)
  To: java-prs


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-02-15 23:52:34 UTC ---
> Since libgcj.so isn't
> on the linker command line, gold resolves _Jv_RegisterClasses to 0 and
> ld silently resolves it to _Jv_RegisterClasses in libgcj.so:

How is it linking to libgcj.so then?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/56353] libgcj should be listed on command line for libjava.jni/invocation/PR16923.c
  2013-02-15 23:47 [Bug libgcj/56353] New: libgcj should be listed on command line for libjava.jni/invocation/PR16923.c hjl.tools at gmail dot com
  2013-02-15 23:52 ` [Bug libgcj/56353] " pinskia at gcc dot gnu.org
@ 2013-02-15 23:59 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2013-02-15 23:59 UTC (permalink / raw)
  To: java-prs


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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2013-02-15 23:59:30 UTC ---
The command line is

/export/gnu/import/git/gcc-test-intel64/bld/gcc/xgcc
-B/export/gnu/import/git/gcc-test-intel64/bld/gcc/
/export/gnu/import/git/gcc-test-intel64/src-trunk/libjava/testsuite/libjava.jni/invocation/PR16923.c
-I. -I..
-I/export/gnu/import/git/gcc-test-intel64/src-trunk/libjava/testsuite/libjava.jni
-I/export/gnu/import/git/gcc-test-intel64/src-trunk/libjava/testsuite/../include
-I/export/gnu/import/git/gcc-test-intel64/src-trunk/libjava/testsuite/../classpath/include
-fdollars-in-identifiers
-L/export/gnu/import/git/gcc-test-intel64/bld/x86_64-unknown-linux-gnu/32/libjava/.libs
-ljvm -lm -m32 -o PR16923

ld finds libgcj.so via -ljvm.  It should reject it:

/usr/local/bin/ld: /export/gnu/import/git/gcc-test-intel64/bld/gcc/crtbegin.o:
undefined reference to symbol '_Jv_RegisterClasses'
/usr/local/bin/ld: note: '_Jv_RegisterClasses' is defined in DSO
/export/gnu/import/git/gcc-test-intel64/bld/x86_64-unknown-linux-gnu/libjava/.libs/libgcj.so.14
so try adding it to the linker command line
/export/gnu/import/git/gcc-test-intel64/bld/x86_64-unknown-linux-gnu/libjava/.libs/libgcj.so.14:
could not read symbols: Invalid operation


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-15 23:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15 23:47 [Bug libgcj/56353] New: libgcj should be listed on command line for libjava.jni/invocation/PR16923.c hjl.tools at gmail dot com
2013-02-15 23:52 ` [Bug libgcj/56353] " pinskia at gcc dot gnu.org
2013-02-15 23:59 ` hjl.tools at gmail dot com

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).