Bug 71155

Summary: symbol in wrong section .data.rel.local on mips64el
Product: gcc Reporter: Aurelien Jarno <aurelien>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: P3    
Version: 4.9.0   
Target Milestone: ---   
Host: mips64el-linux-gnuabi64 Target: mips64el-linux-gnuabi64
Build: mips64el-linux-gnuabi64 Known to work: 4.8.5
Known to fail: 4.9.3, 5.3.1, 6.1.1, 7.0 Last reconfirmed:
Attachments: preprocessed source file

Description Aurelien Jarno 2016-05-16 22:50:25 UTC
Created attachment 38503 [details]
preprocessed source file

When compiling the GNU libc on mips64el-linux-gnuabi64 with GCC >= 4.9, the resulting libc causes lua 5.2 to not work correcty. It happens this is due to wrong the compilation of libio/oldstdfiles.c. When using GCC <= 4.8, the _IO_stdin_ symbol ends up in the data.rel section just like _IO_stdout_ and _IO_stderr_. When using GCC >= 4.9, the _IO_stdin_ symbol is moved to the .data.rel.local section, while the two others are unchanged.

This is also reproducible with GCC 5 and GCC 6.

The issue seems to have been introduced by the following patch:
https://gcc.gnu.org/ml/gcc-patches/2014-01/msg01169.html

I have attached the preprocessed source file, the original source file can be found there:
https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/oldstdfiles.c;h=609b7d9ef2d78f851a29b3d25efbb03f9c76ca91;hb=HEAD