* config.in: Regenerated.
	* configure: Regenerated.
	* configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
	HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
	HAVE_PSINFO32_T_PR_PID.
	* elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
	HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
	and HAVE_PSINFO32_T_PR_PID.
	* hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
This commit is contained in:
Jan Kratochvil 2011-05-12 07:41:43 +00:00
parent 10483e8e4e
commit 335e41d4eb
6 changed files with 182 additions and 0 deletions

View file

@ -1,3 +1,15 @@
2011-05-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* config.in: Regenerated.
* configure: Regenerated.
* configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
HAVE_PSINFO32_T_PR_PID.
* elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
and HAVE_PSINFO32_T_PR_PID.
* hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
2011-05-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and

View file

@ -144,9 +144,15 @@
/* Define if <sys/procfs.h> has prpsinfo32_t. */
#undef HAVE_PRPSINFO32_T
/* Define if <sys/procfs.h> has prpsinfo32_t.pr_pid. */
#undef HAVE_PRPSINFO32_T_PR_PID
/* Define if <sys/procfs.h> has prpsinfo_t. */
#undef HAVE_PRPSINFO_T
/* Define if <sys/procfs.h> has prpsinfo_t.pr_pid. */
#undef HAVE_PRPSINFO_T_PR_PID
/* Define if <sys/procfs.h> has prstatus32_t. */
#undef HAVE_PRSTATUS32_T
@ -162,9 +168,15 @@
/* Define if <sys/procfs.h> has psinfo32_t. */
#undef HAVE_PSINFO32_T
/* Define if <sys/procfs.h> has psinfo32_t.pr_pid. */
#undef HAVE_PSINFO32_T_PR_PID
/* Define if <sys/procfs.h> has psinfo_t. */
#undef HAVE_PSINFO_T
/* Define if <sys/procfs.h> has psinfo_t.pr_pid. */
#undef HAVE_PSINFO_T_PR_PID
/* Define if <sys/procfs.h> has pstatus32_t. */
#undef HAVE_PSTATUS32_T

148
bfd/configure vendored
View file

@ -14379,6 +14379,43 @@ $as_echo "#define HAVE_PRPSINFO_T 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prpsinfo_t" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_prpsinfo_t" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo_t.pr_pid in sys/procfs.h" >&5
$as_echo_n "checking for prpsinfo_t.pr_pid in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _SYSCALL32
/* Needed for new procfs interface on sparc-solaris. */
#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
{
prpsinfo_t avar; void* aref = (void*) &avar.pr_pid
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid=yes
else
bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid = yes; then
$as_echo "#define HAVE_PRPSINFO_T_PR_PID 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_member_prpsinfo_t_pr_pid" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo32_t in sys/procfs.h" >&5
$as_echo_n "checking for prpsinfo32_t in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_prpsinfo32_t+set}" = set; then :
@ -14416,6 +14453,43 @@ $as_echo "#define HAVE_PRPSINFO32_T 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prpsinfo32_t.pr_pid in sys/procfs.h" >&5
$as_echo_n "checking for prpsinfo32_t.pr_pid in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _SYSCALL32
/* Needed for new procfs interface on sparc-solaris. */
#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
{
prpsinfo32_t avar; void* aref = (void*) &avar.pr_pid
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid=yes
else
bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid = yes; then
$as_echo "#define HAVE_PRPSINFO32_T_PR_PID 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_member_prpsinfo32_t_pr_pid" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo_t in sys/procfs.h" >&5
$as_echo_n "checking for psinfo_t in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_psinfo_t+set}" = set; then :
@ -14453,6 +14527,43 @@ $as_echo "#define HAVE_PSINFO_T 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psinfo_t" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_psinfo_t" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo_t.pr_pid in sys/procfs.h" >&5
$as_echo_n "checking for psinfo_t.pr_pid in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _SYSCALL32
/* Needed for new procfs interface on sparc-solaris. */
#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
{
psinfo_t avar; void* aref = (void*) &avar.pr_pid
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid=yes
else
bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid = yes; then
$as_echo "#define HAVE_PSINFO_T_PR_PID 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_member_psinfo_t_pr_pid" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo32_t in sys/procfs.h" >&5
$as_echo_n "checking for psinfo32_t in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_psinfo32_t+set}" = set; then :
@ -14490,6 +14601,43 @@ $as_echo "#define HAVE_PSINFO32_T 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psinfo32_t" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_psinfo32_t" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for psinfo32_t.pr_pid in sys/procfs.h" >&5
$as_echo_n "checking for psinfo32_t.pr_pid in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _SYSCALL32
/* Needed for new procfs interface on sparc-solaris. */
#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
{
psinfo32_t avar; void* aref = (void*) &avar.pr_pid
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid=yes
else
bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid = yes; then
$as_echo "#define HAVE_PSINFO32_T_PR_PID 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_member_psinfo32_t_pr_pid" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpstatus_t in sys/procfs.h" >&5
$as_echo_n "checking for lwpstatus_t in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_lwpstatus_t+set}" = set; then :

View file

@ -488,9 +488,13 @@ changequote([,])dnl
BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo_t, pr_pid)
BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo32_t, pr_pid)
BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo_t, pr_pid)
BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo32_t, pr_pid)
BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)

View file

@ -8000,7 +8000,9 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
memcpy (&psinfo, note->descdata, sizeof (psinfo));
#if defined (HAVE_PSINFO_T_PR_PID) || defined (HAVE_PRPSINFO_T_PR_PID)
elf_tdata (abfd)->core_pid = psinfo.pr_pid;
#endif
elf_tdata (abfd)->core_program
= _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
sizeof (psinfo.pr_fname));
@ -8017,7 +8019,9 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
memcpy (&psinfo, note->descdata, sizeof (psinfo));
#if defined (HAVE_PSINFO32_T_PR_PID) || defined (HAVE_PRPSINFO32_T_PR_PID)
elf_tdata (abfd)->core_pid = psinfo.pr_pid;
#endif
elf_tdata (abfd)->core_program
= _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
sizeof (psinfo.pr_fname));

View file

@ -41,6 +41,8 @@ typedef unsigned int uint32_t;
#undef HAVE_PRPSINFO32_T
#define HAVE_PRPSINFO32_T
#undef HAVE_PRPSINFO32_T_PR_PID
#define HAVE_PRPSINFO32_T_PR_PID
#undef HAVE_PRSTATUS32_T
#define HAVE_PRSTATUS32_T