PATCH: Check stpcpy for readelf.c

H. J. Lu hjl@lucon.org
Tue Aug 16 15:40:00 GMT 2005


On Sat, Aug 13, 2005 at 05:07:58PM -0700, H. J. Lu wrote:
> On Sat, Aug 13, 2005 at 07:50:11PM -0400, John David Anglin wrote:
> > This following change breaks the build of readelf on hppa2.0w-hp-hpux11.11:
> > 
> > 2005-08-10  H.J. Lu  <hongjiu.lu@intel.com>
> > 
> > 	* readelf.c (do_full_section_name): Renamed to ...
> > 	(do_section_details): This.
> > 	(option): Rename "-N/--full-section-name" to
> > 	"-f/--section-details".
> > 	(usage): Likewise.
> > 	(parse_args): Likewise.
> > 	(get_elf_section_flags): Support do_section_details.
> > 	(process_section_headers): Updated for do_section_details.
> > 
> > gcc -DHAVE_CONFIG_H -I. -I../../src/binutils -I. -D_GNU_SOURCE -I. -I../../src/b
> > inutils -I../bfd -I../../src/binutils/../bfd -I../../src/binutils/../include -DH
> > OST_HPPAHPUX -D_LARGEFILE64_SOURCE -I../../src/binutils/../intl -I../intl -DLOCA
> > LEDIR="\"/opt/gnu/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation  -
> > D_LARGEFILE64_SOURCE -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -
> > O2 -c ../../src/binutils/readelf.c
> > cc1: warnings being treated as errors
> > ../../src/binutils/readelf.c: In function 'get_elf_section_flags':
> > ../../src/binutils/readelf.c:3862: warning: implicit declaration of function 'st
> > pcpy'
> > ../../src/binutils/readelf.c:3862: warning: incompatible implicit declaration of
> >  built-in function 'stpcpy'
> > 
> 
> Can you try this patch?
> 

Here is the updated one.


H.J.
---
2005-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	* bucomm.h (stpcpy): Declare if HAVE_DECL_STPCPY isn't defined.

	* configure.in (AC_GNU_SOURCE): Added.
	(AC_CHECK_DECLS): Add stpcpy.
	* configure: Regenerated.
	* config.in: Likewise.

--- binutils/bucomm.h.stp	2005-07-08 08:37:02.000000000 -0700
+++ binutils/bucomm.h	2005-08-13 16:59:51.000000000 -0700
@@ -68,6 +68,10 @@ extern char *strrchr ();
 #endif
 #endif
 
+#if !HAVE_DECL_STPCPY
+extern char *stpcpy (char *__dest, const char *__src);
+#endif
+
 #if !HAVE_DECL_STRSTR
 extern char *strstr ();
 #endif
--- binutils/configure.in.stp	2005-07-06 07:14:47.000000000 -0700
+++ binutils/configure.in	2005-08-13 17:04:46.000000000 -0700
@@ -41,6 +41,7 @@ if test -z "$host" ; then
 fi
 
 AC_PROG_CC
+AC_GNU_SOURCE
 
 AC_PROG_YACC
 AM_PROG_LEX
@@ -182,7 +183,7 @@ if test $bu_cv_header_utime_h = yes; the
   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
 fi
 
-AC_CHECK_DECLS([fprintf, strstr, sbrk, getenv, environ, getc_unlocked])
+AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked])
 
 BFD_BINARY_FOPEN
 



More information about the Binutils mailing list