From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383AbbF0JEJ (ORCPT ); Sat, 27 Jun 2015 05:04:09 -0400 Received: from foss.arm.com ([217.140.101.70]:34338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752751AbbF0JEB (ORCPT ); Sat, 27 Jun 2015 05:04:01 -0400 Date: Sat, 27 Jun 2015 10:03:54 +0100 From: Will Deacon To: Andy Lutomirski Cc: Adrian Hunter , "acme@redhat.com" , "linux-kernel@vger.kernel.org" , Kristina Martsenko , Vladimir Nikulichev , Namhyung Kim Subject: Re: [PATCH] perf tools: don't adjust symbols in vDSO Message-ID: <20150627090354.GA29944@arm.com> References: <1435162623-20075-1-git-send-email-will.deacon@arm.com> <558C02DD.4010700@intel.com> <20150626122308.GC9791@arm.com> <558D59D1.1040102@intel.com> <20150626145835.GD9791@arm.com> <20150626152952.GE9791@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2015 at 04:44:14PM +0100, Andy Lutomirski wrote: > On Fri, Jun 26, 2015 at 8:29 AM, Will Deacon wrote: > > On Fri, Jun 26, 2015 at 04:18:59PM +0100, Andy Lutomirski wrote: > >> On Fri, Jun 26, 2015 at 7:58 AM, Will Deacon wrote: > >> > (CC'ing Andy, since the removal of VDSO_PRELINK is user-visible here) > >> > >> What arch is this? I removed VDSO_PRELINK entirely from x86 a while > >> back, and now x86's vdso has a base address of 0 before relocations, > >> and everything works just fine. > > > > I think this is only x86, since it's the removal of VDSO_PRELINK that > > has changed things. > > > >> (Except one ancient glibc, which fails if the vdso is relocated at > >> all. We no longer support that version of glibc unless you turn off > >> the vdso entirely.) > > > > The problem is that perf expects to objdump portions of the vdso using > > --start-address=foo and --stop-address=bar, but these addresses have changed > > from being offset by VDSO_PRELINK to 0x0. > > > > Thankfully, it looks like perf tool was always broken in this regard, but > > I figured you might like to be aware of the issue. I guess perf just needs > > to add on the load address of the vdso .text section to its relative > > addresses before passing them to objdump. > > > > Given that we've randomized the vdso load address on x86 for years, I > don't see how perf ever worked here. There was a brief period during > which we actually loaded the vdso at the address VDSO_PRELINK, but > that's long gone. The symbol resolution works by applying the vdso symbol offset to the [vdso] vma base, but perf annotate had indeed been broken the whole time. > Is there a patch I should be looking at? I've cooked something, so I'll send it out now. Will