diff options
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/config.in | 3 | ||||
-rwxr-xr-x | bfd/configure | 15 | ||||
-rw-r--r-- | bfd/configure.in | 2 | ||||
-rw-r--r-- | bfd/elf64-hppa.c | 26 | ||||
-rw-r--r-- | bfd/som.c | 25 |
6 files changed, 69 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 09d3a7e..955877d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,15 @@ 2007-10-16 Nick Clifton <nickc@redhat.com> + PR 5146 + * configure.in (AC_CHECK_HEADERS): Add alloca.h + * configure: Regenerate. + * config.in: Regenerate. + * som.c: Replace alloca-conf.h inclusion with code recommended in + autoconf documentation. + * elf64-hppa.c: Likewise. + +2007-10-16 Nick Clifton <nickc@redhat.com> + * configure.in (--enable-elf-stt-common): New configure option. If enabled then the tools can generate symbols with the ELF STT_COMMON type. diff --git a/bfd/config.in b/bfd/config.in index fd14f82..3864885 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -4,6 +4,9 @@ language is requested. */ #undef ENABLE_NLS +/* Define to 1 if you have the <alloca.h> header file. */ +#undef HAVE_ALLOCA_H + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #undef HAVE_DECL_BASENAME diff --git a/bfd/configure b/bfd/configure index 806ee7e..c15a118 100755 --- a/bfd/configure +++ b/bfd/configure @@ -10531,14 +10531,11 @@ echo "$as_me: error: bad value ${enableval} for ELF STT_COMMON option" >&2;} esac else # We have to choose a default behaviour. For native builds we could -# test whether the loader supports the STT_COMMON type. For cross -# toolchains we default to assuming that they are not supported. -if test "$cross_compiling" != yes; then - want_elf_stt_common=false - else - # XXX FIXME: Add code to test the loader here. +# test whether the loader supports the STT_COMMON type, but that would +# mean that built binaries could not be exported to older systems where +# the loader does not support it. So by default we always choose to +# disable this feature. want_elf_stt_common=false - fi fi; if test $want_elf_stt_common = true; then cat >>confdefs.h <<\_ACEOF @@ -10549,7 +10546,6 @@ fi - # Check whether --with-pkgversion or --without-pkgversion was given. if test "${with_pkgversion+set}" = set; then withval="$with_pkgversion" @@ -12548,7 +12544,8 @@ fi -for ac_header in stddef.h string.h strings.h stdlib.h time.h unistd.h + +for ac_header in alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/bfd/configure.in b/bfd/configure.in index ad8440e..ac83f11 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -171,7 +171,7 @@ AC_SUBST(BFD_HOSTPTR_T) BFD_CC_FOR_BUILD -AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) +AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h) AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h) GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 9a4eae2..0eb1787 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "alloca-conf.h" #include "sysdep.h" #include "bfd.h" #include "libbfd.h" @@ -27,6 +26,31 @@ #include "elf/hppa.h" #include "libhppa.h" #include "elf64-hppa.h" + +/* This is the code recommended in the autoconf documentation, almost + verbatim. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# if !defined (__STDC__) && !defined (__hpux) +extern char *alloca (); +# else +extern void *alloca (); +# endif /* __STDC__, __hpux */ +# endif /* alloca */ +# endif /* _AIX */ +# endif /* HAVE_ALLOCA_H */ +#endif /* __GNUC__ */ + + #define ARCH_SIZE 64 #define PLT_ENTRY_SIZE 0x10 @@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "alloca-conf.h" #include "sysdep.h" #include "bfd.h" @@ -38,6 +37,30 @@ #include <machine/reg.h> #include <sys/file.h> +/* This is the code recommended in the autoconf documentation, almost + verbatim. */ + +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX +/* Indented so that pre-ansi C compilers will ignore it, rather than + choke on it. Some versions of AIX require this to be the first + thing in the file. */ + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# if !defined (__STDC__) && !defined (__hpux) +extern char *alloca (); +# else +extern void *alloca (); +# endif /* __STDC__, __hpux */ +# endif /* alloca */ +# endif /* _AIX */ +# endif /* HAVE_ALLOCA_H */ +#endif /* __GNUC__ */ + static bfd_reloc_status_type hppa_som_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_boolean som_mkobject (bfd *); |