From patchwork Sun May 3 14:07:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 6539 Received: (qmail 89378 invoked by alias); 3 May 2015 14:07:32 -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 89359 invoked by uid 89); 3 May 2015 14:07:31 -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; Sun, 03 May 2015 14:07:30 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t43E7StV022364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 3 May 2015 10:07:28 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t43E7RRv012825; Sun, 3 May 2015 10:07:28 -0400 Subject: [PATCH v4 05/11] compile: Support relocation to GNU-IFUNCs From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Phil Muldoon Date: Sun, 03 May 2015 16:07:27 +0200 Message-ID: <20150503140727.18583.49945.stgit@host1.jankratochvil.net> In-Reply-To: <20150503140647.18583.2012.stgit@host1.jankratochvil.net> References: <20150503140647.18583.2012.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 dbd5ec0..fd440be 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\"."),