From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24141 invoked by alias); 3 Nov 2010 08:48:09 -0000 Received: (qmail 24131 invoked by uid 22791); 3 Nov 2010 08:48:08 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID,TW_BJ,TW_ZJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Nov 2010 08:48:05 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/46275] -masm=intel -fPIC causes global offset table issues X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak 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-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 03 Nov 2010 08:48:00 -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 X-SW-Source: 2010-11/txt/msg00265.txt.bz2 Message-ID: <20101103084800.9lWQRt5uukRnL7_2BWZbVSDX45J13wN5Vli4IbDSKKA@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46275 --- Comment #7 from Uros Bizjak 2010-11-03 08:47:48 UTC --- For some reason, the addend in R_386_GOTPC reloc is missing when compiled with -masm=intel. The objdump difference between -masm=att [hello.o] that works and -masm=intel [hello_.o] that fails is: @@ -1,5 +1,5 @@ -hello.o: file format elf32-i386 +hello_.o: file format elf32-i386 Disassembly of section .text: @@ -12,7 +12,7 @@ 7: 83 ec 1c sub $0x1c,%esp a: e8 fc ff ff ff call b b: R_386_PC32 __i686.get_pc_thunk.bx - f: 81 c3 02 00 00 00 add $0x2,%ebx + f: 81 c3 00 00 00 00 add $0x0,%ebx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 15: 8d 83 00 00 00 00 lea 0x0(%ebx),%eax 17: R_386_GOTOFF .rodata