From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Bug 1257099] [NEW] QEMU fails to build on CentOS 5.10 with relocation R_X86_64_PC32 error Date: Thu, 05 Dec 2013 16:18:11 +0100 Message-ID: <52A09933.5090302@redhat.com> References: <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <529E1194.9060504@redhat.com> <529E8638.2010102@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <529E8638.2010102@terremark.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Don Slutz Cc: 1257099@bugs.launchpad.net, Ian Campbell , xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Il 04/12/2013 02:32, Don Slutz ha scritto: > Any hints or pointers about the bug in RHEL5 binutils? I can try and > make a patch to auto detect this. Actually it's RHEL5 GCC: $ cat f.c void * f(unsigned char *buf, int len) { return (void*)0L; } void * g(unsigned char *buf, int len) { return f(buf, len); } $ gcc -shared -o f.so f.c -fPIE -fPIC /usr/bin/ld: /tmp/ccQc9els.o: relocation R_X86_64_PC32 against `f' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status The bug is simply that "-fPIE -fPIC" counts as -fPIE rather than -fPIC: $ gcc -S -o - f.c -fPIE |grep call call f # PC32 relocation $ gcc -S -o - f.c -fPIC |grep call call f@PLT # PLT32 relocation On RHEL5: $ gcc -S -o - f.c -fPIE -fPIC |grep call call f On RHEL6: $ gcc -S -o - f.c -fPIE -fPIC |grep call call f@PLT Paolo