public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug go/60995] New: gccgo ignores .a files with "/SYM64/" symbol table
@ 2014-04-29  7:12 vogt at linux dot vnet.ibm.com
  2015-02-03 19:59 ` [Bug go/60995] " ian at airs dot com
  0 siblings, 1 reply; 2+ messages in thread
From: vogt at linux dot vnet.ibm.com @ 2014-04-29  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60995
           Summary: gccgo ignores .a files with "/SYM64/" symbol table
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: vogt at linux dot vnet.ibm.com

On platforms where ar generates .a files with a "/SYM64/" symbol table (e.g.
s390x), gccgo cannot extract Go export data from such files.  This is because
import-archive.cc:Archive_file::interpret_header() does not recognize the
special file name "/SYM64/         " and treats it as an extended name and
fails with two error messages:

  error: .../libfoo.a: bad extended name index at 8
  error: .../libfoo.a exists but does not contain any Go export data

This is easy to fix by recognizing "/SYM64/<9*space>" as a symbol table by
inserting something like this before the final "else" in interpret_header():

>  else if (hdr->ar_name[1] == 'S' && hdr->ar_name[2] == 'Y'
>	   && hdr->ar_name[3] == 'M' && hdr->ar_name[4] == '6'
>	   && hdr->ar_name[5] == '4' && hdr->ar_name[6] == '/'
>	   && hdr->ar_name[7] == ' '
>	  )
>    {
>      // 64-bit symbol table.
>      pname->clear();
>    }

Note:  Same problem as this one:
http://code.google.com/p/go/issues/detail?id=6383
>From gcc-bugs-return-450095-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 29 07:20:23 2014
Return-Path: <gcc-bugs-return-450095-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20036 invoked by alias); 29 Apr 2014 07:20:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19998 invoked by uid 48); 29 Apr 2014 07:20:15 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60994] gcc does not recognize hidden/shadowed enumeration as valid nested-name-specifier
Date: Tue, 29 Apr 2014 07:20:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60994-4-UjqTXtjq0O@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60994-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60994-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02115.txt.bz2
Content-length: 619

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

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Markus Trippelsdorf from comment #1)
> Implicit enum to int conversion is not provided for a scoped enumeration.

That said it is strange that gcc also rejects a plain enum:

markus@x4 /tmp % cat foo.cpp
enum A
{
  n = 3
};

int
foo()
{
  int A;
  return A::n;
}

markus@x4 /tmp % g++ -c -std=c++11 -O3 foo.cpp
foo.cpp: In function ‘int foo()’:
foo.cpp:10:10: error: ‘A’ is not a class, namespace, or enumeration
   return A::n;
          ^
>From gcc-bugs-return-450096-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 29 07:21:13 2014
Return-Path: <gcc-bugs-return-450096-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21769 invoked by alias); 29 Apr 2014 07:21:13 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21734 invoked by uid 48); 29 Apr 2014 07:21:08 -0000
From: "momchil.velikov at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60994] gcc does not recognize hidden/shadowed enumeration as valid nested-name-specifier
Date: Tue, 29 Apr 2014 07:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: momchil.velikov at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60994-4-hFZmft7MOs@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60994-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60994-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02116.txt.bz2
Content-length: 879

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`994

--- Comment #3 from Momchil Velikov <momchil.velikov at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #1)
> Implicit enum to int conversion is not provided for a scoped enumeration.

This is not the reported error.

In fact, the correct output of the compiler would be to report the invalid
implicit conversion. It does not.

With explicit conversion to int, the compiler still gives an error, but the
error message is not helpful and obscures the cause of the problem, i.e.,
compiling this:

enum struct A
{
  n = 3
};

int
foo()
{
  int A;
  return int(A::n);
}

results in:


b.cc: In function 'int foo()':
b.cc:10:10: error: expected primary-expression before 'int'
   return int(A::n);
          ^
b.cc:10:10: error: expected ';' before 'int'
b.cc:10:10: error: expected primary-expression before 'int'


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

* [Bug go/60995] gccgo ignores .a files with "/SYM64/" symbol table
  2014-04-29  7:12 [Bug go/60995] New: gccgo ignores .a files with "/SYM64/" symbol table vogt at linux dot vnet.ibm.com
@ 2015-02-03 19:59 ` ian at airs dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ian at airs dot com @ 2015-02-03 19:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60995

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Ian Lance Taylor <ian at airs dot com> ---
Fixed by https://codereview.appspot.com/154800044 .


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

end of thread, other threads:[~2015-02-03 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-29  7:12 [Bug go/60995] New: gccgo ignores .a files with "/SYM64/" symbol table vogt at linux dot vnet.ibm.com
2015-02-03 19:59 ` [Bug go/60995] " ian at airs 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).