From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19358 invoked by alias); 11 Feb 2014 19:14:58 -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 19317 invoked by uid 48); 11 Feb 2014 19:14:52 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60151] New: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64 Date: Tue, 11 Feb 2014 19:14: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: 4.9.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 cc 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: 2014-02/txt/msg01080.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60151 Bug ID: 60151 Summary: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: ubizjak at gmail dot com i386.h has /* Under some conditions we need jump tables in the text section, because the assembler cannot handle label differences between sections. This is the case for x86_64 on Mach-O for example. */ #define JUMP_TABLES_IN_TEXT_SECTION \ (flag_pic && ((TARGET_MACHO && TARGET_64BIT) \ || (!TARGET_64BIT && !HAVE_AS_GOTOFF_IN_DATA))) HAVE_AS_GOTOFF_IN_DATA is only used for 32-bit PIC. However, configure.ac has gcc_GAS_CHECK_FEATURE([GOTOFF in data], gcc_cv_as_ix86_gotoff_in_data, [2,11,0],, [ .text .L0: nop .data .long .L0@GOTOFF]) AC_DEFINE_UNQUOTED(HAVE_AS_GOTOFF_IN_DATA, On Linux/x86-64, we get configure:25031: checking assembler for GOTOFF in data configure:25048: /usr/local/bin/as --64 -o conftest.o conftest.s >&5 conftest.s: Assembler messages: conftest.s:5: Error: 8-byte relocation cannot be applied to 4-byte field configure:25051: $? = 1 configure: failed program was .text .L0: nop .data .long .L0@GOTOFF configure:25062: result: no On Linux/i686, we get configure:25026: checking assembler for GOTOFF in data configure:25043: /usr/local32/bin/as --32 -o conftest.o conftest.s >&5 configure:25046: $? = 0 configure:25057: result: yes As the result, we put jump table in .text section for -m32 -fPIC on Linux/x86-64.