+2012-08-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/14481
+ * Makefile.am (BFDTEST1_PROG): New.
+ (TEST_PROGS): Likewise.
+ (bfdtest1_DEPENDENCIES): Likewise.
+ (noinst_PROGRAMS): Add $(TEST_PROGS).
+ * Makefile.in: Regenerated.
+
+ * bfdtest1.c: New file.
+
2012-08-13 Ian Bolton <ian.bolton@arm.com>
Laurent Desnogues <laurent.desnogues@arm.com>
Jim MacArthur <jim.macarthur@arm.com>
bin_SCRIPTS = @BUILD_INSTALL_MISC@
EXTRA_SCRIPTS = embedspu
+## Test programs.
+BFDTEST1_PROG = bfdtest1
+
+TEST_PROGS = $(BFDTEST1_PROG)
+
## We need a special rule to install the programs which are built with
## -new, and to rename cxxfilt to c++filt.
RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
-noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@
+noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) @BUILD_MISC@
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
+bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
@BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
@BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
$(am__EXEEXT_14) @BUILD_DLLWRAP@
-noinst_PROGRAMS = $(am__EXEEXT_18) @BUILD_MISC@
+noinst_PROGRAMS = $(am__EXEEXT_18) $(am__EXEEXT_20) @BUILD_MISC@
EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \
coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \
$(am__EXEEXT_4) $(am__EXEEXT_5)
am__EXEEXT_16 = strip-new$(EXEEXT)
am__EXEEXT_17 = cxxfilt$(EXEEXT)
am__EXEEXT_18 = $(am__EXEEXT_15) $(am__EXEEXT_16) $(am__EXEEXT_17)
+am__EXEEXT_19 = bfdtest1$(EXEEXT)
+am__EXEEXT_20 = $(am__EXEEXT_19)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT)
am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1)
not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \
binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1)
ar_OBJECTS = $(am_ar_OBJECTS)
+bfdtest1_SOURCES = bfdtest1.c
+bfdtest1_OBJECTS = bfdtest1.$(OBJEXT)
+bfdtest1_LDADD = $(LDADD)
am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \
$(am__objects_1)
coffdump_OBJECTS = $(am_coffdump_OBJECTS)
LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(EXTRA_ar_SOURCES) \
- $(coffdump_SOURCES) $(cxxfilt_SOURCES) $(dlltool_SOURCES) \
- $(dllwrap_SOURCES) $(elfedit_SOURCES) $(nlmconv_SOURCES) \
- $(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \
- $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \
- $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \
- $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
- $(windres_SOURCES)
+ bfdtest1.c $(coffdump_SOURCES) $(cxxfilt_SOURCES) \
+ $(dlltool_SOURCES) $(dllwrap_SOURCES) $(elfedit_SOURCES) \
+ $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \
+ $(objdump_SOURCES) $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) \
+ $(readelf_SOURCES) $(size_SOURCES) $(srconv_SOURCES) \
+ $(strings_SOURCES) $(strip_new_SOURCES) $(sysdump_SOURCES) \
+ $(windmc_SOURCES) $(windres_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
bin_SCRIPTS = @BUILD_INSTALL_MISC@
EXTRA_SCRIPTS = embedspu
+BFDTEST1_PROG = bfdtest1
+TEST_PROGS = $(BFDTEST1_PROG)
RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
# Stuff that goes in tooldir/ if appropriate.
readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
+bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
size_SOURCES = size.c $(BULIBS)
objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS)
ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES)
@rm -f ar$(EXEEXT)
$(LINK) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
+bfdtest1$(EXEEXT): $(bfdtest1_OBJECTS) $(bfdtest1_DEPENDENCIES)
+ @rm -f bfdtest1$(EXEEXT)
+ $(LINK) $(bfdtest1_OBJECTS) $(bfdtest1_LDADD) $(LIBS)
coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES)
@rm -f coffdump$(EXEEXT)
$(LINK) $(coffdump_OBJECTS) $(coffdump_LDADD) $(LIBS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arparse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arsup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bfdtest1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2c.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binemul.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bucomm.Po@am__quote@
--- /dev/null
+/* A program to test BFD.
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This file is part of the GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+static void
+die (const char *s)
+{
+ printf ("oops: %s\n", s);
+ exit (1);
+}
+
+int
+main (int argc, char **argv)
+{
+ bfd *archive;
+ bfd *last, *next;
+
+ if (argc != 2)
+ die ("bad usage");
+
+ archive = bfd_openr (argv[1], NULL);
+
+ if (!bfd_check_format (archive, bfd_archive))
+ {
+ bfd_close (archive);
+ die ("bfd_check_format");
+ }
+
+ for (last = bfd_openr_next_archived_file (archive, NULL);
+ last;
+ last = next)
+ {
+ next = bfd_openr_next_archived_file (archive, last);
+ bfd_close (last);
+ }
+
+ for (last = bfd_openr_next_archived_file (archive, NULL);
+ last;
+ last = next)
+ {
+ next = bfd_openr_next_archived_file (archive, last);
+ bfd_close (last);
+ }
+
+ if (!bfd_close (archive))
+ die ("bfd_close");
+
+ return 0;
+}
+2012-08-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/14481
+ * ar.exp (bfdtest1): New.
+ (long_filenames): Run bfdtest1.
+ (thin_archive): Likewise.
+ (thin_archive_with_nested): Likewise.
+
2012-08-13 Ian Bolton <ian.bolton@arm.com>
Laurent Desnogues <laurent.desnogues@arm.com>
Jim MacArthur <jim.macarthur@arm.com>
}
}
+set bfdtest1 [findfile $base_dir/bfdtest1]
+
# send_user "Version [binutil_version $AR]"
# Test long file name support
proc long_filenames { } {
global AR
global host_triplet
+ global bfdtest1
set testname "ar long file names"
return
}
+ verbose -log "$bfdtest1 $dest"
+ set exec_output [binutils_run $bfdtest1 "$dest"]
+ if ![string match "" $exec_output] {
+ verbose -log $exec_output
+ fail "$testname (bfdtest1)"
+ return
+ }
+
if [is_remote host] {
remote_upload host $n1 tmpdir/$n1
remote_upload host $n2 tmpdir/$n2
global NM
global srcdir
global subdir
+ global bfdtest1
set testname "ar thin archive"
return
}
+ verbose -log "$bfdtest1 $archive"
+ set exec_output [binutils_run $bfdtest1 "$archive"]
+ if ![string match "" $exec_output] {
+ verbose -log $exec_output
+ fail "$testname (bfdtest1)"
+ return
+ }
+
set got [binutils_run $NM "--print-armap $archive"]
if { ![string match "*text_symbol in *bintest.o*" $got] \
|| ![string match "*data_symbol in *bintest.o*" $got] \
global NM
global srcdir
global subdir
+ global bfdtest1
set testname "ar thin archive with nested archive"
return
}
+ verbose -log "$bfdtest1 $archive"
+ set exec_output [binutils_run $bfdtest1 "$archive"]
+ if ![string match "" $exec_output] {
+ verbose -log $exec_output
+ fail "$testname (bfdtest1)"
+ return
+ }
+
set got [binutils_run $NM "--print-armap $archive"]
if { ![string match "*text_symbol in *bintest.o*" $got] \
|| ![string match "*data_symbol in *bintest.o*" $got] \