From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6577 Path: news.gmane.org!not-for-mail From: Timo Teras Newsgroups: gmane.linux.lib.musl.general Subject: Re: webkitfltk segfaults in do_relocs Date: Thu, 20 Nov 2014 08:14:24 +0200 Message-ID: <20141120081424.293a413a@vostro> References: <20141119164412.GB16895@newbook> <20141119165050.GK22465@brightrain.aerifal.cx> <20141119190444.GA17350@newbook> <20141119191311.GM22465@brightrain.aerifal.cx> <20141119194827.GA18135@newbook> <20141119195824.GN22465@brightrain.aerifal.cx> <20141119202001.GA18169@newbook> <20141119205635.GO22465@brightrain.aerifal.cx> <20141119224339.GA18306@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1416464129 21652 80.91.229.3 (20 Nov 2014 06:15:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2014 06:15:29 +0000 (UTC) Cc: musl@lists.openwall.com To: Isaac Dunham Original-X-From: musl-return-6590-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 20 07:15:22 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XrL1W-0007V0-6t for gllmg-musl@m.gmane.org; Thu, 20 Nov 2014 07:15:22 +0100 Original-Received: (qmail 32217 invoked by uid 550); 20 Nov 2014 06:15:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32205 invoked from network); 20 Nov 2014 06:15:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Cgo8opFfbD5RTojtKAqHRbX3V8qbZ5mp2iIWgQntzxw=; b=MQ+c/vXYJ5QgHI5amJJmQ3J1A+jXiMoaXj7CqTN/aTOzgoibJlv98KMRElXrJDGEcF C/Qr58zuhx+hMgoPknFkyZuSOYERm6V8HQieI19oLkBezcKNm/YL9wurNZltnE8f0MIx jh5uRIOb2gvgx2Y0uIQF17cjV54MqsjpDNkhOaHiIP1CVKUXv5GEI6EgL9uIbHc7atIS KVehrFTVfPmlBB2YDOsOdOcwtZKCm0ovEVBq+y6E61FjNxjWuGKJuP6uH/z2lWF/UFQB jKHUod+wteW58utG7HyWKUQiKzecJOvdsRDsIdXSzhMyN8/beW1ig4rL/2kuUDHmeSeR U6og== X-Received: by 10.112.168.201 with SMTP id zy9mr873202lbb.77.1416464109115; Wed, 19 Nov 2014 22:15:09 -0800 (PST) Original-Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= In-Reply-To: <20141119224339.GA18306@newbook> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.23; x86_64-alpine-linux-musl) Xref: news.gmane.org gmane.linux.lib.musl.general:6577 Archived-At: On Wed, 19 Nov 2014 14:43:40 -0800 Isaac Dunham wrote: > On Wed, Nov 19, 2014 at 03:56:35PM -0500, Rich Felker wrote: > > Got it. The line number in your original report seems to be off by a > > bit (it points to TLSDESC related cases) but I've found the > > offending relocation(s): > > > > 0083deea 0000c402 R_386_PC32 00000000 exp > > 0083df03 00010a02 R_386_PC32 00000000 log > > 0083df1c 00030502 R_386_PC32 00000000 floor > > 0083df35 00024502 R_386_PC32 00000000 ceil > > > > I have no idea why the linker is emitting these. It should have > > resolved them at ld time to PLT entries in the main program's PLT, > > but maybe since you're building as PIE (this is defautl on Alpine) > > that doesn't happen (this would be a linker bug, IMO). If it were > > going to do this (leave the relocations in the output), it should > > mark the program as DT_TEXTREL (having textrels), but this is > > probably suppressed for PIE because it's not supposed to happen. See also the following link on how to figure out where textrels come from: http://wiki.gentoo.org/wiki/Hardened/HOWTO_locate_and_fix_textrels > > My best guess as to what's triggering the problem is that there's > > some nasty asm or other hacks that are not PIE-compatible somewhere > > in the program. It's also possible that you're pulling in static > > libraries (which would not be PIE-compatible) due to not having the > > dynamic version of a needed library installed. > > All external libs are available in shared format, except perhaps -lgcc > But the whole library is built in static form only, without -fPIC. You need -fPIC for PIE-linking. Missing -fPIC is likely cause for this. If there's some weird reason to not use -fPIC, you probably also need to link the executable with -fno-PIE, but this means the main DSO will not be included in address space layout randomization. /Timo