From patchwork Mon Apr 6 17:26:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 6020 Received: (qmail 14119 invoked by alias); 6 Apr 2015 17:26:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 14110 invoked by uid 89); 6 Apr 2015 17:26:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 06 Apr 2015 17:26:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9A5E9BBF49 for ; Mon, 6 Apr 2015 17:26:56 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t36HQtLa000807; Mon, 6 Apr 2015 13:26:55 -0400 Subject: [PATCH v2 4/9] compile: Support relocation to GNU-IFUNCs From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Phil Muldoon Date: Mon, 06 Apr 2015 19:26:54 +0200 Message-ID: <20150406172654.31404.63699.stgit@host1.jankratochvil.net> In-Reply-To: <20150406172623.31404.58833.stgit@host1.jankratochvil.net> References: <20150406172623.31404.58833.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes The 'compile print' part disclosed that calling memcpy() may fail as memcpy() from libc is GNU-IFUNC. gdb/ChangeLog 2015-04-06 Jan Kratochvil * compile/compile-object-load.c (compile_object_load): Support mst_text_gnu_ifunc. --- gdb/compile/compile-object-load.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 70b2e2e..ed2cad4 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -555,6 +555,10 @@ compile_object_load (const char *object_file, const char *source_file, case mst_text: sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym); break; + case mst_text_gnu_ifunc: + sym->value = gnu_ifunc_resolve_addr (target_gdbarch (), + BMSYMBOL_VALUE_ADDRESS (bmsym)); + break; default: warning (_("Could not find symbol \"%s\" " "for compiled module \"%s\"."),