From 7ee38065312ef0414af77402fcfd670eae81d6a0 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 30 Aug 2000 18:12:21 +0000 Subject: [PATCH] 2000-08-29 Michael Snyder * elf.c: Eliminate references to __sparcv9 macro; replace with autoconf variables HAVE_PSINFO32_T etc. * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. * config.in: Ditto. * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. * aclocal.m4: Ditto. * configure: Regenerate. --- bfd/ChangeLog | 12 +++ bfd/acinclude.m4 | 8 +- bfd/aclocal.m4 | 9 +- bfd/config.in | 15 +++ bfd/configure | 272 +++++++++++++++++++++++++++++++++++++++++++++++-------- bfd/configure.in | 5 + bfd/elf.c | 45 ++++----- 7 files changed, 298 insertions(+), 68 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 74cdcec..7514d53 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,15 @@ +2000-08-29 Michael Snyder + + * elf.c: Eliminate references to __sparcv9 macro; replace with + autoconf variables HAVE_PSINFO32_T etc. + * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, + HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. + * config.in: Ditto. + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can + detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. + * aclocal.m4: Ditto. + * configure: Regenerate. + 2000-08-27 Alan Modra * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4 index cac26e8..9ad568f 100644 --- a/bfd/acinclude.m4 +++ b/bfd/acinclude.m4 @@ -74,7 +74,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -92,7 +94,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index a53eda7..42c58a3 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -1,3 +1,4 @@ + dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. @@ -86,7 +87,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -104,7 +107,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no diff --git a/bfd/config.in b/bfd/config.in index 7383656..60338a8 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -211,18 +211,33 @@ /* Define if has prstatus_t. */ #undef HAVE_PRSTATUS_T +/* Define if has prstatus32_t. */ +#undef HAVE_PRSTATUS32_T + /* Define if has prstatus_t.pr_who. */ #undef HAVE_PRSTATUS_T_PR_WHO +/* Define if has prstatus32_t.pr_who. */ +#undef HAVE_PRSTATUS32_T_PR_WHO + /* Define if has pstatus_t. */ #undef HAVE_PSTATUS_T +/* Define if has pstatus32_t. */ +#undef HAVE_PSTATUS32_T + /* Define if has prpsinfo_t. */ #undef HAVE_PRPSINFO_T +/* Define if has prpsinfo32_t. */ +#undef HAVE_PRPSINFO32_T + /* Define if has psinfo_t. */ #undef HAVE_PSINFO_T +/* Define if has psinfo32_t. */ +#undef HAVE_PSINFO32_T + /* Define if has lwpstatus_t. */ #undef HAVE_LWPSTATUS_T diff --git a/bfd/configure b/bfd/configure index 39e3ef7..5969550 100755 --- a/bfd/configure +++ b/bfd/configure @@ -4685,12 +4685,14 @@ else cat > conftest.$ac_ext < int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:4694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -4711,20 +4713,58 @@ EOF fi echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 + echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 +echo "configure:4718: checking for prstatus32_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +prstatus32_t avar +; return 0; } +EOF +if { (eval echo configure:4732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prstatus32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prstatus32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_prstatus32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRSTATUS32_T 1 +EOF + + fi + echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 + echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4716: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:4754: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:4728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -4745,20 +4785,58 @@ EOF fi echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 + echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 +echo "configure:4790: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +prstatus32_t avar; void* aref = (void*) &avar.pr_who +; return 0; } +EOF +if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRSTATUS32_T_PR_WHO 1 +EOF + + fi + echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 + echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4750: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4826: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4779,20 +4857,58 @@ EOF fi echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 + echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 +echo "configure:4862: checking for pstatus32_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +pstatus32_t avar +; return 0; } +EOF +if { (eval echo configure:4876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pstatus32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pstatus32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_pstatus32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PSTATUS32_T 1 +EOF + + fi + echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 + echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4784: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:4898: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:4796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -4813,20 +4929,58 @@ EOF fi echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 + echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 +echo "configure:4934: checking for prpsinfo32_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +prpsinfo32_t avar +; return 0; } +EOF +if { (eval echo configure:4948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prpsinfo32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_prpsinfo32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRPSINFO32_T 1 +EOF + + fi + echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 + echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4818: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:4970: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:4830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -4847,20 +5001,58 @@ EOF fi echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 + echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 +echo "configure:5006: checking for psinfo32_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +psinfo32_t avar +; return 0; } +EOF +if { (eval echo configure:5020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_psinfo32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_psinfo32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_psinfo32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PSINFO32_T 1 +EOF + + fi + echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 + echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4852: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5042: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:4864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -4882,19 +5074,21 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4886: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5078: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:4898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -4916,19 +5110,21 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4920: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5114: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:4932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -4950,19 +5146,21 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4954: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5150: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { win32_pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -5348,17 +5546,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5352: checking for $ac_hdr" >&5 +echo "configure:5550: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5387,12 +5585,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5391: checking for $ac_func" >&5 +echo "configure:5589: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5440,7 +5638,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5444: checking for working mmap" >&5 +echo "configure:5642: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5448,7 +5646,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -5613,12 +5811,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5617: checking for $ac_func" >&5 +echo "configure:5815: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/bfd/configure.in b/bfd/configure.in index 56dde91..a22f014 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -339,10 +339,15 @@ changequote([,])dnl AC_CHECK_HEADERS(sys/procfs.h) if test "$ac_cv_header_sys_procfs_h" = yes; then BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who) BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t) BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t) BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t) BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg) diff --git a/bfd/elf.c b/bfd/elf.c index 4377797..567be36 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -31,10 +31,8 @@ SECTION haven't bothered yet. */ -#ifdef __sparcv9 -#define _SYSCALL32 /* For Sparc64-cross-32 */ -#endif - +/* For sparc64-cross-sparc32. */ +#define _SYSCALL32 #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -802,7 +800,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) if (name == NULL) { - name = symbol->name; + name = symbol->name; bfd_print_symbol_vandf ((PTR) file, symbol); } @@ -981,7 +979,7 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) } void -_bfd_elf_link_hash_hide_symbol(info, h) +_bfd_elf_link_hash_hide_symbol (info, h) struct bfd_link_info *info ATTRIBUTE_UNUSED; struct elf_link_hash_entry *h; { @@ -5300,12 +5298,14 @@ elfcore_grok_prstatus (abfd, note) char* name; asection* sect; int raw_size; + int offset; if (note->descsz == sizeof (prstatus_t)) { prstatus_t prstat; raw_size = sizeof (prstat.pr_reg); + offset = offsetof (prstatus_t, pr_reg); memcpy (&prstat, note->descdata, sizeof (prstat)); elf_tdata (abfd)->core_signal = prstat.pr_cursig; @@ -5321,13 +5321,14 @@ elfcore_grok_prstatus (abfd, note) elf_tdata (abfd)->core_lwpid = prstat.pr_who; #endif } -#if defined (__sparcv9) +#if defined (HAVE_PRSTATUS32_T) else if (note->descsz == sizeof (prstatus32_t)) { /* 64-bit host, 32-bit corefile */ prstatus32_t prstat; raw_size = sizeof (prstat.pr_reg); + offset = offsetof (prstatus32_t, pr_reg); memcpy (&prstat, note->descdata, sizeof (prstat)); elf_tdata (abfd)->core_signal = prstat.pr_cursig; @@ -5339,11 +5340,11 @@ elfcore_grok_prstatus (abfd, note) pr_who doesn't exist on: linux 2.[01] */ -#if defined (HAVE_PRSTATUS_T_PR_WHO) +#if defined (HAVE_PRSTATUS32_T_PR_WHO) elf_tdata (abfd)->core_lwpid = prstat.pr_who; #endif } -#endif /* __sparcv9 */ +#endif /* HAVE_PRSTATUS32_T */ else { /* Fail - we don't know how to handle any other @@ -5363,18 +5364,8 @@ elfcore_grok_prstatus (abfd, note) if (sect == NULL) return false; - if (note->descsz == sizeof (prstatus_t)) - { - sect->_raw_size = raw_size; - sect->filepos = note->descpos + offsetof (prstatus_t, pr_reg); - } -#if defined (__sparcv9) - else if (note->descsz == sizeof (prstatus32_t)) - { - sect->_raw_size = raw_size; - sect->filepos = note->descpos + offsetof (prstatus32_t, pr_reg); - } -#endif + sect->_raw_size = raw_size; + sect->filepos = note->descpos + offset; sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; @@ -5454,14 +5445,14 @@ elfcore_grok_prxfpreg (abfd, note) #if defined (HAVE_PRPSINFO_T) typedef prpsinfo_t elfcore_psinfo_t; -#if defined (__sparcv9) /* Sparc64 cross Sparc32 */ +#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ typedef prpsinfo32_t elfcore_psinfo32_t; #endif #endif #if defined (HAVE_PSINFO_T) typedef psinfo_t elfcore_psinfo_t; -#if defined (__sparcv9) /* Sparc64 cross Sparc32 */ +#if defined (HAVE_PSINFO32_T) /* Sparc64 cross Sparc32 */ typedef psinfo32_t elfcore_psinfo32_t; #endif #endif @@ -5507,7 +5498,7 @@ elfcore_grok_psinfo (abfd, note) { elfcore_psinfo_t psinfo; - memcpy (&psinfo, note->descdata, note->descsz); + memcpy (&psinfo, note->descdata, sizeof (psinfo)); elf_tdata (abfd)->core_program = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); @@ -5515,13 +5506,13 @@ elfcore_grok_psinfo (abfd, note) elf_tdata (abfd)->core_command = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); } -#if defined (__sparcv9) +#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) else if (note->descsz == sizeof (elfcore_psinfo32_t)) { /* 64-bit host, 32-bit corefile */ elfcore_psinfo32_t psinfo; - memcpy (&psinfo, note->descdata, note->descsz); + memcpy (&psinfo, note->descdata, sizeof (psinfo)); elf_tdata (abfd)->core_program = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); @@ -5569,7 +5560,7 @@ elfcore_grok_pstatus (abfd, note) elf_tdata (abfd)->core_pid = pstat.pr_pid; } -#if defined (__sparcv9) +#if defined (HAVE_PSTATUS32_T) else if (note->descsz == sizeof (pstatus32_t)) { /* 64-bit host, 32-bit corefile */ -- 2.7.4