From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125986 invoked by alias); 16 Apr 2015 12:12:15 -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 123497 invoked by uid 48); 16 Apr 2015 12:12:11 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65780] [5/6 Regression] Uninitialized common handling in executables Date: Thu, 16 Apr 2015 12:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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/msg01345.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65780 --- Comment #21 from Jakub Jelinek --- I've repeated my test on the various architectures, this time with additional readelf -Ws test | grep optopt if the link succeeds. And indeed, x86_64 with recent linker is the only one where optopt is defined, rather than SHN_UNDEF in the PIE. armv7hl, s390, s390x, i686 and x86_64 with old linker all have optopt defined in the binary for normal executable (!flag_pic) and SHN_UNDEF for PIE. Thus, based on this I'd say that i386 backend should pass !flag_pic || (TARGET_64BIT && HAVE_LD_PIE_COPYRELOC != 0) to the new param (in ix86_binds_local_p). Then, perhaps you should make default_binds_local_p_3 also non-static and declared in output.h, ix86_binds_local_p should perhaps use it directly, and default_binds_local_p_2 should have just a single argument, so that arm and s390 backends (dunno, maybe aarch64 and a few others too) could use it directly as their TARGET_BINDS_LOCAL_P definition. default_binds_local_p_2 would then call default_binds_local_p_3 with exp, flag_shlib != 0, true, false, !flag_pic arguments. And obviously all the two (default_binds_local_p{,2}) should have better documentation on how they differ.