From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73001 invoked by alias); 25 Apr 2015 13:45:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 72981 invoked by uid 48); 25 Apr 2015 13:45:40 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65886] New: [5/6 Regression] External reference in PIE to DSO created with -Wl,-Bsymbolic Date: Sat, 25 Apr 2015 13:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2015-04/txt/msg02175.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65886 Bug ID: 65886 Summary: [5/6 Regression] External reference in PIE to DSO created with -Wl,-Bsymbolic Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Copy relocation in PIE is incompatible with DSO created with -Wl,-Bsymbolic: [hjl@gnu-tools-1 copyreloc-2]$ cat x.c extern int a; extern int *a_p (void); extern void bar (void); extern void *bar_p (void); int main() { if (bar_p () != &bar) __builtin_abort(); if (a_p () != &a) __builtin_abort(); bar (); if (a != 30) __builtin_abort(); return 0; } [hjl@gnu-tools-1 copyreloc-2]$ cat bar.c int a; void bar () { a = 30; } void * bar_p () { return &bar; } int * a_p () { return &a; } [hjl@gnu-tools-1 copyreloc-2]$ make /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -g -O2 -fPIE -c -o x.o x.c /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -g -O2 -fPIC -c -o bar.o bar.c /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -Wl,-Bsymbolic -shared -o libbar.so bar.o /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -pie -o x x.o libbar.so -Wl,-rpath,. ./x Makefile:13: recipe for target 'all' failed make: *** [all] Aborted (core dumped) [hjl@gnu-tools-1 copyreloc-2]$