diff options
| author | Roland McGrath <[email protected]> | 2007-08-23 08:10:54 +0000 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2007-08-23 08:10:54 +0000 |
| commit | cb6d865011ad98a8ac2018f072f396a2268739ca (patch) | |
| tree | c497c4dacb592f9da5f5740a8b9fa8d362468079 /backends | |
| parent | 50c6a2f8b9621ae01c8943e80c39bc859c9d5c22 (diff) | |
readelf register printing sort order tweak
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/ChangeLog | 43 | ||||
| -rw-r--r-- | backends/Makefile.am | 17 | ||||
| -rw-r--r-- | backends/alpha_corenote.c | 67 | ||||
| -rw-r--r-- | backends/alpha_init.c | 3 | ||||
| -rw-r--r-- | backends/i386_auxv.c | 49 | ||||
| -rw-r--r-- | backends/i386_corenote.c | 191 | ||||
| -rw-r--r-- | backends/i386_init.c | 3 | ||||
| -rw-r--r-- | backends/linux-core-note.c | 218 | ||||
| -rw-r--r-- | backends/ppc64_corenote.c | 2 | ||||
| -rw-r--r-- | backends/ppc64_init.c | 4 | ||||
| -rw-r--r-- | backends/ppc_auxv.c | 52 | ||||
| -rw-r--r-- | backends/ppc_corenote.c | 102 | ||||
| -rw-r--r-- | backends/ppc_init.c | 4 | ||||
| -rw-r--r-- | backends/ppc_symbol.c | 7 | ||||
| -rw-r--r-- | backends/x86_64_corenote.c | 204 | ||||
| -rw-r--r-- | backends/x86_64_init.c | 5 | ||||
| -rw-r--r-- | backends/x86_64_regs.c | 1 |
17 files changed, 684 insertions, 288 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 994aec07..159e6dc1 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,46 @@ +2007-08-23 Roland McGrath <[email protected]> + + * x86_64_regs.c (x86_64_register_info): Put %rflags in "integer" set. + +2007-08-22 Roland McGrath <[email protected]> + + * linux-core-note.c (prstatus_items): Add .group initializers. + (prpsinfo_items): Likewise. + * x86_64_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise. + * i386_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise. + * ppc_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise. + +2007-08-20 Roland McGrath <[email protected]> + + * ppc_symbol.c (ppc_check_special_symbol): For _GLOBAL_OFFSET_TABLE_ + when DT_PPC_GOT is not found, anywhere in the section is valid. + +2007-08-19 Roland McGrath <[email protected]> + + * i386_auxv.c: New file. + * Makefile.am (i386_SRCS, x86_64_SRCS): Add it. + * ppc_auxv.c: New file. + * Makefile.am (ppc_SRCS, ppc64_SRCS): Add it. + * i386_init.c (i386_init): Initialize auxv_info hook. + * x86_64_init.c (x86_64_init): Likewise. + * ppc_init.c (ppc_init): Likewise. + * ppc64_init.c (ppc64_init): Likewise. + + * alpha_corenote.c: New file. + * Makefile.am (alpha_SRCS): Add it. + * alpha_init.c (alpha_init): Initialize core_note hook. + + * ppc_corenote.c: New file. + * ppc64_corenote.c: New file. + * Makefile.am (ppc_SRCS, ppc64_SRCS): Add them. + * ppc_init.c (ppc_init): Initialize core_note hook. + * ppc64_init.c (ppc64_init): Likewise. + + * linux-core-note.c: New file. + * Makefile.am (noinst_HEADERS): Add it. + * i386_corenote.c: Rewritten. + * x86_64_corenote.c: Likewise. + 2007-05-23 Roland McGrath <[email protected]> * alpha_regs.c (alpha_register_info): fp -> s6 diff --git a/backends/Makefile.am b/backends/Makefile.am index f7e1525d..84aa4785 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in ## -## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. +## Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Red Hat, Inc. ## This file is part of Red Hat elfutils. ## ## Red Hat elfutils is free software; you can redistribute it and/or modify @@ -70,7 +70,7 @@ libebl_%.map: Makefile i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ - i386_retval.c i386_regs.c + i386_retval.c i386_regs.c i386_auxv.c libebl_i386_pic_a_SOURCES = $(i386_SRCS) am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) @@ -79,7 +79,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 + x86_64_retval.c x86_64_regs.c i386_auxv.c libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS) am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) @@ -87,7 +87,8 @@ ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c libebl_ia64_pic_a_SOURCES = $(ia64_SRCS) am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) -alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c +alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \ + alpha_corenote.c libebl_alpha_pic_a_SOURCES = $(alpha_SRCS) am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) @@ -99,11 +100,13 @@ sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c 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_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \ + ppc_corenote.c ppc_auxv.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 ppc_regs.c +ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \ + ppc64_corenote.c ppc_regs.c ppc_auxv.c libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS) am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) @@ -134,7 +137,7 @@ uninstall: uninstall-am done rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) -noinst_HEADERS = libebl_CPU.h common-reloc.c +noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def) CLEANFILES = *.gcno *.gcda \ diff --git a/backends/alpha_corenote.c b/backends/alpha_corenote.c new file mode 100644 index 00000000..dcc62e9e --- /dev/null +++ b/backends/alpha_corenote.c @@ -0,0 +1,67 @@ +/* PowerPC specific core note handling. + Copyright (C) 2007 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 + +#include <elf.h> +#include <inttypes.h> +#include <stddef.h> +#include <stdio.h> +#include <sys/time.h> + +#define BACKEND alpha_ +#include "libebl_CPU.h" + +static const Ebl_Register_Location prstatus_regs[] = + { + { .offset = 0, .regno = 0, .count = 31, .bits = 64 }, /* r0-r30 */ + { .offset = 32 * 8, .regno = 64, .count = 1, .bits = 64 }, /* pc */ + { .offset = 33 * 8, .regno = 66, .count = 1, .bits = 64 }, /* unique */ + }; +#define PRSTATUS_REGS_SIZE (33 * 8) + +static const Ebl_Register_Location fpregset_regs[] = + { + { .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f30, fpcr */ + }; +#define FPREGSET_SIZE (32 * 8) + +#define ULONG uint64_t +#define ALIGN_ULONG 8 +#define TYPE_ULONG ELF_T_XWORD +#define TYPE_LONG ELF_T_SXWORD +#define PID_T int32_t +#define UID_T uint32_t +#define GID_T uint32_t +#define ALIGN_PID_T 4 +#define ALIGN_UID_T 4 +#define ALIGN_GID_T 4 +#define TYPE_PID_T ELF_T_SWORD +#define TYPE_UID_T ELF_T_WORD +#define TYPE_GID_T ELF_T_WORD + +#include "linux-core-note.c" diff --git a/backends/alpha_init.c b/backends/alpha_init.c index ba5ca12f..794d412a 100644 --- a/backends/alpha_init.c +++ b/backends/alpha_init.c @@ -54,8 +54,9 @@ alpha_init (elf, machine, eh, ehlen) HOOK (eh, dynamic_tag_check); HOOK (eh, reloc_simple_type); HOOK (eh, return_value_location); - HOOK (eh, register_info); HOOK (eh, machine_section_flag_check); + HOOK (eh, register_info); + HOOK (eh, core_note); eh->sysvhash_entrysize = sizeof (Elf64_Xword); return MODVERSION; diff --git a/backends/i386_auxv.c b/backends/i386_auxv.c new file mode 100644 index 00000000..5f7b15ef --- /dev/null +++ b/backends/i386_auxv.c @@ -0,0 +1,49 @@ +/* i386 specific auxv handling. + Copyright (C) 2007 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 +EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format) +{ + if (a_type != AT_HWCAP) + return 0; + + *name = "HWCAP"; + *format = "b" + "fpu\0" "vme\0" "de\0" "pse\0" "tsc\0" "msr\0" "pae\0" "mce\0" + "cx8\0" "apic\0" "10\0" "sep\0" "mtrr\0" "pge\0" "mca\0" "cmov\0" + "pat\0" "pse36\0" "pn\0" "clflush\0" "20\0" "dts\0" "acpi\0" "mmx\0" + "fxsr\0" "sse\0" "sse2\0" "ss\0" "ht\0" "tm\0" "ia64\0" "pbe\0" "\0"; + return 1; +} + +__typeof (i386_auxv_info) x86_64_auxv_info + __attribute__ ((alias ("i386_auxv_info"))); diff --git a/backends/i386_corenote.c b/backends/i386_corenote.c index c9d3e5fb..cc72a45f 100644 --- a/backends/i386_corenote.c +++ b/backends/i386_corenote.c @@ -1,7 +1,6 @@ /* i386 specific core note handling. - Copyright (C) 2002, 2005 Red Hat, Inc. + Copyright (C) 2007 Red Hat, Inc. This file is part of Red Hat elfutils. - Written by Ulrich Drepper <[email protected]>, 2002. 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 @@ -38,138 +37,68 @@ #include "libebl_CPU.h" -/* We cannot include <sys/procfs.h> since the definition would be for - the host platform and not always x86 as required here. */ -struct elf_prstatus +static const Ebl_Register_Location prstatus_regs[] = { - struct - { - int32_t si_signo; /* Signal number. */ - int32_t si_code; /* Extra code. */ - int32_t si_errno; /* Errno. */ - } pr_info; /* Info associated with signal. */ - int16_t pr_cursig; /* Current signal. */ - uint32_t pr_sigpend; /* Set of pending signals. */ - uint32_t pr_sighold; /* Set of held signals. */ - int32_t pr_pid; - int32_t pr_ppid; - int32_t pr_pgrp; - int32_t pr_sid; - struct i386_timeval - { - int32_t tv_sec; - int32_t tv_usec; - } pr_utime; /* User time. */ - struct i386_timeval pr_stime; /* System time. */ - struct i386_timeval pr_cutime; /* Cumulative user time. */ - struct i386_timeval pr_cstime; /* Cumulative system time. */ - uint32_t pr_reg[17]; /* GP registers. */ - int32_t pr_fpvalid; /* True if math copro being used. */ +#define GR(at, n, dwreg) \ + { .offset = at * 4, .regno = dwreg, .count = n, .bits = 32 } +#define SR(at, n, dwreg) \ + { .offset = at * 4, .regno = dwreg, .count = n, .bits = 16, .pad = 2 } + + GR (0, 1, 3), /* %ebx */ + GR (1, 2, 1), /* %ecx-%edx */ + GR (3, 2, 6), /* %esi-%edi */ + GR (5, 1, 5), /* %ebp */ + GR (6, 1, 0), /* %eax */ + SR (7, 1, 43), /* %ds */ + SR (8, 1, 40), /* %es */ + SR (9, 1, 44), /* %fs */ + SR (10, 1, 45), /* %gs */ + /* 11, 1, orig_eax */ + GR (12, 1, 8), /* %eip */ + SR (13, 1, 41), /* %cs */ + GR (14, 1, 9), /* eflags */ + GR (15, 1, 4), /* %esp */ + SR (16, 1, 42), /* %ss */ + +#undef GR +#undef SR }; - - -struct elf_prpsinfo +#define PRSTATUS_REGS_SIZE (17 * 4) + +#define ULONG uint32_t +#define PID_T int32_t +#define UID_T uint16_t +#define GID_T uint16_t +#define ALIGN_ULONG 4 +#define ALIGN_PID_T 4 +#define ALIGN_UID_T 2 +#define ALIGN_GID_T 2 +#define TYPE_ULONG ELF_T_WORD +#define TYPE_PID_T ELF_T_SWORD +#define TYPE_UID_T ELF_T_HALF +#define TYPE_GID_T ELF_T_HALF + +#define PRSTATUS_REGSET_ITEMS \ + { \ + .name = "orig_eax", .type = ELF_T_SWORD, .format = 'd', \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 11), \ + .group = "register" \ + } + +static const Ebl_Register_Location fpregset_regs[] = { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - uint32_t pr_flag; /* Flags. */ - uint16_t pr_uid; - uint16_t pr_gid; - int32_t pr_pid; - int32_t pr_ppid; - int32_t pr_pgrp; - int32_t pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[80]; /* Initial part of arg list. */ + { .offset = 0, .regno = 37, .count = 2, .bits = 32 }, /* fctrl-fstat */ + { .offset = 7 * 4, .regno = 11, .count = 8, .bits = 80 }, /* stN */ }; +#define FPREGSET_SIZE 108 +static const Ebl_Register_Location prxfpreg_regs[] = + { + { .offset = 0, .regno = 37, .count = 2, .bits = 16 }, /* fctrl-fstat */ + { .offset = 24, .regno = 39, .count = 1, .bits = 32 }, /* mxcsr */ + { .offset = 32, .regno = 11, .count = 8, .bits = 80, .pad = 6 }, /* stN */ + { .offset = 32 + 128, .regno = 21, .count = 8, .bits = 128 }, /* xmm */ + }; +#define PRXFPREG_SIZE 512 -bool -i386_core_note (name, type, descsz, desc) - const char *name __attribute__ ((unused)); - uint32_t type; - uint32_t descsz; - const char *desc; -{ - bool result = false; - - switch (type) - { - case NT_PRSTATUS: - if (descsz < sizeof (struct elf_prstatus)) - /* Not enough data. */ - break; - - struct elf_prstatus *stat = (struct elf_prstatus *) desc; - - printf (" SIGINFO: signo: %" PRId32 ", code = %" PRId32 - ", errno = %" PRId32 "\n" - " signal: %" PRId16 ", pending: %08" PRIx32 - ", holding: %8" PRIx32 "\n" - " pid: %" PRId32 ", ppid = %" PRId32 ", pgrp = %" PRId32 - ", sid = %" PRId32 "\n" - " utime: %6" PRId32 ".%06" PRId32 - "s, stime: %6" PRId32 ".%06" PRId32 "s\n" - " cutime: %6" PRId32 ".%06" PRId32 - "s, cstime: %6" PRId32 ".%06" PRId32 "s\n" - " eax: %08" PRIx32 " ebx: %08" PRIx32 " ecx: %08" PRIx32 - " edx: %08" PRIx32 "\n" - " esi: %08" PRIx32 " edi: %08" PRIx32 " ebp: %08" PRIx32 - " esp: %08" PRIx32 "\n" - " eip: %08" PRIx32 " eflags: %08" PRIx32 - " original eax: %08" PRIx32 "\n" - " cs: %04" PRIx32 " ds: %04" PRIx32 " es: %04" PRIx32 - " fs: %04" PRIx32 " gs: %04" PRIx32 " ss: %04" PRIx32 "\n\n", - stat->pr_info.si_signo, - stat->pr_info.si_code, - stat->pr_info.si_errno, - stat->pr_cursig, - stat->pr_sigpend, stat->pr_sighold, - stat->pr_pid, stat->pr_ppid, stat->pr_pgrp, stat->pr_sid, - stat->pr_utime.tv_sec, stat->pr_utime.tv_usec, - stat->pr_stime.tv_sec, stat->pr_stime.tv_usec, - stat->pr_cutime.tv_sec, stat->pr_cutime.tv_usec, - stat->pr_cstime.tv_sec, stat->pr_cstime.tv_usec, - stat->pr_reg[6], stat->pr_reg[0], stat->pr_reg[1], - stat->pr_reg[2], stat->pr_reg[3], stat->pr_reg[4], - stat->pr_reg[5], stat->pr_reg[15], stat->pr_reg[12], - stat->pr_reg[14], stat->pr_reg[11], stat->pr_reg[13] & 0xffff, - stat->pr_reg[7] & 0xffff, stat->pr_reg[8] & 0xffff, - stat->pr_reg[9] & 0xffff, stat->pr_reg[10] & 0xffff, - stat->pr_reg[16]); - - /* We handled this entry. */ - result = true; - break; - - case NT_PRPSINFO: - if (descsz < sizeof (struct elf_prpsinfo)) - /* Not enough data. */ - break; - - struct elf_prpsinfo *info = (struct elf_prpsinfo *) desc; - - printf (" state: %c (%hhd), zombie: %hhd, nice: %hhd\n" - " flags: %08" PRIx32 ", uid: %" PRId16 ", gid: %" PRId16"\n" - " pid: %" PRId32 ", ppid: %" PRId32 ", pgrp: %" PRId32 - ", sid: %" PRId32 "\n" - " fname: %.16s\n" - " args: %.80s\n\n", - info->pr_sname, info->pr_state, info->pr_zomb, info->pr_nice, - info->pr_flag, info->pr_uid, info->pr_gid, - info->pr_pid, info->pr_ppid, info->pr_pgrp, info->pr_sid, - info->pr_fname, info->pr_psargs); - - /* We handled this entry. */ - result = true; - break; - - default: - break; - } - - return result; -} +#include "linux-core-note.c" diff --git a/backends/i386_init.c b/backends/i386_init.c index 9f240075..f25e1eb9 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 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 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, auxv_info); return MODVERSION; } diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c new file mode 100644 index 00000000..0913cc97 --- /dev/null +++ b/backends/linux-core-note.c @@ -0,0 +1,218 @@ +/* Common core note type descriptions for Linux. + Copyright (C) 2007 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>. */ + +/* The including CPU_corenote.c file provides prstatus_regs and + defines macros ULONG, [PUG]ID_T, and ALIGN_*, TYPE_*. + + Here we describe the common layout used in <linux/elfcore.h>. */ + +#define CHAR int8_t +#define ALIGN_CHAR 1 +#define TYPE_CHAR ELF_T_BYTE +#define SHORT uint16_t +#define ALIGN_SHORT 2 +#define TYPE_SHORT ELF_T_HALF +#define INT int32_t +#define ALIGN_INT 4 +#define TYPE_INT ELF_T_SWORD + +#define FIELD(type, name) type name __attribute__ ((aligned (ALIGN_##type))) + +struct EBLHOOK(siginfo) +{ + FIELD (INT, si_signo); + FIELD (INT, si_code); + FIELD (INT, si_errno); +}; + +struct EBLHOOK(timeval) +{ + FIELD (ULONG, tv_sec); + FIELD (ULONG, tv_usec); +}; + +struct EBLHOOK(prstatus) +{ + struct EBLHOOK(siginfo) pr_info; + FIELD (SHORT, pr_cursig); + FIELD (ULONG, pr_sigpend); + FIELD (ULONG, pr_sighold); + FIELD (PID_T, pr_pid); + FIELD (PID_T, pr_ppid); + FIELD (PID_T, pr_pgrp); + FIELD (PID_T, pr_sid); + struct EBLHOOK(timeval) pr_utime; + struct EBLHOOK(timeval) pr_stime; + struct EBLHOOK(timeval) pr_cutime; + struct EBLHOOK(timeval) pr_cstime; + FIELD (ULONG, pr_reg[PRSTATUS_REGS_SIZE / sizeof (ULONG)]); + FIELD (INT, pr_fpvalid); +}; + +#define FNAMESZ 16 +#define PRARGSZ 80 + +struct EBLHOOK(prpsinfo) +{ + FIELD (CHAR, pr_state); + FIELD (CHAR, pr_sname); + FIELD (CHAR, pr_zomb); + FIELD (CHAR, pr_nice); + FIELD (ULONG, pr_flag); + FIELD (UID_T, pr_uid); + FIELD (GID_T, pr_gid); + FIELD (PID_T, pr_pid); + FIELD (PID_T, pr_ppid); + FIELD (PID_T, pr_pgrp); + FIELD (PID_T, pr_sid); + FIELD (CHAR, pr_fname[FNAMESZ]); + FIELD (CHAR, pr_psargs[PRARGSZ]); +}; + +#undef FIELD + +#define FIELD(igroup, itype, item, fmt, ...) \ + { \ + .name = #item, \ + .group = #igroup, \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_##item), \ + .type = TYPE_##itype, \ + .format = fmt, \ + __VA_ARGS__ \ + } + +static const Ebl_Core_Item prstatus_items[] = + { + FIELD (signal, INT, info.si_signo, 'd'), + 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 (identity, PID_T, pid, 'd', .thread_identifier = true), + FIELD (identity, PID_T, ppid, 'd'), + FIELD (identity, PID_T, pgrp, 'd'), + FIELD (identity, PID_T, sid, 'd'), + FIELD (time, ULONG, utime, 'T', .count = 2), + FIELD (time, ULONG, stime, 'T', .count = 2), + FIELD (time, ULONG, cutime, 'T', .count = 2), + FIELD (time, ULONG, cstime, 'T', .count = 2), +#ifdef PRSTATUS_REGSET_ITEMS + PRSTATUS_REGSET_ITEMS, +#endif + FIELD (register, INT, fpvalid, 'd'), + }; + +#undef FIELD + +#define FIELD(igroup, itype, item, fmt, ...) \ + { \ + .name = #item, \ + .group = #igroup, \ + .offset = offsetof (struct EBLHOOK(prpsinfo), pr_##item), \ + .type = TYPE_##itype, \ + .format = fmt, \ + __VA_ARGS__ \ + } + +static const Ebl_Core_Item prpsinfo_items[] = + { + FIELD (state, CHAR, state, 'd'), + FIELD (state, CHAR, sname, 'c'), + FIELD (state, CHAR, zomb, 'd'), + FIELD (state, CHAR, nice, 'd'), + FIELD (state, ULONG, flag, 'x'), + FIELD (identity, UID_T, uid, 'd'), + FIELD (identity, GID_T, gid, 'd'), + FIELD (identity, PID_T, pid, 'd'), + FIELD (identity, PID_T, ppid, 'd'), + FIELD (identity, PID_T, pgrp, 'd'), + FIELD (identity, PID_T, sid, 'd'), + FIELD (command, CHAR, fname, 's', .count = FNAMESZ), + FIELD (command, CHAR, psargs, 's', .count = PRARGSZ), + }; + +#undef FIELD + +int +EBLHOOK(core_note) (n_type, descsz, + regs_offset, nregloc, reglocs, nitems, items) + GElf_Word n_type; + GElf_Word descsz; + GElf_Word *regs_offset; + size_t *nregloc; + const Ebl_Register_Location **reglocs; + size_t *nitems; + const Ebl_Core_Item **items; +{ + switch (n_type) + { + case NT_PRSTATUS: + if (descsz != sizeof (struct EBLHOOK(prstatus))) + return 0; + *regs_offset = offsetof (struct EBLHOOK(prstatus), pr_reg); + *nregloc = sizeof prstatus_regs / sizeof prstatus_regs[0]; + *reglocs = prstatus_regs; + *nitems = sizeof prstatus_items / sizeof prstatus_items[0]; + *items = prstatus_items; + return 1; + + case NT_PRPSINFO: + if (descsz != sizeof (struct EBLHOOK(prpsinfo))) + return 0; + *regs_offset = 0; + *nregloc = 0; + *reglocs = NULL; + *nitems = sizeof prpsinfo_items / sizeof prpsinfo_items[0]; + *items = prpsinfo_items; + return 1; + +#ifdef FPREGSET_SIZE + case NT_FPREGSET: + if (descsz != FPREGSET_SIZE) + return 0; + *regs_offset = 0; + *nregloc = sizeof fpregset_regs / sizeof fpregset_regs[0]; + *reglocs = fpregset_regs; + *nitems = 0; + *items = NULL; + return 1; +#endif + +#ifdef PRXFPREG_SIZE + case NT_PRXFPREG: + if (descsz != PRXFPREG_SIZE) + return 0; + *regs_offset = 0; + *nregloc = sizeof prxfpreg_regs / sizeof prxfpreg_regs[0]; + *reglocs = prxfpreg_regs; + *nitems = 0; + *items = NULL; + return 1; +#endif + } + + return 0; +} diff --git a/backends/ppc64_corenote.c b/backends/ppc64_corenote.c new file mode 100644 index 00000000..9d6a6a44 --- /dev/null +++ b/backends/ppc64_corenote.c @@ -0,0 +1,2 @@ +#define BITS 64 +#include "ppc_corenote.c" diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c index 8cd75357..02a592fd 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 Red Hat, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2004. @@ -58,6 +58,8 @@ ppc64_init (elf, machine, eh, ehlen) HOOK (eh, bss_plt_p); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, core_note); + HOOK (eh, auxv_info); return MODVERSION; } diff --git a/backends/ppc_auxv.c b/backends/ppc_auxv.c new file mode 100644 index 00000000..1c0a5cfc --- /dev/null +++ b/backends/ppc_auxv.c @@ -0,0 +1,52 @@ +/* i386 specific auxv handling. + Copyright (C) 2007 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 +EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format) +{ + if (a_type != AT_HWCAP) + return 0; + + *name = "HWCAP"; + *format = "b" + "ppcle\0" "truele\0" "3\0" "4\0" "5\0" "6\0" "7\0" "8\0" "9\0" + "power6x\0" "dfp\0" "pa6t\0" "arch_2_05\0" + "ic_snoop\0" "smt\0" "booke\0" "cellbe\0" + "power5+\0" "power5\0" "power4\0" "notb\0" + "efpdouble\0" "efpsingle\0" "spe\0" "ucache\0" + "4xxmac\0" "mmu\0" "fpu\0" "altivec\0" + "ppc601\0" "ppc64\0" "ppc32\0" "\0"; + return 1; +} + +__typeof (ppc_auxv_info) ppc64_auxv_info + __attribute__ ((alias ("ppc_auxv_info"))); diff --git a/backends/ppc_corenote.c b/backends/ppc_corenote.c new file mode 100644 index 00000000..e9ff124c --- /dev/null +++ b/backends/ppc_corenote.c @@ -0,0 +1,102 @@ +/* PowerPC specific core note handling. + Copyright (C) 2007 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 + +#include <elf.h> +#include <inttypes.h> +#include <stddef.h> +#include <stdio.h> +#include <sys/time.h> + +#ifndef BITS +# define BITS 32 +# define BACKEND ppc_ +#else +# define BITS 64 +# define BACKEND ppc64_ +#endif +#include "libebl_CPU.h" + +static const Ebl_Register_Location prstatus_regs[] = + { +#define GR(at, n, dwreg) \ + { .offset = at * BITS/8, .regno = dwreg, .count = n, .bits = BITS } + + GR (0, 32, 0), /* r0-r31 */ + /* 32, 1, nip */ + GR (33, 1, 66), /* msr */ + /* 34, 1, orig_gpr3 */ + GR (35, 1, 109), /* ctr */ + GR (36, 1, 108), /* lr */ + GR (37, 1, 101), /* xer */ + GR (38, 1, 64), /* cr */ + GR (39, 1, 100), /* mq */ + /* 40, 1, trap */ + GR (41, 1, 119), /* dar */ + GR (42, 1, 118), /* dsisr */ + +#undef GR + }; +#define PRSTATUS_REGS_SIZE (BITS / 8 * 48) + +static const Ebl_Register_Location fpregset_regs[] = + { + { .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f31 */ + { .offset = 32 * 8 + 4, .regno = 65, .count = 1, .bits = 32 } /* fpscr */ + }; +#define FPREGSET_SIZE (33 * 8) + +#if BITS == 32 +# define ULONG uint32_t +# define ALIGN_ULONG 4 +# define TYPE_ULONG ELF_T_WORD +# define TYPE_LONG ELF_T_SWORD +#else +# define ULONG uint64_t +# define ALIGN_ULONG 8 +# define TYPE_ULONG ELF_T_XWORD +# define TYPE_LONG ELF_T_SXWORD +#endif +#define PID_T int32_t +#define UID_T uint32_t +#define GID_T uint32_t +#define ALIGN_PID_T 4 +#define ALIGN_UID_T 4 +#define ALIGN_GID_T 4 +#define TYPE_PID_T ELF_T_SWORD +#define TYPE_UID_T ELF_T_WORD +#define TYPE_GID_T ELF_T_WORD + +#define PRSTATUS_REGSET_ITEMS \ + { \ + .name = "orig_gpr3", .type = TYPE_LONG, .format = 'd', \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 34), \ + .group = "register" \ + } + +#include "linux-core-note.c" diff --git a/backends/ppc_init.c b/backends/ppc_init.c index 1dfd5ec9..7edc8fad 100644 --- a/backends/ppc_init.c +++ b/backends/ppc_init.c @@ -1,5 +1,5 @@ /* Initialization of PPC specific backend library. - Copyright (C) 2004, 2005, 2006 Red Hat, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2004. @@ -57,6 +57,8 @@ ppc_init (elf, machine, eh, ehlen) HOOK (eh, bss_plt_p); HOOK (eh, return_value_location); HOOK (eh, register_info); + HOOK (eh, core_note); + HOOK (eh, auxv_info); return MODVERSION; } diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c index 8a1950c0..9540a3e9 100644 --- a/backends/ppc_symbol.c +++ b/backends/ppc_symbol.c @@ -1,5 +1,5 @@ /* PPC specific symbolic name handling. - Copyright (C) 2004, 2005 Red Hat, Inc. + Copyright (C) 2004, 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2004. @@ -122,10 +122,13 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, if (strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) { + /* In -msecure-plt mode, DT_PPC_GOT is present and must match. */ GElf_Addr gotaddr; if (find_dyn_got (elf, ehdr, &gotaddr)) return sym->st_value == gotaddr; - return sym->st_value == destshdr->sh_addr + 4; + + /* In -mbss-plt mode, any place in the section is valid. */ + return true; } const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name); diff --git a/backends/x86_64_corenote.c b/backends/x86_64_corenote.c index 1a37c07b..c2bc72e9 100644 --- a/backends/x86_64_corenote.c +++ b/backends/x86_64_corenote.c @@ -1,7 +1,6 @@ /* x86-64 specific core note handling. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. - Written by Ulrich Drepper <[email protected]>, 2005. 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 @@ -38,147 +37,70 @@ #include "libebl_CPU.h" -/* We cannot include <sys/procfs.h> since the definition would be for - the host platform and not always x86-64 as required here. */ -struct elf_prstatus +static const Ebl_Register_Location prstatus_regs[] = { - struct - { - int32_t si_signo; /* Signal number. */ - int32_t si_code; /* Extra code. */ - int32_t si_errno; /* Errno. */ - } pr_info; /* Info associated with signal. */ - int16_t pr_cursig; /* Current signal. */ - uint64_t pr_sigpend; /* Set of pending signals. */ - uint64_t pr_sighold; /* Set of held signals. */ - int32_t pr_pid; - int32_t pr_ppid; - int32_t pr_pgrp; - int32_t pr_sid; - struct x86_64_timeval - { - int64_t tv_sec; - int32_t tv_usec; - } pr_utime; /* User time. */ - struct x86_64_timeval pr_stime; /* System time. */ - struct x86_64_timeval pr_cutime; /* Cumulative user time. */ - struct x86_64_timeval pr_cstime; /* Cumulative system time. */ - uint64_t pr_reg[27]; /* GP registers. */ - int32_t pr_fpvalid; /* True if math copro being used. */ +#define GR(at, n, dwreg) \ + { .offset = at * 8, .regno = dwreg, .count = n, .bits = 64 } +#define SR(at, n, dwreg) \ + { .offset = at * 8, .regno = dwreg, .count = n, .bits = 16, .pad = 6 } + + GR (0, 1, 15), /* %r15 */ + GR (1, 1, 14), /* %r14 */ + GR (2, 1, 13), /* %r13 */ + GR (3, 1, 12), /* %r12 */ + GR (4, 1, 6), /* %rbp */ + GR (5, 1, 3), /* %rbx */ + GR (6, 1, 11), /* %r11 */ + GR (7, 1, 10), /* %r10 */ + GR (8, 1, 9), /* %r9 */ + GR (9, 1, 8), /* %r8 */ + GR (10,1, 0), /* %rax */ + GR (11,1, 2), /* %rcx */ + GR (12,1, 1), /* %rdx */ + GR (13,2, 4), /* %rsi-%rdi */ + /* 15,1, orig_rax */ + GR (16,1, 16), /* %rip */ + SR (17,1, 51), /* %cs */ + GR (18,1, 49), /* %rFLAGS */ + GR (19,1, 7), /* %rsp */ + SR (20,1, 52), /* %ss */ + GR (21,2, 58), /* %fs.base-%gs.base */ + SR (23,1, 53), /* %ds */ + SR (24,1, 50), /* %es */ + SR (25,2, 54), /* %fs-%gs */ + +#undef GR +#undef SR }; - - -struct elf_prpsinfo +#define PRSTATUS_REGS_SIZE (27 * 8) + +#define ULONG uint64_t +#define PID_T int32_t +#define UID_T uint32_t +#define GID_T uint32_t +#define ALIGN_ULONG 8 +#define ALIGN_PID_T 4 +#define ALIGN_UID_T 4 +#define ALIGN_GID_T 4 +#define TYPE_ULONG ELF_T_XWORD +#define TYPE_PID_T ELF_T_SWORD +#define TYPE_UID_T ELF_T_SWORD +#define TYPE_GID_T ELF_T_SWORD + +#define PRSTATUS_REGSET_ITEMS \ + { \ + .name = "orig_rax", .type = ELF_T_SXWORD, .format = 'd', \ + .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (8 * 15), \ + .group = "register" \ + } + +static const Ebl_Register_Location fpregset_regs[] = { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - uint64_t pr_flag; /* Flags. */ - uint32_t pr_uid; - uint32_t pr_gid; - int32_t pr_pid; - int32_t pr_ppid; - int32_t pr_pgrp; - int32_t pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[80]; /* Initial part of arg list. */ + { .offset = 0, .regno = 65, .count = 2, .bits = 16 }, /* fcw-fsw */ + { .offset = 24, .regno = 64, .count = 1, .bits = 32 }, /* mxcsr */ + { .offset = 32, .regno = 33, .count = 8, .bits = 80, .pad = 6 }, /* stN */ + { .offset = 32 + 128, .regno = 17, .count = 16, .bits = 128 }, /* xmm */ }; +#define FPREGSET_SIZE 512 - -bool -x86_64_core_note (name, type, descsz, desc) - const char *name __attribute__ ((unused)); - uint32_t type; - uint32_t descsz; - const char *desc; -{ - bool result = false; - - switch (type) - { - case NT_PRSTATUS: - if (descsz < sizeof (struct elf_prstatus)) - /* Not enough data. */ - break; - - struct elf_prstatus *stat = (struct elf_prstatus *) desc; - - printf (" SIGINFO: signo: %" PRId32 ", code = %" PRId32 - ", errno = %" PRId32 "\n" - " signal: %" PRId16 ", pending: %#08" PRIx64 ", holding: %#08" - PRIx64 "\n" - " pid: %" PRId32 ", ppid = %" PRId32 ", pgrp = %" PRId32 - ", sid = %" PRId32 "\n" - " utime: %6" PRId64 ".%06" PRId32 - "s, stime: %6" PRId64 ".%06" PRId32 "s\n" - " cutime: %6" PRId64 ".%06" PRId32 - "s, cstime: %6" PRId64 ".%06" PRId32 "s\n" - " rax: %016" PRIx64 " rbx: %016" PRIx64 "\n" - " rcx: %016" PRIx64 " rdx: %016" PRIx64 "\n" - " rsi: %016" PRIx64 " rdi: %016" PRIx64 "\n" - " rbp: %016" PRIx64 " rsp: %016" PRIx64 "\n" - " r8: %016" PRIx64 " r9: %016" PRIx64 "\n" - " r10: %016" PRIx64 " r11: %016" PRIx64 "\n" - " r12: %016" PRIx64 " r13: %016" PRIx64 "\n" - " r14: %016" PRIx64 " r15: %016" PRIx64 "\n" - " rip: %016" PRIx64 " eflags: %08" PRIx64 "\n" - " original rax: %016" PRIx64 "\n" - " cs: %04" PRIx64 " ds: %04" PRIx64 " es: %04" PRIx64 - " ss: %04" PRIx64 "\n" - " fs: %04" PRIx64 " fs_base: %016" PRIx64 - " gs: %04" PRIx64 " gs_base: %016" PRIx64 "\n\n", - stat->pr_info. si_signo, - stat->pr_info. si_code, - stat->pr_info. si_errno, - stat->pr_cursig, - stat->pr_sigpend, stat->pr_sighold, - stat->pr_pid, stat->pr_ppid, stat->pr_pgrp, stat->pr_sid, - stat->pr_utime.tv_sec, stat->pr_utime.tv_usec, - stat->pr_stime.tv_sec, stat->pr_stime.tv_usec, - stat->pr_cutime.tv_sec, stat->pr_cutime.tv_usec, - stat->pr_cstime.tv_sec, stat->pr_cstime.tv_usec, - stat->pr_reg[10], stat->pr_reg[5], stat->pr_reg[11], - stat->pr_reg[12], stat->pr_reg[13], stat->pr_reg[14], - stat->pr_reg[4], stat->pr_reg[10], stat->pr_reg[9], - stat->pr_reg[7], stat->pr_reg[6], stat->pr_reg[5], - stat->pr_reg[3], stat->pr_reg[2], stat->pr_reg[1], - stat->pr_reg[0], stat->pr_reg[16], stat->pr_reg[18], - stat->pr_reg[15], stat->pr_reg[17], stat->pr_reg[23], - stat->pr_reg[24], stat->pr_reg[20], - stat->pr_reg[25], stat->pr_reg[21], - stat->pr_reg[26], stat->pr_reg[22]); - - /* We handled this entry. */ - result = true; - break; - - case NT_PRPSINFO: - if (descsz < sizeof (struct elf_prpsinfo)) - /* Not enough data. */ - break; - - struct elf_prpsinfo *info = (struct elf_prpsinfo *) desc; - - printf (" state: %c (%hhd), zombie: %hhd, nice: %hhd\n" - " flags: %08" PRIx64 " uid: %" PRIu32 " gid: %" PRIu32 "\n" - " pid: %" PRId32 " ppid: %" PRId32 " pgrp: %" PRId32 - " sid: %" PRId32 "\n" - " fname: %.16s\n" - " args: %.80s\n\n", - info->pr_sname, info->pr_state, info->pr_zomb, info->pr_nice, - info->pr_flag, info->pr_uid, info->pr_gid, - info->pr_pid, info->pr_ppid, info->pr_pgrp, info->pr_sid, - info->pr_fname, info->pr_psargs); - - /* We handled this entry. */ - result = true; - break; - - default: - break; - } - - return result; -} +#include "linux-core-note.c" diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c index 476f4ed2..b1764832 100644 --- a/backends/x86_64_init.c +++ b/backends/x86_64_init.c @@ -1,5 +1,5 @@ /* Initialization of x86-64 specific backend library. - Copyright (C) 2002, 2005, 2006 Red Hat, Inc. + Copyright (C) 2002, 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2002. @@ -35,8 +35,6 @@ /* This defines the common reloc hooks based on x86_64_reloc.def. */ #include "common-reloc.c" - - const char * x86_64_init (elf, machine, eh, ehlen) Elf *elf __attribute__ ((unused)); @@ -55,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, auxv_info); return MODVERSION; } diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c index cfa40508..8eb0d33f 100644 --- a/backends/x86_64_regs.c +++ b/backends/x86_64_regs.c @@ -156,6 +156,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)), return stpcpy (&name[1], "s.base") + 1 - name; case 49: + *setname = "integer"; return stpcpy (name, "rflags") + 1 - name; case 62: return stpcpy (name, "tr") + 1 - name; |
