From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa:ppc64gnulinux] Call ".malloc"
Date: Fri, 14 Nov 2003 00:56:00 -0000 [thread overview]
Message-ID: <3FB42852.8090007@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
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
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 760 bytes --]
2003-11-13 Andrew Cagney <cagney@redhat.com>
* 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");
}
}
next reply other threads:[~2003-11-14 0:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-14 0:56 Andrew Cagney [this message]
2003-11-14 1:13 ` Kevin Buettner
2003-11-14 14:23 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3FB42852.8090007@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox