public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: sf@b-i-t.de
To: gcc-gnats@gcc.gnu.org
Subject: java/9861: method name mangling ignores return type
Date: Wed, 26 Feb 2003 13:36:00 -0000	[thread overview]
Message-ID: <20030226133219.4084.qmail@sources.redhat.com> (raw)


>Number:         9861
>Category:       java
>Synopsis:       method name mangling ignores return type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 26 13:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     sf@b-i-t.de
>Release:        gcc-3.2.1
>Organization:
>Environment:
gentoo linux 1.4
gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)
GNU assembler version 2.13.90.0.18 (i586-pc-linux-gnu) using BFD version 2.13.90.0.18 20030121
>Description:
The following Generic Java code was compiled to the two classes which can be found in the attachment.

// TestGJ.java begins here

class Test<Type> {

  protected Type x () {
    return null;
  }
}

public class TestGJ extends Test<Integer> {

  protected Integer x () {
    return new Integer (1);
  }

  public static void main (final String[] argv) {
    new TestGJ ().x ().intValue ();
  }
}

// TestGJ.java ends here

If you execute "java TestGJ" (adjust CLASSPATH as necessary) the program runs without error (BTW, there is no output).

But compilation of the class files with gcj fails because of a name clash during assembly.
>How-To-Repeat:
If you execute

gcj -classpath /usr/share/gcc-data/i586-pc-linux-gnu/3.2/java/libgcj-3.2.1.jar:. Test.class TestGJ.class 

you should get output similar to

/tmp/cc5J7vu9.s: Assembler messages:
/tmp/cc5J7vu9.s:150: Error: symbol `_ZN6TestGJ1xEv' is already defined
>Fix:
The mangled name of a method must contain the method's return type, as in the definition of a method descriptor in the Java Virtual Machine Specification.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-zip-compressed; name="TestGJ.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TestGJ.zip"

UEsDBBQAAgAIACtvWi4xD4R7xwAAACYBAAAKAAAAVGVzdC5jbGFzc21PzQ7BYBCcrdIf/4kHcGwJ
7oiLhEQkDhr3qi9Nm6aEEt6Kk8TBA3gosV85YZPNTHZmJ7uP5+2ODFqomgwlDWUNFUKuH8RBMiBk
LHtBUIfrlSDQkVCz7GnoHtxO5MZ+Z7YMhZf0CMY88GM32W/Zplu245w2gsfNviTd343BvxBzvt5v
PTEKIk7JO2KXjCdt6StARZbPkCNC5XsVdSh8vSyFm73gF5hVGYkx27iCLqlBhQadbVIufWSFzqlm
pAEm95vlUUix+AJQSwMEFAACAAgAK29aLvdFNsQ6AQAA6QEAAAwAAABUZXN0R0ouY2xhc3NtkN1K
AkEUx/+jq+uuW2apfdiXd2tQPoDiTVAYQheGIV1tNmwjNsI2Rr1V3Sgk9AA9VHTOKpTUXJwzM+f3
P1+fX+8fSOIYFRcZlGxsukhgy8a2Cws7bMr8s2tjTyDdUFqZpkDSr3YFrNPRnRQQzwJFv9oeBE9B
bRjosNbSRoYyqhPyECgtUPJvfoU7JlI6rHOKwpLu8nYg+4ZkTudFm3tpVJ/vKtSBGUdUqty+ko+m
8U+pJqnczmgc9eWZGhKaZfL84oRRDw5cgfwfGQf2aa45G2MePKx4OMAhdc//5PwW95pR2nSD4VjG
87dQoeVkwMeCYCnZLL3y5AX51NEU4m0BUNJFuEj75rAzQ6JnTZF8jREHq8gtkDJtnJHcDFZvitQE
6Qns659cawQslyJknicf2wTWY7uBQuyL31BLAQIXAxQAAgAIACtvWi4xD4R7xwAAACYBAAAKAAAA
AAAAAAAAAACkgQAAAABUZXN0LmNsYXNzUEsBAhcDFAACAAgAK29aLvdFNsQ6AQAA6QEAAAwAAAAA
AAAAAAAAAKSB7wAAAFRlc3RHSi5jbGFzc1BLBQYAAAAAAgACAHIAAABTAgAAAAA=


             reply	other threads:[~2003-02-26 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-26 13:36 sf [this message]
2003-04-11 13:00 aph

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=20030226133219.4084.qmail@sources.redhat.com \
    --to=sf@b-i-t.de \
    --cc=gcc-gnats@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).