From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38852 invoked by alias); 14 Dec 2018 13:44:39 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 38021 invoked by uid 89); 14 Dec 2018 13:44:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*roland, sk:roland, U*roland, roland X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-wr1-f54.google.com Received: from mail-wr1-f54.google.com (HELO mail-wr1-f54.google.com) (209.85.221.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Dec 2018 13:44:32 +0000 Received: by mail-wr1-f54.google.com with SMTP id z5so5473598wrt.11 for ; Fri, 14 Dec 2018 05:44:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diamand.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qlzsohk8WQBuFXt3NXTNq/Gb1yqUR2gToq8ADwuervc=; b=H5OcpvnfqbZCPCGK09qpnHx54x0KVtFA5Kl62+n5Yf2liJ689zS1i8OvFAAY3L6zEp qVinRjdnS7aHXl9DKszodKKWYESdoTT20JlCoOl05V3p+/gkBltfjZItR+eSh6A/tKvA jziOnBIONXwl6mJB+jBmhSCppUhCFMSb8bxtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qlzsohk8WQBuFXt3NXTNq/Gb1yqUR2gToq8ADwuervc=; b=bFbGzxwjwCJ+6J6WY9gIBV74rfq6hRzWKfoE3lnf3z4hcmop3HkyrZWk/s3DsrhTNJ K6BV2r4iBfzEjubVjDfo3+MrLkT97tU7oOKLx9pn3cbWxOn+a5y+x7s2RThIPmVOxR7M ta6k+glqwRgxtCa+M6Y9FBFsdxKEmj9oRKXaXFPBJsLroxwtyY/We/KdohhI4ga1rUzx 3lFVhvh4YCtP2ZES2G0gtD3eEz3HGEwRIXuNrCVwfg5NKvtolrG9Xul+4NVKFBRbGhNn GGF6dXV2REMKZwya86sWHVGJx5Nb/1H200QE8FfkRPsGds5pQIs7WQ9bWPC/tk2blQ5G zLNg== X-Gm-Message-State: AA+aEWamfbfFkiFAI/vlx38ttFxopCw+SxKnZ8UD3ao7qpQYDt/TS+1k JuYQ8ssg7838PdRUSyg1yHDk3vZHgUGd0e7CPzOcynWBLYY= X-Google-Smtp-Source: AFSGD/VRgbe7AiPfLl6YgtvGm91wd1KIppibWAxReKxlE94Pf9bL1l5yo5cf7GEeI3ZfWN1LIwleiMJA6vbvC8EIU2w= X-Received: by 2002:adf:f5d1:: with SMTP id k17mr2899877wrp.59.1544795070102; Fri, 14 Dec 2018 05:44:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Luke Diamand Date: Fri, 14 Dec 2018 13:44:00 -0000 Message-ID: Subject: Re: dwfl_link_map_report() on a core file with sysroot? Opens the wrong solibs? To: Roland McGrath Cc: elfutils-devel@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00225.txt.bz2 On Thu, 13 Dec 2018 at 22:37, Roland McGrath wrote: > > I think it's just missing. The hardest part is just deciding how the configuration should work. Thanks. My current attempt adds a new function call, dwfl_set_sysroot(), which works, but feels a bit clunky. I might see if I can just use the find_elf callback instead. > > On Thu, Dec 13, 2018, 12:27 Luke Diamand > >> I'm trying to get callstacks out of a core file using libdwfl where >> the ELF files live in a sysroot (and are from a different >> architecture, ARM). >> >> I'm possibly doing something stupid as I find that >> dwfl_link_map_report() opens /lib/libpthread.so on the *host* rather >> than the libpthread.so from my sysroot. It obviously doesn't then get >> very far. >> >> I called elf_begin(), dwfl_begin() and then dwfl_core_file_report(), >> passing in the path to the executable (in the sysroot). >> >> There's a comment in link_map.c around line 390 which says: >> >> // XXX hook for sysroot >> >> So inspired by this, I hacked in some code to open files relative to >> my sysroot and it all started working. >> >> Am I just missing some obvious setup, or is this just missing sysroot support? >> >> Thanks! >> Luke >> > -- > > > Thanks, > Roland