diff options
author | Roland McGrath <roland@redhat.com> | 2008-08-07 08:39:41 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2008-08-07 08:39:41 +0000 |
commit | 1d8bb25cac06b5af57f8733e5ea7a068a79edfe0 (patch) | |
tree | f794a75ef8e1f324185d2850e6e4da59323fe9ca /backends | |
parent | 9d2f3ee2554185a9df70f434eddc4405a4aff0fa (diff) | |
download | elfutils-1d8bb25cac06b5af57f8733e5ea7a068a79edfe0.tar.gz |
src/
(find_symbol): Likewise.
Convert plain number, or handle strings like "(section)+offset"
or "symbol+offset".
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 19 | ||||
-rw-r--r-- | backends/Makefile.am | 8 | ||||
-rw-r--r-- | backends/i386_init.c | 3 | ||||
-rw-r--r-- | backends/i386_syscall.c | 47 | ||||
-rw-r--r-- | backends/linux-core-note.c | 6 | ||||
-rw-r--r-- | backends/ppc64_init.c | 3 | ||||
-rw-r--r-- | backends/ppc_corenote.c | 7 | ||||
-rw-r--r-- | backends/ppc_init.c | 1 | ||||
-rw-r--r-- | backends/ppc_syscall.c | 50 | ||||
-rw-r--r-- | backends/x86_64_init.c | 1 | ||||
-rw-r--r-- | backends/x86_64_syscall.c | 47 |
11 files changed, 182 insertions, 10 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 06e9041f..96b64794 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,22 @@ +2008-08-01 Roland McGrath <roland@redhat.com> + + * linux-core-note.c (prstatus_items): Use 'B' instead of 'b' + for sigpend and sighold. + +2008-07-04 Roland McGrath <roland@redhat.com> + + * i386_syscall.c: New file. + * x86_64_syscall.c: New file. + * ppc_syscall.c: New file. + * Makefile.am (i386_SRCS, x86_64_SRCS, ppc_SRCS, ppc64_SRCS): Add them. + * i386_init.c (i386_init): Initialize syscall_abi hook. + * x86_64_init.c (x86_64_init): Likewise. + * ppc_init.c (ppc_init): Likewise. + * ppc64_init.c (ppc64_init): Likewise. + + * ppc_corenote.c (PRSTATUS_REGSET_ITEMS): Add nip. + Fix offset calculation for 64-bit case. + 2008-04-04 Roland McGrath <roland@redhat.com> * alpha_symbol.c (alpha_check_special_section): New function. diff --git a/backends/Makefile.am b/backends/Makefile.am index 75eacde9..ebf6b09e 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -61,7 +61,7 @@ textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ - i386_retval.c i386_regs.c i386_auxv.c + i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c cpu_i386 = ../libcpu/libcpu_i386.a libebl_i386_pic_a_SOURCES = $(i386_SRCS) am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) @@ -71,7 +71,7 @@ libebl_sh_pic_a_SOURCES = $(sh_SRCS) am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \ - x86_64_retval.c x86_64_regs.c i386_auxv.c + x86_64_retval.c x86_64_regs.c i386_auxv.c x86_64_syscall.c cpu_x86_64 = ../libcpu/libcpu_x86_64.a libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS) am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) @@ -95,12 +95,12 @@ libebl_sparc_pic_a_SOURCES = $(sparc_SRCS) am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \ - ppc_corenote.c ppc_auxv.c ppc_attrs.c + ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c libebl_ppc_pic_a_SOURCES = $(ppc_SRCS) am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \ - ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c + ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS) am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) diff --git a/backends/i386_init.c b/backends/i386_init.c index bf6c130c..f046dfb6 100644 --- a/backends/i386_init.c +++ b/backends/i386_init.c @@ -1,5 +1,5 @@ /* Initialization of i386 specific backend library. - Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2000. @@ -56,6 +56,7 @@ i386_init (elf, machine, eh, ehlen) HOOK (eh, debugscn_p); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, syscall_abi); HOOK (eh, auxv_info); HOOK (eh, disasm); diff --git a/backends/i386_syscall.c b/backends/i386_syscall.c new file mode 100644 index 00000000..4d6e438c --- /dev/null +++ b/backends/i386_syscall.c @@ -0,0 +1,47 @@ +/* Linux/i386 system call ABI in DWARF register numbers. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#define BACKEND i386_ +#include "libebl_CPU.h" + +int +i386_syscall_abi (Ebl *ebl __attribute__ ((unused)), + int *sp, int *pc, int *callno, int args[6]) +{ + *sp = 4; /* %esp */ + *pc = 8; /* %eip */ + *callno = 0; /* %eax */ + args[0] = 3; /* %ebx */ + args[1] = 1; /* %ecx */ + args[2] = 2; /* %edx */ + args[3] = 6; /* %esi */ + args[4] = 7; /* %edi */ + args[5] = 5; /* %ebp */ + return 0; +} diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c index 3dc41373..7b1fc025 100644 --- a/backends/linux-core-note.c +++ b/backends/linux-core-note.c @@ -1,5 +1,5 @@ /* Common core note type descriptions for Linux. - Copyright (C) 2007 Red Hat, Inc. + Copyright (C) 2007, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -118,8 +118,8 @@ static const Ebl_Core_Item prstatus_items[] = FIELD (signal, INT, info.si_code, 'd'), FIELD (signal, INT, info.si_errno, 'd'), FIELD (signal, SHORT, cursig, 'd'), - FIELD (signal, ULONG, sigpend, 'b'), - FIELD (signal, ULONG, sighold, 'b'), + FIELD (signal, ULONG, sigpend, 'B'), + FIELD (signal, ULONG, sighold, 'B'), FIELD (identity, PID_T, pid, 'd', .thread_identifier = true), FIELD (identity, PID_T, ppid, 'd'), FIELD (identity, PID_T, pgrp, 'd'), diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c index 02a592fd..3060a605 100644 --- a/backends/ppc64_init.c +++ b/backends/ppc64_init.c @@ -1,5 +1,5 @@ /* Initialization of PPC64 specific backend library. - Copyright (C) 2004, 2005, 2006, 2007 Red Hat, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -58,6 +58,7 @@ ppc64_init (elf, machine, eh, ehlen) HOOK (eh, bss_plt_p); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, syscall_abi); HOOK (eh, core_note); HOOK (eh, auxv_info); diff --git a/backends/ppc_corenote.c b/backends/ppc_corenote.c index 59e619e1..af0c46aa 100644 --- a/backends/ppc_corenote.c +++ b/backends/ppc_corenote.c @@ -118,8 +118,13 @@ static const Ebl_Register_Location spe_regs[] = #define PRSTATUS_REGSET_ITEMS \ { \ + .name = "nip", .type = ELF_T_ADDR, .format = 'x', \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_reg[32]), \ + .group = "register" \ + }, \ + { \ .name = "orig_gpr3", .type = TYPE_LONG, .format = 'd', \ - .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 34), \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_reg[34]), \ .group = "register" \ } diff --git a/backends/ppc_init.c b/backends/ppc_init.c index 2e587167..523c6583 100644 --- a/backends/ppc_init.c +++ b/backends/ppc_init.c @@ -57,6 +57,7 @@ ppc_init (elf, machine, eh, ehlen) HOOK (eh, bss_plt_p); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, syscall_abi); HOOK (eh, core_note); HOOK (eh, auxv_info); HOOK (eh, check_object_attribute); diff --git a/backends/ppc_syscall.c b/backends/ppc_syscall.c new file mode 100644 index 00000000..23eff812 --- /dev/null +++ b/backends/ppc_syscall.c @@ -0,0 +1,50 @@ +/* Linux/PPC system call ABI in DWARF register numbers. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#define BACKEND ppc_ +#include "libebl_CPU.h" + +int +ppc_syscall_abi (Ebl *ebl __attribute__ ((unused)), + int *sp, int *pc, int *callno, int args[6]) +{ + *sp = 1; + *pc = -1; + *callno = 0; + args[0] = 3; + args[1] = 4; + args[2] = 5; + args[3] = 6; + args[4] = 7; + args[5] = 8; + return 0; +} + +__typeof (ppc_syscall_abi) +ppc64_syscall_abi __attribute__ ((alias ("ppc_syscall_abi"))); diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c index 4e9eb55c..a2eaffa5 100644 --- a/backends/x86_64_init.c +++ b/backends/x86_64_init.c @@ -53,6 +53,7 @@ x86_64_init (elf, machine, eh, ehlen) HOOK (eh, core_note); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, syscall_abi); HOOK (eh, auxv_info); HOOK (eh, disasm); diff --git a/backends/x86_64_syscall.c b/backends/x86_64_syscall.c new file mode 100644 index 00000000..c3db715d --- /dev/null +++ b/backends/x86_64_syscall.c @@ -0,0 +1,47 @@ +/* Linux/x86-64 system call ABI in DWARF register numbers. + Copyright (C) 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + + Red Hat elfutils is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#define BACKEND x86_64_ +#include "libebl_CPU.h" + +int +x86_64_syscall_abi (Ebl *ebl __attribute__ ((unused)), + int *sp, int *pc, int *callno, int args[6]) +{ + *sp = 7; /* %rsp */ + *pc = 16; /* %rip */ + *callno = 0; /* %rax */ + args[0] = 5; /* %rdi */ + args[1] = 4; /* %rsi */ + args[2] = 1; /* %rdx */ + args[3] = 10; /* %r10 */ + args[4] = 8; /* %r8 */ + args[5] = 9; /* %r9 */ + return 0; +} |