[binutils-gdb] libiberty: sync with GCC
Pietro Monteiro
pietro@sourceware.org
Tue Nov 3 01:23:16 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9db3b515b964c1bbdc4d20c1202fbf27719be269
commit 9db3b515b964c1bbdc4d20c1202fbf27719be269
Author: Pietro Monteiro <pietro@sociotechnical.xyz>
Date: Mon Nov 2 20:07:33 2026 -0500
libiberty: sync with GCC
Sync the libiberty/ directory with gcc commit
be07ead43d9d980584b745ee6e06c5d4309ced1d. This pulls in the following
gcc commits and the associated updates to 'libiberty/ChangeLog':
2612b60e5b6 libiberty: Update Makefile dependencies
d58a2bf4760 config: mmap: Avoid the sanitizer configure check failure
f5e51990065 libiberty: drop obsolete C functionality tests
db890f7a7d3 configury: replace autoconf obsolete macros [PR103459]
619a5e55867 driver: Spill long COLLECT_GCC_OPTIONS to a response file [PR111527]
f746787e2c3 libiberty, Darwin: Read dylibs too
The commit:
d9d9119bf2f libiberty d_compact_number signed integer overflow
was already in the binutils-gdb tree I just brought its changelog
entry from the GCC tree.
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
Diff:
---
libiberty/ChangeLog | 49 ++++++++++++++++
libiberty/Makefile.in | 36 +++++++-----
libiberty/acinclude.m4 | 35 +++++------
libiberty/config.in | 9 ---
libiberty/configure | 123 ---------------------------------------
libiberty/configure.ac | 34 +++++------
libiberty/functions.texi | 70 ++++++++++++++--------
libiberty/simple-object-mach-o.c | 5 +-
8 files changed, 153 insertions(+), 208 deletions(-)
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index e60b5951ea4..8f962f9020e 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,52 @@
+2026-11-02 Pietro Monteiro <pietro@sociotechnical.xyz>
+
+ * Makefile.in (aclocal_deps): Depend on
+ ../config/clang-plugin.m4, ../config/hwcaps.m4, and
+ ../config/mmap.m4.
+ (./filedescriptor.$(objext)): Update dependencies.
+ (./filename_cmp.$(objext)): Likewise.
+ (./memrchr.$(objext)): Likewise.
+ ( ./pex-unix.$(objext)): Likewise.
+ (./setenv.$(objext)): Likewise.
+ ( ./xmalloc.$(objext)): Likewise.
+ * acinclude.m4: Stop including ../config/mmap.m4.
+ * aclocal.m4: Regenerate.
+ * functions.texi: Likewise.
+
+2026-10-16 Pietro Monteiro <pietro@sociotechnical.xyz>
+
+ * acinclude.m4: Change AC_FUNC_MMAP to GCC_AC_FUNC_MMAP.
+ * configure: Regenerate.
+
+2026-10-15 Sam James <sam@gentoo.org>
+
+ PR bootstrap/112422
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * configure.ac: Drop AC_C_CONST and AC_C_INLINE.
+
+2026-07-01 Alan Modra <amodra@gmail.com>
+
+ * cp-demangle.c (d_compact_number): Avoid signed overflow.
+
+2026-06-29 Pietro Monteiro <pietro@sociotechnical.xyz>
+
+ PR bootstrap/103459
+ * acinclude.m4: Replace AC_TRY_RUN with AC_RUN_IFELSE. Replace
+ AC_TRY_COMPILE with AC_COMPILE_IFELSE.
+ * configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE. Replace
+ AC_ISC_POSIX with AC_SEARCH_LIBS([strerror],[cposix]).
+
+2026-06-13 Sunil Dora <sunilkumar.dora@windriver.com>
+
+ PR driver/111527
+ * argv.c (expandargstr): New function.
+
+2026-06-10 Pietro Monteiro <pietro@sociotechnical.xyz>
+
+ * simple-object-mach-o.c (MACH_O_MH_DYLIB): New definition.
+ (simple_object_mach_o_match): Accept dylibs as well as object files.
+
2026-06-07 Andrew Burgess <aburgess@redhat.com>
* d-demangle.c (struct dlang_info::options): New field,
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 6d8c88ebfe7..38d770d89d6 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -508,8 +508,10 @@ ACLOCAL_AMFLAGS = -I ../config -I ..
aclocal_deps = \
$(srcdir)/../config/acx.m4 \
$(srcdir)/../config/cet.m4 \
+ $(srcdir)/../config/clang-plugin.m4 \
$(srcdir)/../config/enable.m4 \
$(srcdir)/../config/gcc-plugin.m4 \
+ $(srcdir)/../config/hwcaps.m4 \
$(srcdir)/../config/mmap.m4 \
$(srcdir)/../config/no-executables.m4 \
$(srcdir)/../config/override.m4 \
@@ -800,8 +802,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
else true; fi
$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
-./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h
+./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h \
+ $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/filedescriptor.c -o pic/$@; \
else true; fi
@@ -810,9 +812,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
else true; fi
$(COMPILE.c) $(srcdir)/filedescriptor.c $(OUTPUT_OPTION)
-
./filename_cmp.$(objext): $(srcdir)/filename_cmp.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+ $(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
@@ -1027,15 +1028,6 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
else true; fi
$(COMPILE.c) $(srcdir)/memchr.c $(OUTPUT_OPTION)
-./memrchr.$(objext): $(srcdir)/memrchr.c $(INCDIR)/ansidecl.h
- if [ x"$(PICFLAG)" != x ]; then \
- $(COMPILE.c) $(PICFLAG) $(srcdir)/memrchr.c -o pic/$@; \
- else true; fi
- if [ x"$(NOASANFLAG)" != x ]; then \
- $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/memrchr.c -o noasan/$@; \
- else true; fi
- $(COMPILE.c) $(srcdir)/memrchr.c $(OUTPUT_OPTION)
-
./memcmp.$(objext): $(srcdir)/memcmp.c $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/memcmp.c -o pic/$@; \
@@ -1081,6 +1073,15 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
else true; fi
$(COMPILE.c) $(srcdir)/mempcpy.c $(OUTPUT_OPTION)
+./memrchr.$(objext): $(srcdir)/memrchr.c $(INCDIR)/ansidecl.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memrchr.c -o pic/$@; \
+ else true; fi
+ if [ x"$(NOASANFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/memrchr.c -o noasan/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memrchr.c $(OUTPUT_OPTION)
+
./memset.$(objext): $(srcdir)/memset.c $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/memset.c -o pic/$@; \
@@ -1179,7 +1180,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
$(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)
./pex-unix.$(objext): $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+ $(INCDIR)/environ.h $(INCDIR)/libiberty.h \
+ $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
else true; fi
@@ -1285,7 +1287,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
else true; fi
$(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
-./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
+./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/environ.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
else true; fi
@@ -1736,7 +1739,7 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
$(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
./xmalloc.$(objext): $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h
+ $(INCDIR)/environ.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
else true; fi
@@ -1794,3 +1797,4 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
$(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/xvasprintf.c -o noasan/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xvasprintf.c $(OUTPUT_OPTION)
+
diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4
index 49f621bf629..41285c5bf08 100644
--- a/libiberty/acinclude.m4
+++ b/libiberty/acinclude.m4
@@ -21,7 +21,7 @@ dnl a SEGV in some cases.
AC_DEFUN([libiberty_AC_FUNC_STRNCMP],
[AC_REQUIRE([GCC_AC_FUNC_MMAP])
AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
-[AC_TRY_RUN([
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
#include <stdlib.h>
@@ -84,8 +84,8 @@ main (void)
#endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
exit (0);
}
-], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no,
- ac_cv_func_strncmp_works=yes)
+]])], [ac_cv_func_strncmp_works=yes], [ac_cv_func_strncmp_works=no],
+ [ac_cv_func_strncmp_works=yes])
rm -f core core.* *.core])
if test $ac_cv_func_strncmp_works = no ; then
AC_LIBOBJ([strncmp])
@@ -95,11 +95,11 @@ fi
dnl See if errno must be declared even when <errno.h> is included.
AC_DEFUN([libiberty_AC_DECLARE_ERRNO],
[AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno,
-[AC_TRY_COMPILE(
-[#include <errno.h>],
-[int x = errno;],
-libiberty_cv_declare_errno=no,
-libiberty_cv_declare_errno=yes)])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <errno.h>]],
+[[int x = errno;]])],
+[libiberty_cv_declare_errno=no],
+[libiberty_cv_declare_errno=yes])])
if test $libiberty_cv_declare_errno = yes
then AC_DEFINE(NEED_DECLARATION_ERRNO, 1,
[Define if errno must be declared even when <errno.h> is included.])
@@ -110,7 +110,7 @@ dnl See whether we need a declaration for a function.
AC_DEFUN([libiberty_NEED_DECLARATION],
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
-[AC_TRY_COMPILE([
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_STRING_H
@@ -125,9 +125,10 @@ AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif],
-[char *(*pfn) = (char *(*)) $1],
-libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)])
+#endif]],
+[[char *(*pfn) = (char *(*)) $1]])],
+[libiberty_cv_decl_needed_$1=no],
+[libiberty_cv_decl_needed_$1=yes])])
AC_MSG_RESULT($libiberty_cv_decl_needed_$1)
if test $libiberty_cv_decl_needed_$1 = yes; then
AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
@@ -160,7 +161,7 @@ if test $ac_cv_os_cray = yes; then
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([#include <stdlib.h>
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
int
find_stack_direction (void)
@@ -180,10 +181,10 @@ int
main (void)
{
exit (find_stack_direction() < 0);
-}],
- ac_cv_c_stack_direction=1,
- ac_cv_c_stack_direction=-1,
- ac_cv_c_stack_direction=0)])
+}]])],
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
[Define if you know the direction of stack growth for your system;
otherwise it will be automatically deduced at run-time.
diff --git a/libiberty/config.in b/libiberty/config.in
index 3b8716511f0..931fcc80ade 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -568,15 +568,6 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
-
/* Define to the type of a signed integer type wide enough to hold a pointer,
if such a type exists, and if the system does not define it. */
#undef intptr_t
diff --git a/libiberty/configure b/libiberty/configure
index 379a3cfa9c3..228cfd4740a 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5112,129 +5112,6 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 03b835ce828..a56a1017f1a 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -210,8 +210,6 @@ fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
-AC_C_CONST
-AC_C_INLINE
AC_C_BIGENDIAN
dnl When we start using libtool:
@@ -329,30 +327,30 @@ AC_CHECK_TYPE([long long],
# Look for a 64-bit type.
AC_MSG_CHECKING([for a 64-bit type])
AC_CACHE_VAL(liberty_cv_uint64,
-[AC_TRY_COMPILE(
-[#ifdef HAVE_STDINT_H
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_STDINT_H
#include <stdint.h>
-#endif],
-[extern uint64_t foo;],
-liberty_cv_uint64=uint64_t,
-[AC_TRY_COMPILE(
-[#ifdef HAVE_LIMITS_H
+#endif]],
+[[extern uint64_t foo;]])],
+[liberty_cv_uint64=uint64_t],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
-#endif],
-[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];],
-liberty_cv_uint64="unsigned long",
-[AC_TRY_COMPILE(
-[#ifdef HAVE_LIMITS_H
+#endif]],
+[[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];]])],
+[liberty_cv_uint64="unsigned long"],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
-#endif],
-[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];],
-liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])])
+#endif]],
+[[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];]])],
+[liberty_cv_uint64="unsigned long long"], [liberty_cv_uint64=none])])])])
AC_MSG_RESULT($liberty_cv_uint64)
if test "$liberty_cv_uint64" != none; then
AC_DEFINE_UNQUOTED(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64,
@@ -701,7 +699,7 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
- AC_ISC_POSIX
+ AC_SEARCH_LIBS([strerror],[cposix])
AC_REPLACE_FUNCS($funcs)
libiberty_AC_FUNC_C_ALLOCA
AC_FUNC_FORK
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 7c7da1ba296..16a9d3ae4ac 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -101,7 +101,7 @@ is respectively less than, matching, or greater than the array member.
@end deftypefn
-@c argv.c:138
+@c argv.c:129
@deftypefn Extension char** buildargv (char *@var{sp})
Given a pointer to a string, parse the string extracting fields
@@ -165,7 +165,7 @@ not recommended.
@end deftypefn
-@c make-temp-file.c:95
+@c make-temp-file.c:108
@deftypefn Replacement const char* choose_tmpdir ()
Returns a pointer to a directory path suitable for creating temporary
@@ -192,7 +192,7 @@ Concatenate zero or more of strings and return the result in freshly
@end deftypefn
-@c argv.c:495
+@c argv.c:474
@deftypefn Extension int countargv (char * const *@var{argv})
Return the number of elements in @var{argv}.
@@ -257,7 +257,18 @@ symbolic name or message.
@end deftypefn
-@c argv.c:352
+@c argv.c:497
+@deftypefn Extension {char *} expandargstr @
+ (const char *@var{progname}, const char *@var{val})
+
+Expand @var{val} as a response file via @code{expandargv} if it begins
+with @samp{@@}, using @var{progname} as @code{argv[0]}, and return the
+expanded option list as a shell-quoted string. Returns a newly
+allocated string.
+
+@end deftypefn
+
+@c argv.c:337
@deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
The @var{argcp} and @code{argvp} arguments are pointers to the usual
@@ -690,6 +701,19 @@ and a path ending in @code{/} returns the empty string after it.
@end deftypefn
+@c ldirname.c:23
+@deftypefn Replacement {char*} ldirname (const char *@var{name})
+
+Given a pointer to a string containing a typical pathname
+(@samp{/usr/src/cmd/ls/ls.c} for example), returns a string containing the
+passed string up to, but not including, the final directory separator.
+
+If the given pathname doesn't contain a directory separator then this function
+returns the empty string; this includes an empty given pathname. @code{NULL}
+is returned on memory allocation error.
+
+@end deftypefn
+
@c lrealpath.c:25
@deftypefn Replacement {const char*} lrealpath (const char *@var{name})
@@ -726,7 +750,7 @@ relative prefix can be found, return @code{NULL}.
@end deftypefn
-@c make-temp-file.c:173
+@c make-temp-file.c:185
@deftypefn Replacement char* make_temp_file (const char *@var{suffix})
Return a temporary file name (as a string) or @code{NULL} if unable to
@@ -749,20 +773,6 @@ returned.
@end deftypefn
-@c memrchr.c:3
-@deftypefn Supplemental void* memrchr (const void *@var{s}, int @var{c}, @
- size_t @var{n})
-
-This function searches memory for the character @var{c} in reverse order,
-starting at @code{*@var{s}+@var{n}-1} . The search only ends with
-the first occurrence of @var{c}, or when the start us reached; in particular,
-a null character does not terminate the search. If the character @var{c} is
-found within @var{length} characters of @code{*@var{s}}, a pointer
-to the character is returned. If @var{c} is not found, then @code{NULL} is
-returned.
-
-@end deftypefn
-
@c memcmp.c:6
@deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, @
size_t @var{count})
@@ -812,6 +822,20 @@ Copies @var{length} bytes from memory region @var{in} to region
@end deftypefn
+@c memrchr.c:3
+@deftypefn Supplemental void* memrchr (const void *@var{s}, int @var{c}, @
+ size_t @var{n})
+
+This function searches memory for the character @var{c} in reverse order,
+starting at @code{*@var{s}+@var{n}-1} . The search only ends with
+the first occurrence of @var{c}, or when the start us reached; in particular,
+a null character does not terminate the search. If the character @var{c} is
+found within @var{length} characters of @code{*@var{s}}, a pointer
+to the character is returned. If @var{c} is not found, then @code{NULL} is
+returned.
+
+@end deftypefn
+
@c memset.c:6
@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
size_t @var{count})
@@ -1761,7 +1785,7 @@ that the converted value is unsigned.
@c strtoll.c:33
@deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
char **@var{endptr}, int @var{base})
-@deftypefnx Supplemental {unsigned long long int} strtoull (@
+@deftypefnx Supplemental {unsigned long long int} strtoul (@
const char *@var{string}, char **@var{endptr}, int @var{base})
The @code{strtoll} function converts the string in @var{string} to a
@@ -1948,12 +1972,12 @@ does the return value. The third argument is unused in @libib{}.
@end deftypefn
-@c argv.c:289
+@c argv.c:287
@deftypefn Extension int writeargv (char * const *@var{argv}, FILE *@var{file})
Write each member of ARGV, handling all necessary quoting, to the file
-named by FILE, separated by whitespace. Return 0 on success, non-zero
-if an error occurred while writing to FILE.
+associated with FILE, separated by whitespace. Return 0 on success,
+non-zero if an error occurred while writing to FILE.
@end deftypefn
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index c6dfe697497..aaa9cbf3a06 100644
--- a/libiberty/simple-object-mach-o.c
+++ b/libiberty/simple-object-mach-o.c
@@ -78,6 +78,7 @@ struct mach_o_header_64
/* For filetype field in header. */
#define MACH_O_MH_OBJECT 0x01
+#define MACH_O_MH_DYLIB 0x06
/* A Mach-O file is a list of load commands. This is the header of a
load command. */
@@ -312,9 +313,9 @@ simple_object_mach_o_match (
b = &buf[0];
filetype = (*fetch_32) (b + offsetof (struct mach_o_header_32, filetype));
- if (filetype != MACH_O_MH_OBJECT)
+ if (!(filetype == MACH_O_MH_OBJECT || filetype == MACH_O_MH_DYLIB))
{
- *errmsg = "Mach-O file is not object file";
+ *errmsg = "Mach-O file is neither object file nor dylib";
*err = 0;
return NULL;
}
More information about the Binutils-cvs
mailing list