GNU Binutils with patches for OS216
Revisión | 3a36c1c7b4395f9489a3d6ad27ab5ac873d1e62c (tree) |
---|---|
Tiempo | 2016-01-22 09:36:13 |
Autor | Alan Modra <amodra@gmai...> |
Commiter | Alan Modra |
Remove elf_backend_write_core_note
This function was added in 2007 to support powerpc gdb "gcore" writing
32-bit powerpc linux core files on a 64-bit powerpc host, when
PowerPC64 glibc lacked (and still lacks) 32-bit versions of prstatus_t
and prpsinfo_t. Now that gdb has elfcore_write_linux_prstatus32/64
and elfcore_write_linux_prpsinfo32/64, this linux specific backend
function should disappear.
* elf-bfd.h (struct elf_backend_data): Remove
elf_backend_write_core_note.
* elf.c (elfcore_write_prpsinfo, elfcore_write_prstatus): Don't call
elf_backend_write_core_note.
* elf32-arm.c (elf32_arm_nabi_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf32-ppc.c (ppc_elf_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf64-ppc.c (ppc64_elf_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf64-x86-64.c (elf_x86_64_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
(CORE_HEADER): Don't include.
* elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Delete function.
* elfxx-aarch64.h (_bfd_aarch64_elf_write_core_note): Delete prototype.
(elf_backend_write_core_note): Don't define.
* elfxx-target.h (elf_backend_write_core_note): Don't define.
(elfNN_bed): Adjust.
* hosts/x86-64linux.h: Delete file.
* configure.ac (CORE_HEADER): Delete.
* configure: Regenerate.
* config.in: Regenerate.
@@ -7,9 +7,6 @@ | ||
7 | 7 | #endif |
8 | 8 | #define __CONFIG_H__ 1 |
9 | 9 | |
10 | -/* Name of host specific core header file to include in elf.c. */ | |
11 | -#undef CORE_HEADER | |
12 | - | |
13 | 10 | /* Define to 1 if translation of program messages to the user's native |
14 | 11 | language is requested. */ |
15 | 12 | #undef ENABLE_NLS |
@@ -14644,7 +14644,6 @@ test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selar | ||
14644 | 14644 | # If we are configured native, pick a core file support file. |
14645 | 14645 | COREFILE= |
14646 | 14646 | COREFLAG= |
14647 | -CORE_HEADER= | |
14648 | 14647 | TRAD_HEADER= |
14649 | 14648 | if test "${target}" = "${host}"; then |
14650 | 14649 | case "${host}" in |
@@ -14722,10 +14721,6 @@ if test "${target}" = "${host}"; then | ||
14722 | 14721 | i[3-7]86-*-linux-*) |
14723 | 14722 | COREFILE=trad-core.lo |
14724 | 14723 | TRAD_HEADER='"hosts/i386linux.h"' |
14725 | - case "$enable_targets"-"$want64" in | |
14726 | - *x86_64-*linux*|*-true) | |
14727 | - CORE_HEADER='"hosts/x86-64linux.h"' | |
14728 | - esac | |
14729 | 14724 | ;; |
14730 | 14725 | i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; |
14731 | 14726 | i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; |
@@ -14876,9 +14871,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||
14876 | 14871 | COREFILE=trad-core.lo |
14877 | 14872 | TRAD_HEADER='"hosts/vaxbsd.h"' |
14878 | 14873 | ;; |
14879 | - x86_64-*-linux*) | |
14880 | - CORE_HEADER='"hosts/x86-64linux.h"' | |
14881 | - ;; | |
14882 | 14874 | x86_64-*-netbsd* | x86_64-*-openbsd*) |
14883 | 14875 | COREFILE=netbsd-core.lo |
14884 | 14876 | ;; |
@@ -15694,13 +15686,6 @@ $as_echo "$bfd_cv_have_sys_procfs_type_win32_pstatus_t" >&6; } | ||
15694 | 15686 | fi |
15695 | 15687 | |
15696 | 15688 | |
15697 | -if test -n "$CORE_HEADER"; then | |
15698 | - | |
15699 | -cat >>confdefs.h <<_ACEOF | |
15700 | -#define CORE_HEADER $CORE_HEADER | |
15701 | -_ACEOF | |
15702 | - | |
15703 | -fi | |
15704 | 15689 | if test -n "$TRAD_HEADER"; then |
15705 | 15690 | |
15706 | 15691 | cat >>confdefs.h <<_ACEOF |
@@ -841,7 +841,6 @@ AC_SUBST(havevecs) | ||
841 | 841 | # If we are configured native, pick a core file support file. |
842 | 842 | COREFILE= |
843 | 843 | COREFLAG= |
844 | -CORE_HEADER= | |
845 | 844 | TRAD_HEADER= |
846 | 845 | if test "${target}" = "${host}"; then |
847 | 846 | case "${host}" in |
@@ -941,10 +940,6 @@ changequote(,)dnl | ||
941 | 940 | changequote([,])dnl |
942 | 941 | COREFILE=trad-core.lo |
943 | 942 | TRAD_HEADER='"hosts/i386linux.h"' |
944 | - case "$enable_targets"-"$want64" in | |
945 | - *x86_64-*linux*|*-true) | |
946 | - CORE_HEADER='"hosts/x86-64linux.h"' | |
947 | - esac | |
948 | 943 | ;; |
949 | 944 | changequote(,)dnl |
950 | 945 | i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; |
@@ -1081,9 +1076,6 @@ changequote([,])dnl | ||
1081 | 1076 | COREFILE=trad-core.lo |
1082 | 1077 | TRAD_HEADER='"hosts/vaxbsd.h"' |
1083 | 1078 | ;; |
1084 | - x86_64-*-linux*) | |
1085 | - CORE_HEADER='"hosts/x86-64linux.h"' | |
1086 | - ;; | |
1087 | 1079 | x86_64-*-netbsd* | x86_64-*-openbsd*) |
1088 | 1080 | COREFILE=netbsd-core.lo |
1089 | 1081 | ;; |
@@ -1132,10 +1124,6 @@ changequote([,])dnl | ||
1132 | 1124 | fi |
1133 | 1125 | AC_SUBST(COREFILE) |
1134 | 1126 | AC_SUBST(COREFLAG) |
1135 | -if test -n "$CORE_HEADER"; then | |
1136 | - AC_DEFINE_UNQUOTED(CORE_HEADER, $CORE_HEADER, | |
1137 | - [Name of host specific core header file to include in elf.c.]) | |
1138 | -fi | |
1139 | 1127 | if test -n "$TRAD_HEADER"; then |
1140 | 1128 | AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, |
1141 | 1129 | [Name of host specific header file to include in trad-core.c.]) |
@@ -1190,10 +1190,6 @@ struct elf_backend_data | ||
1190 | 1190 | bfd_boolean (*elf_backend_grok_psinfo) |
1191 | 1191 | (bfd *, Elf_Internal_Note *); |
1192 | 1192 | |
1193 | - /* This function, if defined, is called to write a note to a corefile. */ | |
1194 | - char *(*elf_backend_write_core_note) | |
1195 | - (bfd *abfd, char *buf, int *bufsiz, int note_type, ...); | |
1196 | - | |
1197 | 1193 | /* This function, if defined, is called to convert target-specific |
1198 | 1194 | section flag names into hex values. */ |
1199 | 1195 | flagword (*elf_backend_lookup_section_flags_hook) |
@@ -9726,25 +9726,16 @@ elfcore_write_note (bfd *abfd, | ||
9726 | 9726 | } |
9727 | 9727 | |
9728 | 9728 | char * |
9729 | -elfcore_write_prpsinfo (bfd *abfd, | |
9729 | +elfcore_write_prpsinfo (bfd *abfd ATTRIBUTE_UNUSED, | |
9730 | 9730 | char *buf, |
9731 | - int *bufsiz, | |
9732 | - const char *fname, | |
9733 | - const char *psargs) | |
9731 | + int *bufsiz ATTRIBUTE_UNUSED, | |
9732 | + const char *fname ATTRIBUTE_UNUSED, | |
9733 | + const char *psargs ATTRIBUTE_UNUSED) | |
9734 | 9734 | { |
9735 | - const struct elf_backend_data *bed = get_elf_backend_data (abfd); | |
9736 | - | |
9737 | - if (bed->elf_backend_write_core_note != NULL) | |
9738 | - { | |
9739 | - char *ret; | |
9740 | - ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, | |
9741 | - NT_PRPSINFO, fname, psargs); | |
9742 | - if (ret != NULL) | |
9743 | - return ret; | |
9744 | - } | |
9745 | - | |
9746 | 9735 | #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) |
9747 | 9736 | #if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) |
9737 | + const struct elf_backend_data *bed = get_elf_backend_data (abfd); | |
9738 | + | |
9748 | 9739 | if (bed->s->elfclass == ELFCLASS32) |
9749 | 9740 | { |
9750 | 9741 | #if defined (HAVE_PSINFO32_T) |
@@ -9843,27 +9834,17 @@ elfcore_write_linux_prstatus64 | ||
9843 | 9834 | } |
9844 | 9835 | |
9845 | 9836 | char * |
9846 | -elfcore_write_prstatus (bfd *abfd, | |
9837 | +elfcore_write_prstatus (bfd *abfd ATTRIBUTE_UNUSED, | |
9847 | 9838 | char *buf, |
9848 | - int *bufsiz, | |
9849 | - long pid, | |
9850 | - int cursig, | |
9851 | - const void *gregs) | |
9839 | + int *bufsiz ATTRIBUTE_UNUSED, | |
9840 | + long pid ATTRIBUTE_UNUSED, | |
9841 | + int cursig ATTRIBUTE_UNUSED, | |
9842 | + const void *gregs ATTRIBUTE_UNUSED) | |
9852 | 9843 | { |
9853 | - const struct elf_backend_data *bed = get_elf_backend_data (abfd); | |
9854 | - | |
9855 | - if (bed->elf_backend_write_core_note != NULL) | |
9856 | - { | |
9857 | - char *ret; | |
9858 | - ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, | |
9859 | - NT_PRSTATUS, | |
9860 | - pid, cursig, gregs); | |
9861 | - if (ret != NULL) | |
9862 | - return ret; | |
9863 | - } | |
9864 | - | |
9865 | 9844 | #if defined (HAVE_PRSTATUS_T) |
9866 | 9845 | #if defined (HAVE_PRSTATUS32_T) |
9846 | + const struct elf_backend_data *bed = get_elf_backend_data (abfd); | |
9847 | + | |
9867 | 9848 | if (bed->s->elfclass == ELFCLASS32) |
9868 | 9849 | { |
9869 | 9850 | prstatus32_t prstat; |
@@ -2050,54 +2050,6 @@ elf32_arm_nabi_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) | ||
2050 | 2050 | return TRUE; |
2051 | 2051 | } |
2052 | 2052 | |
2053 | -static char * | |
2054 | -elf32_arm_nabi_write_core_note (bfd *abfd, char *buf, int *bufsiz, | |
2055 | - int note_type, ...) | |
2056 | -{ | |
2057 | - switch (note_type) | |
2058 | - { | |
2059 | - default: | |
2060 | - return NULL; | |
2061 | - | |
2062 | - case NT_PRPSINFO: | |
2063 | - { | |
2064 | - char data[124]; | |
2065 | - va_list ap; | |
2066 | - | |
2067 | - va_start (ap, note_type); | |
2068 | - memset (data, 0, sizeof (data)); | |
2069 | - strncpy (data + 28, va_arg (ap, const char *), 16); | |
2070 | - strncpy (data + 44, va_arg (ap, const char *), 80); | |
2071 | - va_end (ap); | |
2072 | - | |
2073 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2074 | - "CORE", note_type, data, sizeof (data)); | |
2075 | - } | |
2076 | - | |
2077 | - case NT_PRSTATUS: | |
2078 | - { | |
2079 | - char data[148]; | |
2080 | - va_list ap; | |
2081 | - long pid; | |
2082 | - int cursig; | |
2083 | - const void *greg; | |
2084 | - | |
2085 | - va_start (ap, note_type); | |
2086 | - memset (data, 0, sizeof (data)); | |
2087 | - pid = va_arg (ap, long); | |
2088 | - bfd_put_32 (abfd, pid, data + 24); | |
2089 | - cursig = va_arg (ap, int); | |
2090 | - bfd_put_16 (abfd, cursig, data + 12); | |
2091 | - greg = va_arg (ap, const void *); | |
2092 | - memcpy (data + 72, greg, 72); | |
2093 | - va_end (ap); | |
2094 | - | |
2095 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2096 | - "CORE", note_type, data, sizeof (data)); | |
2097 | - } | |
2098 | - } | |
2099 | -} | |
2100 | - | |
2101 | 2053 | #define TARGET_LITTLE_SYM arm_elf32_le_vec |
2102 | 2054 | #define TARGET_LITTLE_NAME "elf32-littlearm" |
2103 | 2055 | #define TARGET_BIG_SYM arm_elf32_be_vec |
@@ -2105,7 +2057,6 @@ elf32_arm_nabi_write_core_note (bfd *abfd, char *buf, int *bufsiz, | ||
2105 | 2057 | |
2106 | 2058 | #define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus |
2107 | 2059 | #define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo |
2108 | -#define elf_backend_write_core_note elf32_arm_nabi_write_core_note | |
2109 | 2060 | |
2110 | 2061 | typedef unsigned long int insn32; |
2111 | 2062 | typedef unsigned short int insn16; |
@@ -2307,52 +2307,6 @@ elfcore_write_ppc_linux_prpsinfo32 | ||
2307 | 2307 | "CORE", NT_PRPSINFO, &data, sizeof (data)); |
2308 | 2308 | } |
2309 | 2309 | |
2310 | -static char * | |
2311 | -ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...) | |
2312 | -{ | |
2313 | - switch (note_type) | |
2314 | - { | |
2315 | - default: | |
2316 | - return NULL; | |
2317 | - | |
2318 | - case NT_PRPSINFO: | |
2319 | - { | |
2320 | - char data[128]; | |
2321 | - va_list ap; | |
2322 | - | |
2323 | - va_start (ap, note_type); | |
2324 | - memset (data, 0, sizeof (data)); | |
2325 | - strncpy (data + 32, va_arg (ap, const char *), 16); | |
2326 | - strncpy (data + 48, va_arg (ap, const char *), 80); | |
2327 | - va_end (ap); | |
2328 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2329 | - "CORE", note_type, data, sizeof (data)); | |
2330 | - } | |
2331 | - | |
2332 | - case NT_PRSTATUS: | |
2333 | - { | |
2334 | - char data[268]; | |
2335 | - va_list ap; | |
2336 | - long pid; | |
2337 | - int cursig; | |
2338 | - const void *greg; | |
2339 | - | |
2340 | - va_start (ap, note_type); | |
2341 | - memset (data, 0, 72); | |
2342 | - pid = va_arg (ap, long); | |
2343 | - bfd_put_32 (abfd, pid, data + 24); | |
2344 | - cursig = va_arg (ap, int); | |
2345 | - bfd_put_16 (abfd, cursig, data + 12); | |
2346 | - greg = va_arg (ap, const void *); | |
2347 | - memcpy (data + 72, greg, 192); | |
2348 | - memset (data + 264, 0, 4); | |
2349 | - va_end (ap); | |
2350 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2351 | - "CORE", note_type, data, sizeof (data)); | |
2352 | - } | |
2353 | - } | |
2354 | -} | |
2355 | - | |
2356 | 2310 | static flagword |
2357 | 2311 | ppc_elf_lookup_section_flags (char *flag_name) |
2358 | 2312 | { |
@@ -10746,7 +10700,6 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, | ||
10746 | 10700 | #define elf_backend_modify_segment_map ppc_elf_modify_segment_map |
10747 | 10701 | #define elf_backend_grok_prstatus ppc_elf_grok_prstatus |
10748 | 10702 | #define elf_backend_grok_psinfo ppc_elf_grok_psinfo |
10749 | -#define elf_backend_write_core_note ppc_elf_write_core_note | |
10750 | 10703 | #define elf_backend_reloc_type_class ppc_elf_reloc_type_class |
10751 | 10704 | #define elf_backend_begin_write_processing ppc_elf_begin_write_processing |
10752 | 10705 | #define elf_backend_final_write_processing ppc_elf_final_write_processing |
@@ -90,7 +90,6 @@ static bfd_vma opd_entry_value | ||
90 | 90 | #define elf_backend_object_p ppc64_elf_object_p |
91 | 91 | #define elf_backend_grok_prstatus ppc64_elf_grok_prstatus |
92 | 92 | #define elf_backend_grok_psinfo ppc64_elf_grok_psinfo |
93 | -#define elf_backend_write_core_note ppc64_elf_write_core_note | |
94 | 93 | #define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections |
95 | 94 | #define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol |
96 | 95 | #define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook |
@@ -2947,53 +2946,6 @@ ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) | ||
2947 | 2946 | return TRUE; |
2948 | 2947 | } |
2949 | 2948 | |
2950 | -static char * | |
2951 | -ppc64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, | |
2952 | - ...) | |
2953 | -{ | |
2954 | - switch (note_type) | |
2955 | - { | |
2956 | - default: | |
2957 | - return NULL; | |
2958 | - | |
2959 | - case NT_PRPSINFO: | |
2960 | - { | |
2961 | - char data[136]; | |
2962 | - va_list ap; | |
2963 | - | |
2964 | - va_start (ap, note_type); | |
2965 | - memset (data, 0, sizeof (data)); | |
2966 | - strncpy (data + 40, va_arg (ap, const char *), 16); | |
2967 | - strncpy (data + 56, va_arg (ap, const char *), 80); | |
2968 | - va_end (ap); | |
2969 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2970 | - "CORE", note_type, data, sizeof (data)); | |
2971 | - } | |
2972 | - | |
2973 | - case NT_PRSTATUS: | |
2974 | - { | |
2975 | - char data[504]; | |
2976 | - va_list ap; | |
2977 | - long pid; | |
2978 | - int cursig; | |
2979 | - const void *greg; | |
2980 | - | |
2981 | - va_start (ap, note_type); | |
2982 | - memset (data, 0, 112); | |
2983 | - pid = va_arg (ap, long); | |
2984 | - bfd_put_32 (abfd, pid, data + 32); | |
2985 | - cursig = va_arg (ap, int); | |
2986 | - bfd_put_16 (abfd, cursig, data + 12); | |
2987 | - greg = va_arg (ap, const void *); | |
2988 | - memcpy (data + 112, greg, 384); | |
2989 | - memset (data + 496, 0, 8); | |
2990 | - va_end (ap); | |
2991 | - return elfcore_write_note (abfd, buf, bufsiz, | |
2992 | - "CORE", note_type, data, sizeof (data)); | |
2993 | - } | |
2994 | - } | |
2995 | -} | |
2996 | - | |
2997 | 2949 | /* Add extra PPC sections. */ |
2998 | 2950 | |
2999 | 2951 | static const struct bfd_elf_special_section ppc64_elf_special_sections[]= |
@@ -34,11 +34,6 @@ | ||
34 | 34 | #include "opcode/i386.h" |
35 | 35 | #include "elf/x86-64.h" |
36 | 36 | |
37 | -#ifdef CORE_HEADER | |
38 | -#include <stdarg.h> | |
39 | -#include CORE_HEADER | |
40 | -#endif | |
41 | - | |
42 | 37 | /* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */ |
43 | 38 | #define MINUS_ONE (~ (bfd_vma) 0) |
44 | 39 |
@@ -436,94 +431,6 @@ elf_x86_64_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) | ||
436 | 431 | |
437 | 432 | return TRUE; |
438 | 433 | } |
439 | - | |
440 | -#ifdef CORE_HEADER | |
441 | -static char * | |
442 | -elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz, | |
443 | - int note_type, ...) | |
444 | -{ | |
445 | - const struct elf_backend_data *bed = get_elf_backend_data (abfd); | |
446 | - va_list ap; | |
447 | - const char *fname, *psargs; | |
448 | - long pid; | |
449 | - int cursig; | |
450 | - const void *gregs; | |
451 | - | |
452 | - switch (note_type) | |
453 | - { | |
454 | - default: | |
455 | - return NULL; | |
456 | - | |
457 | - case NT_PRPSINFO: | |
458 | - va_start (ap, note_type); | |
459 | - fname = va_arg (ap, const char *); | |
460 | - psargs = va_arg (ap, const char *); | |
461 | - va_end (ap); | |
462 | - | |
463 | - if (bed->s->elfclass == ELFCLASS32) | |
464 | - { | |
465 | - prpsinfo32_t data; | |
466 | - memset (&data, 0, sizeof (data)); | |
467 | - strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); | |
468 | - strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); | |
469 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, | |
470 | - &data, sizeof (data)); | |
471 | - } | |
472 | - else | |
473 | - { | |
474 | - prpsinfo64_t data; | |
475 | - memset (&data, 0, sizeof (data)); | |
476 | - strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); | |
477 | - strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); | |
478 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, | |
479 | - &data, sizeof (data)); | |
480 | - } | |
481 | - /* NOTREACHED */ | |
482 | - | |
483 | - case NT_PRSTATUS: | |
484 | - va_start (ap, note_type); | |
485 | - pid = va_arg (ap, long); | |
486 | - cursig = va_arg (ap, int); | |
487 | - gregs = va_arg (ap, const void *); | |
488 | - va_end (ap); | |
489 | - | |
490 | - if (bed->s->elfclass == ELFCLASS32) | |
491 | - { | |
492 | - if (bed->elf_machine_code == EM_X86_64) | |
493 | - { | |
494 | - prstatusx32_t prstat; | |
495 | - memset (&prstat, 0, sizeof (prstat)); | |
496 | - prstat.pr_pid = pid; | |
497 | - prstat.pr_cursig = cursig; | |
498 | - memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); | |
499 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, | |
500 | - &prstat, sizeof (prstat)); | |
501 | - } | |
502 | - else | |
503 | - { | |
504 | - prstatus32_t prstat; | |
505 | - memset (&prstat, 0, sizeof (prstat)); | |
506 | - prstat.pr_pid = pid; | |
507 | - prstat.pr_cursig = cursig; | |
508 | - memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); | |
509 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, | |
510 | - &prstat, sizeof (prstat)); | |
511 | - } | |
512 | - } | |
513 | - else | |
514 | - { | |
515 | - prstatus64_t prstat; | |
516 | - memset (&prstat, 0, sizeof (prstat)); | |
517 | - prstat.pr_pid = pid; | |
518 | - prstat.pr_cursig = cursig; | |
519 | - memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); | |
520 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, | |
521 | - &prstat, sizeof (prstat)); | |
522 | - } | |
523 | - } | |
524 | - /* NOTREACHED */ | |
525 | -} | |
526 | -#endif | |
527 | 434 | |
528 | 435 | /* Functions for the x86-64 ELF linker. */ |
529 | 436 |
@@ -6359,9 +6266,6 @@ static const struct bfd_elf_special_section | ||
6359 | 6266 | #define elf_backend_gc_sweep_hook elf_x86_64_gc_sweep_hook |
6360 | 6267 | #define elf_backend_grok_prstatus elf_x86_64_grok_prstatus |
6361 | 6268 | #define elf_backend_grok_psinfo elf_x86_64_grok_psinfo |
6362 | -#ifdef CORE_HEADER | |
6363 | -#define elf_backend_write_core_note elf_x86_64_write_core_note | |
6364 | -#endif | |
6365 | 6269 | #define elf_backend_reloc_type_class elf_x86_64_reloc_type_class |
6366 | 6270 | #define elf_backend_relocate_section elf_x86_64_relocate_section |
6367 | 6271 | #define elf_backend_size_dynamic_sections elf_x86_64_size_dynamic_sections |
@@ -611,51 +611,3 @@ _bfd_aarch64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) | ||
611 | 611 | |
612 | 612 | return TRUE; |
613 | 613 | } |
614 | - | |
615 | -char * | |
616 | -_bfd_aarch64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, | |
617 | - ...) | |
618 | -{ | |
619 | - switch (note_type) | |
620 | - { | |
621 | - default: | |
622 | - return NULL; | |
623 | - | |
624 | - case NT_PRPSINFO: | |
625 | - { | |
626 | - char data[136]; | |
627 | - va_list ap; | |
628 | - | |
629 | - va_start (ap, note_type); | |
630 | - memset (data, 0, sizeof (data)); | |
631 | - strncpy (data + 40, va_arg (ap, const char *), 16); | |
632 | - strncpy (data + 56, va_arg (ap, const char *), 80); | |
633 | - va_end (ap); | |
634 | - | |
635 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", | |
636 | - note_type, data, sizeof (data)); | |
637 | - } | |
638 | - | |
639 | - case NT_PRSTATUS: | |
640 | - { | |
641 | - char data[392]; | |
642 | - va_list ap; | |
643 | - long pid; | |
644 | - int cursig; | |
645 | - const void *greg; | |
646 | - | |
647 | - va_start (ap, note_type); | |
648 | - memset (data, 0, sizeof (data)); | |
649 | - pid = va_arg (ap, long); | |
650 | - bfd_put_32 (abfd, pid, data + 32); | |
651 | - cursig = va_arg (ap, int); | |
652 | - bfd_put_16 (abfd, cursig, data + 12); | |
653 | - greg = va_arg (ap, const void *); | |
654 | - memcpy (data + 112, greg, 272); | |
655 | - va_end (ap); | |
656 | - | |
657 | - return elfcore_write_note (abfd, buf, bufsiz, "CORE", | |
658 | - note_type, data, sizeof (data)); | |
659 | - } | |
660 | - } | |
661 | -} |
@@ -58,10 +58,6 @@ _bfd_aarch64_elf_grok_prstatus (bfd *, Elf_Internal_Note *); | ||
58 | 58 | extern bfd_boolean |
59 | 59 | _bfd_aarch64_elf_grok_psinfo (bfd *, Elf_Internal_Note *); |
60 | 60 | |
61 | -extern char * | |
62 | -_bfd_aarch64_elf_write_core_note (bfd *, char *, int *, int, ...); | |
63 | - | |
64 | 61 | #define elf_backend_add_symbol_hook _bfd_aarch64_elf_add_symbol_hook |
65 | 62 | #define elf_backend_grok_prstatus _bfd_aarch64_elf_grok_prstatus |
66 | 63 | #define elf_backend_grok_psinfo _bfd_aarch64_elf_grok_psinfo |
67 | -#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note |
@@ -550,9 +550,6 @@ | ||
550 | 550 | #ifndef elf_backend_grok_psinfo |
551 | 551 | #define elf_backend_grok_psinfo NULL |
552 | 552 | #endif |
553 | -#ifndef elf_backend_write_core_note | |
554 | -#define elf_backend_write_core_note NULL | |
555 | -#endif | |
556 | 553 | #ifndef elf_backend_lookup_section_flags_hook |
557 | 554 | #define elf_backend_lookup_section_flags_hook NULL |
558 | 555 | #endif |
@@ -762,7 +759,6 @@ static struct elf_backend_data elfNN_bed = | ||
762 | 759 | elf_backend_sort_relocs_p, |
763 | 760 | elf_backend_grok_prstatus, |
764 | 761 | elf_backend_grok_psinfo, |
765 | - elf_backend_write_core_note, | |
766 | 762 | elf_backend_lookup_section_flags_hook, |
767 | 763 | elf_backend_reloc_type_class, |
768 | 764 | elf_backend_discard_info, |
@@ -1,232 +0,0 @@ | ||
1 | -/* Copyright (C) 2006-2016 Free Software Foundation, Inc. | |
2 | - This file is part of the GNU C Library. | |
3 | - | |
4 | - The GNU C Library is free software; you can redistribute it and/or | |
5 | - modify it under the terms of the GNU Lesser General Public | |
6 | - License as published by the Free Software Foundation; either | |
7 | - version 2.1 of the License, or (at your option) any later version. | |
8 | - | |
9 | - The GNU C Library is distributed in the hope that it will be useful, | |
10 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | - Lesser General Public License for more details. | |
13 | - | |
14 | - You should have received a copy of the GNU Lesser General Public | |
15 | - License along with the GNU C Library; if not, write to the Free | |
16 | - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | - 02111-1307 USA. */ | |
18 | - | |
19 | -/* This is somewhat modelled after the file of the same name on SVR4 | |
20 | - systems. It provides a definition of the core file format for ELF | |
21 | - used on Linux. It doesn't have anything to do with the /proc file | |
22 | - system, even though Linux has one. | |
23 | - | |
24 | - Anyway, the whole purpose of this file is for GDB and GDB only. | |
25 | - Don't read too much into it. Don't use it for anything other than | |
26 | - GDB unless you know what you are doing. */ | |
27 | - | |
28 | -#include <features.h> | |
29 | -#include <sys/time.h> | |
30 | -#include <sys/types.h> | |
31 | - | |
32 | -/* We define here only the symbols differing from their 64-bit variant. */ | |
33 | -#include <sys/procfs.h> | |
34 | - | |
35 | -#ifdef HAVE_STDINT_H | |
36 | -#include <stdint.h> | |
37 | -#else | |
38 | -typedef unsigned int uint32_t; | |
39 | -typedef unsigned long long int uint64_t; | |
40 | -#endif | |
41 | - | |
42 | -/* Unsigned 64-bit integer aligned to 8 bytes. */ | |
43 | -typedef uint64_t __attribute__ ((__aligned__ (8))) a8_uint64_t; | |
44 | - | |
45 | -#undef HAVE_PRPSINFO32_T | |
46 | -#define HAVE_PRPSINFO32_T | |
47 | -#undef HAVE_PRPSINFO32_T_PR_PID | |
48 | -#define HAVE_PRPSINFO32_T_PR_PID | |
49 | - | |
50 | -#undef HAVE_PRSTATUS32_T | |
51 | -#define HAVE_PRSTATUS32_T | |
52 | - | |
53 | -/* These are the 32-bit x86 structures. */ | |
54 | - | |
55 | -struct user_regs32_struct | |
56 | -{ | |
57 | - int32_t ebx; | |
58 | - int32_t ecx; | |
59 | - int32_t edx; | |
60 | - int32_t esi; | |
61 | - int32_t edi; | |
62 | - int32_t ebp; | |
63 | - int32_t eax; | |
64 | - int32_t xds; | |
65 | - int32_t xes; | |
66 | - int32_t xfs; | |
67 | - int32_t xgs; | |
68 | - int32_t orig_eax; | |
69 | - int32_t eip; | |
70 | - int32_t xcs; | |
71 | - int32_t eflags; | |
72 | - int32_t esp; | |
73 | - int32_t xss; | |
74 | -}; | |
75 | - | |
76 | -struct user_regs64_struct | |
77 | -{ | |
78 | - a8_uint64_t r15; | |
79 | - a8_uint64_t r14; | |
80 | - a8_uint64_t r13; | |
81 | - a8_uint64_t r12; | |
82 | - a8_uint64_t rbp; | |
83 | - a8_uint64_t rbx; | |
84 | - a8_uint64_t r11; | |
85 | - a8_uint64_t r10; | |
86 | - a8_uint64_t r9; | |
87 | - a8_uint64_t r8; | |
88 | - a8_uint64_t rax; | |
89 | - a8_uint64_t rcx; | |
90 | - a8_uint64_t rdx; | |
91 | - a8_uint64_t rsi; | |
92 | - a8_uint64_t rdi; | |
93 | - a8_uint64_t orig_rax; | |
94 | - a8_uint64_t rip; | |
95 | - a8_uint64_t cs; | |
96 | - a8_uint64_t eflags; | |
97 | - a8_uint64_t rsp; | |
98 | - a8_uint64_t ss; | |
99 | - a8_uint64_t fs_base; | |
100 | - a8_uint64_t gs_base; | |
101 | - a8_uint64_t ds; | |
102 | - a8_uint64_t es; | |
103 | - a8_uint64_t fs; | |
104 | - a8_uint64_t gs; | |
105 | -}; | |
106 | - | |
107 | -/* Type for a general-purpose register. */ | |
108 | -typedef uint32_t elf_greg32_t; | |
109 | -typedef a8_uint64_t elf_greg64_t; | |
110 | - | |
111 | -/* And the whole bunch of them. We could have used `struct | |
112 | - user_regs_struct' directly in the typedef, but tradition says that | |
113 | - the register set is an array, which does have some peculiar | |
114 | - semantics, so leave it that way. */ | |
115 | -#define ELF_NGREG32 (sizeof (struct user_regs32_struct) / sizeof(elf_greg32_t)) | |
116 | -typedef elf_greg32_t elf_gregset32_t[ELF_NGREG32]; | |
117 | -#define ELF_NGREG64 (sizeof (struct user_regs64_struct) / sizeof(elf_greg64_t)) | |
118 | -typedef elf_greg64_t elf_gregset64_t[ELF_NGREG64]; | |
119 | - | |
120 | -/* Definitions to generate Intel SVR4-like core files. These mostly | |
121 | - have the same names as the SVR4 types with "elf_" tacked on the | |
122 | - front to prevent clashes with Linux definitions, and the typedef | |
123 | - forms have been avoided. This is mostly like the SVR4 structure, | |
124 | - but more Linuxy, with things that Linux does not support and which | |
125 | - GDB doesn't really use excluded. */ | |
126 | - | |
127 | -struct prstatus32_timeval | |
128 | - { | |
129 | - int tv_sec; | |
130 | - int tv_usec; | |
131 | - }; | |
132 | - | |
133 | -struct prstatus64_timeval | |
134 | - { | |
135 | - a8_uint64_t tv_sec; | |
136 | - a8_uint64_t tv_usec; | |
137 | - }; | |
138 | - | |
139 | -struct elf_prstatus32 | |
140 | - { | |
141 | - struct elf_siginfo pr_info; /* Info associated with signal. */ | |
142 | - short int pr_cursig; /* Current signal. */ | |
143 | - unsigned int pr_sigpend; /* Set of pending signals. */ | |
144 | - unsigned int pr_sighold; /* Set of held signals. */ | |
145 | - pid_t pr_pid; | |
146 | - pid_t pr_ppid; | |
147 | - pid_t pr_pgrp; | |
148 | - pid_t pr_sid; | |
149 | - struct prstatus32_timeval pr_utime; /* User time. */ | |
150 | - struct prstatus32_timeval pr_stime; /* System time. */ | |
151 | - struct prstatus32_timeval pr_cutime; /* Cumulative user time. */ | |
152 | - struct prstatus32_timeval pr_cstime; /* Cumulative system time. */ | |
153 | - elf_gregset32_t pr_reg; /* GP registers. */ | |
154 | - int pr_fpvalid; /* True if math copro being used. */ | |
155 | - }; | |
156 | - | |
157 | -struct elf_prstatusx32 | |
158 | - { | |
159 | - struct elf_siginfo pr_info; /* Info associated with signal. */ | |
160 | - short int pr_cursig; /* Current signal. */ | |
161 | - unsigned int pr_sigpend; /* Set of pending signals. */ | |
162 | - unsigned int pr_sighold; /* Set of held signals. */ | |
163 | - pid_t pr_pid; | |
164 | - pid_t pr_ppid; | |
165 | - pid_t pr_pgrp; | |
166 | - pid_t pr_sid; | |
167 | - struct prstatus32_timeval pr_utime; /* User time. */ | |
168 | - struct prstatus32_timeval pr_stime; /* System time. */ | |
169 | - struct prstatus32_timeval pr_cutime; /* Cumulative user time. */ | |
170 | - struct prstatus32_timeval pr_cstime; /* Cumulative system time. */ | |
171 | - elf_gregset64_t pr_reg; /* GP registers. */ | |
172 | - int pr_fpvalid; /* True if math copro being used. */ | |
173 | - }; | |
174 | - | |
175 | -struct elf_prstatus64 | |
176 | - { | |
177 | - struct elf_siginfo pr_info; /* Info associated with signal. */ | |
178 | - short int pr_cursig; /* Current signal. */ | |
179 | - a8_uint64_t pr_sigpend; /* Set of pending signals. */ | |
180 | - a8_uint64_t pr_sighold; /* Set of held signals. */ | |
181 | - pid_t pr_pid; | |
182 | - pid_t pr_ppid; | |
183 | - pid_t pr_pgrp; | |
184 | - pid_t pr_sid; | |
185 | - struct prstatus64_timeval pr_utime; /* User time. */ | |
186 | - struct prstatus64_timeval pr_stime; /* System time. */ | |
187 | - struct prstatus64_timeval pr_cutime; /* Cumulative user time. */ | |
188 | - struct prstatus64_timeval pr_cstime; /* Cumulative system time. */ | |
189 | - elf_gregset64_t pr_reg; /* GP registers. */ | |
190 | - int pr_fpvalid; /* True if math copro being used. */ | |
191 | - }; | |
192 | - | |
193 | -struct elf_prpsinfo32 | |
194 | - { | |
195 | - char pr_state; /* Numeric process state. */ | |
196 | - char pr_sname; /* Char for pr_state. */ | |
197 | - char pr_zomb; /* Zombie. */ | |
198 | - char pr_nice; /* Nice val. */ | |
199 | - unsigned int pr_flag; /* Flags. */ | |
200 | - unsigned short int pr_uid; | |
201 | - unsigned short int pr_gid; | |
202 | - int pr_pid, pr_ppid, pr_pgrp, pr_sid; | |
203 | - /* Lots missing */ | |
204 | - char pr_fname[16]; /* Filename of executable. */ | |
205 | - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ | |
206 | - }; | |
207 | - | |
208 | -struct elf_prpsinfo64 | |
209 | - { | |
210 | - char pr_state; /* Numeric process state. */ | |
211 | - char pr_sname; /* Char for pr_state. */ | |
212 | - char pr_zomb; /* Zombie. */ | |
213 | - char pr_nice; /* Nice val. */ | |
214 | - a8_uint64_t pr_flag; /* Flags. */ | |
215 | - unsigned int pr_uid; | |
216 | - unsigned int pr_gid; | |
217 | - int pr_pid, pr_ppid, pr_pgrp, pr_sid; | |
218 | - /* Lots missing */ | |
219 | - char pr_fname[16]; /* Filename of executable. */ | |
220 | - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ | |
221 | - }; | |
222 | - | |
223 | -/* The rest of this file provides the types for emulation of the | |
224 | - Solaris <proc_service.h> interfaces that should be implemented by | |
225 | - users of libthread_db. */ | |
226 | - | |
227 | -/* Process status and info. In the end we do provide typedefs for them. */ | |
228 | -typedef struct elf_prstatus32 prstatus32_t; | |
229 | -typedef struct elf_prstatusx32 prstatusx32_t; | |
230 | -typedef struct elf_prstatus64 prstatus64_t; | |
231 | -typedef struct elf_prpsinfo32 prpsinfo32_t; | |
232 | -typedef struct elf_prpsinfo64 prpsinfo64_t; |