This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: _IO_check_libio miscompiled on mips64el
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: libc-alpha at sourceware dot org
- Date: Wed, 8 Jun 2016 00:51:19 +0200
- Subject: Re: _IO_check_libio miscompiled on mips64el
- Authentication-results: sourceware.org; auth=none
- References: <20160604133921 dot GA4552 at aurel32 dot net> <40240802-f9a7-f7ae-07af-e5fe4e88e384 at redhat dot com>
On 2016-06-04 16:51, Florian Weimer wrote:
> On 06/04/2016 03:39 PM, Aurelien Jarno wrote:
> > Hi all,
> >
> > The problem I report here looks like a GCC issue, but given it affects
> > the GNU libc, I am also asking for help here. I have found that the
> > function _IO_check_libio in libio/oldstdfiles.c is not compiled
> > correctly on mips64el-linux-gnuabi64 when using GCC >= 4.9. The
> > _IO_stdin_ symbol appears in the .data.rel.local section while I think
> > it should be in the data.rel section just like _IO_stdout_ and
> > _IO_stderr_. This causes, among other things, lua to fail to work
> > correctly.
>
> _IO_check_libio should do nothing at all because _IO_stdin_used is defined
> in all current binaries. If the definitions in oldstdfiles.c make *any*
> difference, this is (perhaps another) bug.
Indeed, you are correct. It appears that most binaries define it, but
the /usr/bin/lua binary doesn't for a reason I haven't identified yet.
It is not specific to mips64el and can also be seen on i386.
> Does this mechanism work in previous GCC versions, i.e. _IO_stdin_used is
> defined there?
It's the same with previous GCC versions, _IO_stdin_used is not defined
in the /usr/bin/lua binary so the whole conditional code is executed,
that said the resulting libc works with lua.
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net