From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7377 invoked by alias); 14 Nov 2003 00:56:55 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7368 invoked from network); 14 Nov 2003 00:56:55 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 14 Nov 2003 00:56:55 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1E67E2B8F for ; Thu, 13 Nov 2003 19:56:51 -0500 (EST) Message-ID: <3FB42852.8090007@redhat.com> Date: Fri, 14 Nov 2003 00:56:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa:ppc64gnulinux] Call ".malloc" Content-Type: multipart/mixed; boundary="------------080104070407060304010409" X-SW-Source: 2003-11/txt/msg00282.txt.bz2 This is a multi-part message in MIME format. --------------080104070407060304010409 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 505 Hello, When only minimal symbol information is available, the symbol "malloc", which is found in a data section because it's a descriptor, gets turns into a 32-bit int variable. Consequently, an attempt to call "malloc" is turned into to jump to the code designated by that 32-bit integer value found at malloc. This patch avoids that problem entirely by specifying that on PPC64 GNU/Linux, the "malloc" function has the name ".malloc" (which is really the function's start address). ok? Andrew --------------080104070407060304010409 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 760 2003-11-13 Andrew Cagney * ppc-linux-tdep.c (ppc_linux_init_abi): Set PPC64's "name_of_malloc" to ".malloc". Index: ppc-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v retrieving revision 1.48 diff -u -r1.48 ppc-linux-tdep.c --- ppc-linux-tdep.c 13 Nov 2003 18:08:57 -0000 1.48 +++ ppc-linux-tdep.c 14 Nov 2003 00:40:57 -0000 @@ -1083,6 +1083,9 @@ set_gdbarch_in_solib_call_trampoline (gdbarch, ppc64_in_solib_call_trampoline); set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); + + /* PPC64 malloc's entry-point is called ".malloc". */ + set_gdbarch_name_of_malloc (gdbarch, ".malloc"); } } --------------080104070407060304010409--