From: Alan Modra Date: Tue, 1 Jul 2014 08:40:25 +0000 (+0930) Subject: Don't include sys/param.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2dc0e7b400e46f105960c0dfcd431013f0013c6a;p=binutils-gdb.git Don't include sys/param.h sys/param.h on recent versions of powerpc glibc ends up including asm/elf.h via asm/sigcontex.h. asm/elf.h defines R_PPC_* and R_PPC64_* macros, which clash with our include/elf/ppc.h and include/elf/ppc64.h. It turns out that no current source uses LD_PATHMAX, so there is no need for limits.h or sys/param.h, except for one occurrence of UINT_MAX. I don't have a quarrel with limits.h, but it seems unnecessary just for UINT_MAX. * sysdep.h: Don't include limits.h and sys/param.h. Don't include unistd.h twice. (LD_PATHMAX): Don't define. * ldlang.c (lang_common): Don't use UINT_MAX. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 70060a1b9f5..fd14305b1f5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2014-07-01 Alan Modra + + * sysdep.h: Don't include limits.h and sys/param.h. Don't + include unistd.h twice. + (LD_PATHMAX): Don't define. + * ldlang.c (lang_common): Don't use UINT_MAX. + 2014-07-01 Barney Stratford Senthil Kumar Selvaraj Pitchumani Sivanupandi diff --git a/ld/ldlang.c b/ld/ldlang.c index e7c96696993..60877b8ee40 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -5981,7 +5981,7 @@ lang_common (void) for (power = 0; power <= 4; power++) bfd_link_hash_traverse (link_info.hash, lang_one_common, &power); - power = UINT_MAX; + power = (unsigned int) -1; bfd_link_hash_traverse (link_info.hash, lang_one_common, &power); } } diff --git a/ld/sysdep.h b/ld/sysdep.h index c0b8445796e..99caf187f7a 100644 --- a/ld/sysdep.h +++ b/ld/sysdep.h @@ -56,34 +56,12 @@ extern char *strrchr (); #include #endif -/* for PATH_MAX */ -#ifdef HAVE_LIMITS_H -#include -#endif -/* for MAXPATHLEN */ -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef PATH_MAX -# define LD_PATHMAX PATH_MAX -#else -# ifdef MAXPATHLEN -# define LD_PATHMAX MAXPATHLEN -# else -# define LD_PATHMAX 1024 -# endif -#endif - #ifdef HAVE_REALPATH # define REALPATH(a,b) realpath (a, b) #else # define REALPATH(a,b) NULL #endif -#ifdef HAVE_UNISTD_H -#include -#endif - #ifdef USE_BINARY_FOPEN #include "fopen-bin.h" #else