diff options
229 files changed, 8151 insertions, 8435 deletions
diff --git a/.gear-rules b/.gear-rules index 8454aa6b..1d823f09 100644 --- a/.gear-rules +++ b/.gear-rules @@ -1 +1,2 @@ +copy: *.patch tar.bz2: elfutils diff --git a/elfutils-rh-portability.patch b/elfutils-rh-portability.patch new file mode 100644 index 00000000..76a01cef --- /dev/null +++ b/elfutils-rh-portability.patch @@ -0,0 +1,15 @@ +--- elfutils/src/findtextrel.c ++++ elfutils/src/findtextrel.c +@@ -476,7 +476,11 @@ ptrcompare (const void *p1, const void * + + + static void +-check_rel (size_t nsegments, struct segments segments[nsegments], ++check_rel (size_t nsegments, struct segments segments[ ++#if __GNUC__ >= 4 ++ nsegments ++#endif ++ ], + GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, + const char *fname, bool more_than_one, void **knownsrcs) + { diff --git a/elfutils.spec b/elfutils.spec index ea42be65..c22ba694 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,11 +1,12 @@ Name: elfutils -Version: 0.97 +Version: 0.108 Release: alt1 Summary: A collection of utilities and DSOs to handle compiled objects License: OSL Group: Development/C -Source: elfutils-%version.tar.bz2 +Source: %name-%version.tar.bz2 +Patch: %name-rh-portability.patch Requires: libelf = %version-%release %define gpl 0 @@ -71,10 +72,10 @@ object file format, so you can see the different sections of an ELF file. %prep %setup -q +%patch -p1 +%__subst -p 's/ -Werror / /' tests/Makefile* %build -%{?_disable_static:export lt_cv_prog_cc_static_works=no} -%{?_enable_static:export lt_cv_prog_cc_static_works=yes} %__rm -rf %buildtarget mkdir %buildtarget pushd %buildtarget @@ -98,7 +99,9 @@ popd %if %gpl %doc fake-src/FULL %endif +%_bindir/eu-addr2line %_bindir/eu-elflint +%_bindir/eu-findtextrel %_bindir/eu-nm %_bindir/eu-readelf %_bindir/eu-size @@ -131,6 +134,9 @@ popd %_includedir/nlist.h %changelog +* Fri May 27 2005 Dmitry V. Levin <ldv@altlinux.org> 0.108-alt1 +- Updated to 0.108. + * Thu Nov 11 2004 Dmitry V. Levin <ldv@altlinux.org> 0.97-alt1 - Built for ALT Linux. diff --git a/elfutils/ChangeLog b/elfutils/ChangeLog index c29d18ad..1e83f334 100644 --- a/elfutils/ChangeLog +++ b/elfutils/ChangeLog @@ -1,3 +1,19 @@ +2005-02-22 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (all_SUBDIRS): Don't add doc subdir for now. + * configure.ac: Don't use doc subdir for now. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * configure.ac: Remove AM_GNU_GETTEXT use. Use only AM_PO_SUBDIRS. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * configure.ac (AM_INIT_AUTOMAKE): Removed dist-bzip2. + + * Makefile.am (EXTRA_DIST): Remove splint.rc. + * splint.rc: Removed. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * configure.ac: Make compile with gcc 4.0. diff --git a/elfutils/Makefile.am b/elfutils/Makefile.am index 069b07f3..1637d3ab 100644 --- a/elfutils/Makefile.am +++ b/elfutils/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to create Makefile.in ## Configure input file for elfutils. ## -## Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 1996-2002, 2003, 2004, 2005 Red Hat, Inc. ## ## 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 @@ -19,10 +19,11 @@ ACLOCAL_AMFLAGS = -I m4 mini_SUBDIRS = config m4 lib libelf libelf-po -all_SUBDIRS = doc libebl libdw libcpu libasm src po tests +# Add doc back when we have some real content. +all_SUBDIRS = libebl libdw libcpu libasm src po tests SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS) -EXTRA_DIST = splint.rc elfutils.spec GPG-KEY NOTES COPYING.GPL +EXTRA_DIST = elfutils.spec GPG-KEY NOTES COPYING.GPL distcheck-hook: chmod -R u+w $(distdir) diff --git a/elfutils/Makefile.in b/elfutils/Makefile.in index c00bd846..d48b4c33 100644 --- a/elfutils/Makefile.in +++ b/elfutils/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -42,8 +42,6 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -70,7 +68,7 @@ am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print @@ -85,7 +83,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -94,25 +91,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -130,7 +121,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -180,9 +170,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ACLOCAL_AMFLAGS = -I m4 mini_SUBDIRS = config m4 lib libelf libelf-po -all_SUBDIRS = doc libebl libdw libcpu libasm src po tests +# Add doc back when we have some real content. +all_SUBDIRS = libebl libdw libcpu libasm src po tests SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS) -EXTRA_DIST = splint.rc elfutils.spec GPG-KEY NOTES COPYING.GPL +EXTRA_DIST = elfutils.spec GPG-KEY NOTES COPYING.GPL all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -248,7 +239,13 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -260,7 +257,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -268,7 +265,13 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -289,7 +292,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -420,6 +423,7 @@ distdir: $(DISTFILES) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) @@ -439,7 +443,6 @@ dist-zip: distdir dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then diff --git a/elfutils/NEWS b/elfutils/NEWS index 29bee356..dfc32569 100644 --- a/elfutils/NEWS +++ b/elfutils/NEWS @@ -1,3 +1,78 @@ +Version 0.108: + +strip: fix bug introduced in last change + +libdw: records returned by dwarf_getsrclines are now sorted by address + +Version 0.107: + +readelf: improve DWARF output format + +strip: support Linux kernel modules + +Version 0.106: + +libdw: Updated dwarf.h from DWARF3 spec +libdw: add new funtions dwarf_func_entrypc, dwarf_func_file, dwarf_func_line, +dwarf_func_col, dwarf_getsrc_file + +Version 0.105: + +addr2line: New program + +libdw: add new functions: dwarf_addrdie, dwarf_macro_*, dwarf_getfuncs, +dwarf_func_*. + +findtextrel: use dwarf_addrdie + +Version 0.104: + +findtextrel: New program. + +Version 0.103: + +libdw: Fix using libdw.h with gcc < 4 and C++ code. Compiler bug. + +Version 0.102: + +More Makefile and spec file cleanups. + +Version 0.101: + +Remove most gettext autoconf handling. + +Add more warnings + +Fix resulting problems. One actual bug found and fixed this way + +Version 0.100: + +libebl: Fix x86-64 relocations. + +Add -Wunused -Wextra warnings. + +Some cleanups resulting from those additional warnings. + +Lots of Makefile cleanup. + +Version 0.99: + +libelf: add gelf_checksum prototype to <libelf.h> + +libelf: fix elf*_checksum handling of NOBITS sections + +Finish mudflap support. + +Fix three bugs found by mudflap. + +ld: add as_needed support + +Version 0.98: + +readelf: in section to segment mapping, indicate read-only sections. + +elflint: more relaxation for GNU ld + Version 0.97: Fix compiling with gcc 4.0. diff --git a/elfutils/TODO b/elfutils/TODO index e2378ab8..bf4a0333 100644 --- a/elfutils/TODO +++ b/elfutils/TODO @@ -124,6 +124,10 @@ Time-stamp: <2003-08-07 12:52:49 drepper> no extended section index table for SHT_DYNSYM +** relax + + prelink generated files + * mcs diff --git a/elfutils/aclocal.m4 b/elfutils/aclocal.m4 index 3d3e8c7f..631562f0 100644 --- a/elfutils/aclocal.m4 +++ b/elfutils/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.2 -*- Autoconf -*- +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,23 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- @@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.2])]) - -# AM_AUX_DIR_EXPAND - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + [AM_AUTOMAKE_VERSION([1.9.5])]) -# 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 2, or (at your option) -# any later version. +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to @@ -106,26 +83,16 @@ AC_PREREQ([2.50])dnl am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. - -# 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 2, 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. +# AM_CONDITIONAL -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 6 +# serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -149,26 +116,15 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# serial 7 -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -177,7 +133,6 @@ fi])]) # CC etc. in the Makefile, will ask for an AC_PROG_CC use... - # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. @@ -317,27 +272,16 @@ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Generate code to set up dependency tracking. -*- Autoconf -*- -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -#serial 2 +#serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -396,30 +340,19 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. +# Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# serial 12 -# serial 11 +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) @@ -521,51 +454,27 @@ for _am_header in $config_headers :; do done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 1 +# serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. @@ -580,26 +489,14 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) - -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 4 +# serial 5 # AM_PROG_LEX # ----------- @@ -613,26 +510,15 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) -# Check to see how 'make' treats includes. -*- Autoconf -*- +# Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # AM_MAKE_INCLUDE() # ----------------- @@ -676,27 +562,16 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -# 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 2, or (at your option) -# any later version. +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -722,27 +597,16 @@ else fi ]) +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). @@ -796,26 +660,15 @@ else fi AC_SUBST([mkdir_p])]) -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# 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 2, 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. +# Helper functions for option handling. -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -840,28 +693,16 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# -# Check to make sure that the build environment is sane. -# - -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# 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 2, or (at your option) -# any later version. +# Check to make sure that the build environment is sane. -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_SANITY_CHECK # --------------- @@ -904,25 +745,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# AM_PROG_INSTALL_STRIP +# --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip @@ -945,25 +775,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004 Free Software Foundation, Inc. - -# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- @@ -1052,8 +870,4 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gettext.m4]) -m4_include([m4/iconv.m4]) -m4_include([m4/lib-ld.m4]) -m4_include([m4/lib-link.m4]) -m4_include([m4/lib-prefix.m4]) m4_include([m4/progtest.m4]) diff --git a/elfutils/config.h.in b/elfutils/config.h.in index ce973f3c..7afe12c6 100644 --- a/elfutils/config.h.in +++ b/elfutils/config.h.in @@ -1,19 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#undef HAVE_DCGETTEXT - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - -/* Define if you have the iconv() function. */ -#undef HAVE_ICONV - /* Directory to place translation files in. */ #undef LOCALEDIR diff --git a/elfutils/config/ChangeLog b/elfutils/config/ChangeLog index 783365d4..79a78e99 100644 --- a/elfutils/config/ChangeLog +++ b/elfutils/config/ChangeLog @@ -1,3 +1,37 @@ +2005-04-01 Ulrich Drepper <drepper@redhat.com> + + * elfutils.spec.in: Distribute eu-addr2line. + +2005-03-17 Ulrich Drepper <drepper@redhat.com> + + * elfutils.spec.in: Distribute libdw.{a,so,h}. + +2005-02-22 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Ignore result of cvs run. + + * elfutils.spec.in: Simplify build process by not using a subdir. + This means we can use %configure. + +2005-02-18 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Automatically added changelog from NEWS file on dist. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * elfutils.spec.in: Make sure RPM_OPT_FLAGS is used. During + %build, really do build the binaries. + Remove --enable-shared configure parameters. + +2005-02-07 Ulrich Drepper <drepper@redhat.com> + + * elfutils.spec.in (BuildRequires): Up gcc requirement to 3.4. + +2004-11-23 Ulrich Drepper <drepper@redhat.com> + + * elfutils.spec.in: Some more changes for the RPM with the fake + binaries. + 2004-01-29 Ulrich Drepper <drepper@redhat.com> * elfutils.spec.in: Update BuildRequires. diff --git a/elfutils/config/Makefile.am b/elfutils/config/Makefile.am index 4f327520..45a78deb 100644 --- a/elfutils/config/Makefile.am +++ b/elfutils/config/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*- ## Configure input file for elfutils. ## -## Copyright (C) 2004 Red Hat, Inc. +## Copyright (C) 2004, 2005 Red Hat, Inc. ## ## 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 @@ -17,3 +17,22 @@ ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## EXTRA_DIST = elfutils.spec.in + +$(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS + @tmpname=$$(mktemp $${TMPDIR:-/tmp}/elfutils.XXXXXX); \ + date +'* %a %b %e %Y' | tr '[\n]' '[ ]' > $$tmpname; \ + getent passwd "$$(whoami)" | \ + awk 'BEGIN {FS=":"} { printf $$5; exit 0}' >> $$tmpname; \ + echo -n " <$(whoami)@redhat.com> " >> $$tmpname; \ + sed 's/Version \(.*\):$$/\1-1/;q' $(top_srcdir)/NEWS >> $$tmpname; \ + sed '2,/^Version /p;d' $(top_srcdir)/NEWS | \ + head -n -1 | \ + awk '{ if ($$0 == "") { if (line != "") { printf "- "; fflush(); system("echo \"" line "\" | fold -w 70"); line=""; } } else { line=line $$0; }} END { if (line != "") { printf "- "; system("echo \"" line "\" | fold -w 70")}}' >> $$tmpname; \ + echo >> $$tmpname; \ + sed "/^%changelog/r $$tmpname" $@ > $@.new; \ + rm -f $$tmpname; \ + mv -f $@.new $@ + -@if [ -d $(srcdir)/CVS ]; then \ + cd $(srcdir); \ + cvs ci -m "Added changelog." $(@F); \ + fi diff --git a/elfutils/config/Makefile.in b/elfutils/config/Makefile.in index 7b069373..779c7b99 100644 --- a/elfutils/config/Makefile.in +++ b/elfutils/config/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -37,12 +37,10 @@ build_triplet = @build@ host_triplet = @host@ subdir = config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \ - config.guess config.rpath config.sub depcomp install-sh \ - missing mkinstalldirs + config.guess config.sub depcomp install-sh missing \ + mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -63,7 +61,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -72,25 +69,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -108,7 +99,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -307,6 +297,25 @@ uninstall-am: uninstall-info-am mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am + +$(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS + @tmpname=$$(mktemp $${TMPDIR:-/tmp}/elfutils.XXXXXX); \ + date +'* %a %b %e %Y' | tr '[\n]' '[ ]' > $$tmpname; \ + getent passwd "$$(whoami)" | \ + awk 'BEGIN {FS=":"} { printf $$5; exit 0}' >> $$tmpname; \ + echo -n " <$(whoami)@redhat.com> " >> $$tmpname; \ + sed 's/Version \(.*\):$$/\1-1/;q' $(top_srcdir)/NEWS >> $$tmpname; \ + sed '2,/^Version /p;d' $(top_srcdir)/NEWS | \ + head -n -1 | \ + awk '{ if ($$0 == "") { if (line != "") { printf "- "; fflush(); system("echo \"" line "\" | fold -w 70"); line=""; } } else { line=line $$0; }} END { if (line != "") { printf "- "; system("echo \"" line "\" | fold -w 70")}}' >> $$tmpname; \ + echo >> $$tmpname; \ + sed "/^%changelog/r $$tmpname" $@ > $@.new; \ + rm -f $$tmpname; \ + mv -f $@.new $@ + -@if [ -d $(srcdir)/CVS ]; then \ + cd $(srcdir); \ + cvs ci -m "Added changelog." $(@F); \ + fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/elfutils/config/config.guess b/elfutils/config/config.guess index f1657bbc..dd1688b7 100755..100644 --- a/elfutils/config/config.guess +++ b/elfutils/config/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-09-03' +timestamp='2004-06-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -98,30 +98,32 @@ trap 'exit 1' 1 2 15 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -# This shell variable is my proudest work .. or something. --bje +# Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; -(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) - || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; -dummy=$tmpdir/dummy ; -files="$dummy.c $dummy.o $dummy.rel $dummy" ; -trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $files ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; -unset files' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -178,21 +180,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -223,71 +245,70 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - eval $set_cc_for_build - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi - rm -f $dummy.s $dummy && rmdir $tmpdir - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -310,6 +331,9 @@ EOF *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -327,6 +351,9 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -399,6 +426,9 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -437,10 +467,9 @@ EOF exit (-1); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ + $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) @@ -449,7 +478,7 @@ EOF Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS) + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -524,8 +553,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -623,11 +651,21 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy && rmdir $tmpdir + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -661,8 +699,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -720,21 +757,26 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -756,8 +798,10 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + # GNU/KFreeBSD systems have a "k" prefix to indicate we are using + # FreeBSD's kernel, but not the complete OS. + case ${LIBC} in gnu) kernel_only='k' ;; esac + echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -768,14 +812,17 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -787,17 +834,28 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -818,8 +876,26 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c && rmdir $tmpdir - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -855,6 +931,9 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -912,9 +991,11 @@ EOF LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -932,6 +1013,26 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -966,9 +1067,6 @@ EOF echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -995,9 +1093,12 @@ EOF mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; - M68*:*:R3V[567]*:*) + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1014,9 +1115,6 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1098,7 +1196,11 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1111,7 +1213,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1134,11 +1236,6 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1157,11 +1254,11 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac @@ -1283,8 +1380,7 @@ main () } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 -rm -f $dummy.c $dummy && rmdir $tmpdir +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. diff --git a/elfutils/config/config.rpath b/elfutils/config/config.rpath deleted file mode 100755 index 5ead7586..00000000 --- a/elfutils/config/config.rpath +++ /dev/null @@ -1,513 +0,0 @@ -#! /bin/sh -# Output a system dependent set of variables, describing how to set the -# run time search path of shared libraries in an executable. -# -# Copyright 1996-2002 Free Software Foundation, Inc. -# Taken from GNU libtool, 2001 -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -shlibext= - -host="$1" -host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -wl= -if test "$GCC" = yes; then - wl='-Wl,' -else - case "$host_os" in - aix3* | aix4* | aix5*) - wl='-Wl,' - ;; - hpux9* | hpux10* | hpux11*) - wl='-Wl,' - ;; - irix5* | irix6*) - wl='-Wl,' - ;; - linux*) - echo '__INTEL_COMPILER' > conftest.$ac_ext - if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null - then - : - else - # Intel icc - wl='-Qoption,ld,' - fi - ;; - osf3* | osf4* | osf5*) - wl='-Wl,' - ;; - solaris*) - wl='-Wl,' - ;; - sunos4*) - wl='-Qoption ld ' - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - if test "x$host_vendor" = xsni; then - wl='-LD' - else - wl='-Wl,' - fi - ;; - esac -fi - -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no - -case "$host_os" in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - case "$host_os" in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - ld_shlibs=no - ;; - amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - sunos4*) - hardcode_direct=yes - ;; - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - fi -else - case "$host_os" in - aix3*) - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - else - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - fi - hardcode_direct=yes - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - fi - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - fi - fi - ;; - amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - libext=lib - ;; - darwin* | rhapsody*) - hardcode_direct=yes - ;; - freebsd1*) - ld_shlibs=no - ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) - hardcode_direct=yes - hardcode_minus_L=yes - ;; - freebsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - hpux9* | hpux10* | hpux11*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - ;; - irix5* | irix6*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - netbsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - newsos6) - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - openbsd*) - hardcode_direct=yes - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - osf3*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) - if test "$GCC" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - # Both cc and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - sco3.2v5*) - ;; - solaris*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - sunos4*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - ;; - sysv4) - if test "x$host_vendor" = xsno; then - hardcode_direct=yes # is this really true??? - else - hardcode_direct=no # Motorola manual says yes, but my tests say they lie - fi - ;; - sysv4.3*) - ;; - sysv5*) - hardcode_libdir_flag_spec= - ;; - uts4*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - dgux*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - sysv4*MP*) - if test -d /usr/nec; then - ld_shlibs=yes - fi - ;; - sysv4.2uw2*) - hardcode_direct=yes - hardcode_minus_L=no - ;; - sysv5uw7* | unixware7*) - ;; - *) - ld_shlibs=no - ;; - esac -fi - -# Check dynamic linker characteristics -libname_spec='lib$name' -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -case "$host_os" in - aix3*) - shlibext=so - ;; - aix4* | aix5*) - shlibext=so - ;; - amigaos*) - shlibext=ixlibrary - ;; - beos*) - shlibext=so - ;; - bsdi4*) - shlibext=so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - ;; - cygwin* | mingw* | pw32*) - case $GCC,$host_os in - yes,cygwin*) - shlibext=dll.a - ;; - yes,mingw*) - shlibext=dll - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - shlibext=dll - ;; - *) - shlibext=dll - ;; - esac - ;; - darwin* | rhapsody*) - shlibext=dylib - ;; - freebsd1*) - ;; - freebsd*) - shlibext=so - ;; - gnu*) - shlibext=so - ;; - hpux9* | hpux10* | hpux11*) - shlibext=sl - ;; - irix5* | irix6*) - shlibext=so - case "$host_os" in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in - *-32|*"-32 ") libsuff= shlibsuff= ;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; - *) libsuff= shlibsuff= ;; - esac - ;; - esac - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - ;; - linux-gnu*) - shlibext=so - ;; - netbsd*) - shlibext=so - ;; - newsos6) - shlibext=so - ;; - openbsd*) - shlibext=so - ;; - os2*) - libname_spec='$name' - shlibext=dll - ;; - osf3* | osf4* | osf5*) - shlibext=so - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - sco3.2v5*) - shlibext=so - ;; - solaris*) - shlibext=so - ;; - sunos4*) - shlibext=so - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - shlibext=so - case "$host_vendor" in - motorola) - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - uts4*) - shlibext=so - ;; - dgux*) - shlibext=so - ;; - sysv4*MP*) - if test -d /usr/nec; then - shlibext=so - fi - ;; -esac - -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` - -sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF - -# How to pass a linker flag through the compiler. -wl="$escaped_wl" - -# Static library suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally "so"). -shlibext="$shlibext" - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec" - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator="$hardcode_libdir_separator" - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct="$hardcode_direct" - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L="$hardcode_minus_L" - -# Compile-time system search path for libraries -sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec" - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec" - -EOF diff --git a/elfutils/config/config.sub b/elfutils/config/config.sub index 1dea9b79..ba331039 100755..100644 --- a/elfutils/config/config.sub +++ b/elfutils/config/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-09-05' +timestamp='2004-03-12' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,8 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -228,14 +229,15 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | clipper \ + | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -245,21 +247,24 @@ case $basic_machine in | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic80 | tron \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -294,7 +299,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -302,8 +307,8 @@ case $basic_machine in | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -315,21 +320,26 @@ case $basic_machine in | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39 | mipstx39el \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -353,6 +363,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -367,6 +380,12 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -426,12 +445,20 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -716,6 +743,10 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -727,6 +758,10 @@ case $basic_machine in basic_machine=or32-unknown os=-coff ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -758,18 +793,24 @@ case $basic_machine in pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2) + pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; + pentium4) + basic_machine=i786-pc + ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-*) + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pn) basic_machine=pn-gould ;; @@ -828,6 +869,10 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; sequent) basic_machine=i386-sequent ;; @@ -835,6 +880,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh64) + basic_machine=sh64-unknown + ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -901,10 +949,6 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; t3e) basic_machine=alphaev5-cray os=-unicos @@ -913,14 +957,18 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic4x | c4x*) - basic_machine=tic4x-unknown - os=-coff - ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -934,6 +982,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -977,10 +1029,6 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1027,13 +1075,13 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1106,18 +1154,20 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1129,8 +1179,10 @@ case $os in ;; esac ;; + -nto-qnx*) + ;; -nto*) - os=-nto-qnx + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ @@ -1139,6 +1191,9 @@ case $os in -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1151,6 +1206,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1172,6 +1230,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1194,6 +1255,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1224,6 +1288,12 @@ case $os in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; -none) ;; *) @@ -1255,6 +1325,9 @@ case $basic_machine in arm*-semi) os=-aout ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1433,9 +1506,15 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; diff --git a/elfutils/config/elfutils.spec.in b/elfutils/config/elfutils.spec.in index f5377b0e..8dff0efe 100644 --- a/elfutils/config/elfutils.spec.in +++ b/elfutils/config/elfutils.spec.in @@ -1,24 +1,31 @@ -%define gpl 0 +# -*- rpm-spec-*- +%define fake 0 Summary: A collection of utilities and DSOs to handle compiled objects. Name: elfutils Version: @PACKAGE_VERSION@ Release: 1 -Copyright: OSL +%if %{fake} +License: GPL +%else +License: OSL +%endif Group: Development/Tools #URL: file://home/devel/drepper/ Source: elfutils-%{version}.tar.gz Obsoletes: libelf libelf-devel Requires: elfutils-libelf = %{version}-%{release} -%if %{gpl} +%if %{fake} Requires: binutils >= 2.14.90.0.4-26.2 %endif +Requires: glibc >= 2.3.1-2 # ExcludeArch: xxx BuildRoot: %{_tmppath}/%{name}-root -BuildRequires: gcc >= 3.2 +BuildRequires: gcc >= 3.4 BuildRequires: bison >= 1.875 BuildRequires: flex >= 2.5.4a +BuildRequires: bzip2 %define _gnu %{nil} %define _programprefix eu- @@ -35,7 +42,11 @@ handling. %package devel Summary: Development libraries to handle compiled objects. Group: Development/Tools -Copyright: OSL +%if %{fake} +License: GPL +%else +License: OSL +%endif Requires: elfutils = %{version}-%{release} Requires: elfutils-libelf-devel = %{version}-%{release} @@ -49,8 +60,8 @@ assembler interface. %package libelf Summary: Library to read and write ELF files. Group: Development/Tools -%if %{gpl} -Copyright: GPL +%if %{fake} +License: GPL %endif %description libelf @@ -64,8 +75,8 @@ Summary: Development support for libelf Group: Development/Tools Requires: elfutils-libelf = %{version}-%{release} Conflicts: libelf-devel -%if %{gpl} -Copyright: GPL +%if %{fake} +License: GPL %endif %description libelf-devel @@ -78,47 +89,31 @@ different sections of an ELF file. %setup -q %build -mkdir build-%{_target_platform} -cd build-%{_target_platform} -../configure \ - --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ - --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ - --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ - --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ - --infodir=%{_infodir} --program-prefix=%{_programprefix} --enable-shared -cd .. +%configure --program-prefix=%{_programprefix} +make %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_prefix} -cd build-%{_target_platform} -#make check %makeinstall chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so* -%if !%{gpl} +%if !%{fake} chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so* %endif -cd .. - -%if !%{gpl} +%if !%{fake} # XXX Nuke unpackaged files { cd ${RPM_BUILD_ROOT} rm -f .%{_bindir}/eu-ld rm -f .%{_includedir}/elfutils/libasm.h - rm -f .%{_includedir}/elfutils/libdw.h rm -f .%{_libdir}/libasm-%{version}.so rm -f .%{_libdir}/libasm.a - rm -f .%{_libdir}/libdw.so - rm -f .%{_libdir}/libdw.a } %endif %check -cd build-%{_target_platform} make check %clean @@ -135,7 +130,7 @@ rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc README TODO -%if %{gpl} +%if %{fake} %doc fake-src/FULL %endif %{_bindir}/eu-elflint @@ -143,7 +138,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_bindir}/eu-readelf %{_bindir}/eu-size %{_bindir}/eu-strip -%if !%{gpl} +%{_bindir}/eu-findtextrel +%{_bindir}/eu-addr2line +%if !%{fake} #%{_bindir}/eu-ld #%{_libdir}/libasm-%{version}.so %{_libdir}/libdw-%{version}.so @@ -158,13 +155,14 @@ rm -rf ${RPM_BUILD_ROOT} %{_includedir}/dwarf.h %dir %{_includedir}/elfutils %{_includedir}/elfutils/elf-knowledge.h -%if !%{gpl} +%if !%{fake} %{_includedir}/elfutils/libebl.h +%{_includedir}/elfutils/libdw.h #%{_libdir}/libasm.a %{_libdir}/libebl.a -#%{_libdir}/libdw.a +%{_libdir}/libdw.a #%{_libdir}/libasm.so -#%{_libdir}/libdw.so +%{_libdir}/libdw.so %endif %files libelf @@ -181,6 +179,36 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.so %changelog +* Sun May 8 2005 Ulrich Drepper <@redhat.com> 0.108-1 +- strip: fix bug introduced in last change + +* Sun May 8 2005 Ulrich Drepper <@redhat.com> 0.107-1 +- readelf: improve DWARF output format +- strip: support Linux kernel modules + +* Fri Apr 29 2005 Ulrich Drepper <drepper@redhat.com> 0.107-1 +- readelf: improve DWARF output format + +* Mon Apr 4 2005 Ulrich Drepper <drepper@redhat.com> 0.106-1 +- libdw: Updated dwarf.h from DWARF3 speclibdw: add new funtions dwarf_f +unc_entrypc, dwarf_func_file, dwarf_func_line,dwarf_func_col, dwarf_ge +tsrc_file + +* Fri Apr 1 2005 Ulrich Drepper <drepper@redhat.com> 0.105-1 +- addr2line: New program +- libdw: add new functions: dwarf_addrdie, dwarf_macro_*, dwarf_getfuncs +,dwarf_func_*. +- findtextrel: use dwarf_addrdie + +* Mon Mar 28 2005 Ulrich Drepper <drepper@redhat.com> 0.104-1 +- findtextrel: New program. + +* Mon Mar 21 2005 Ulrich Drepper <drepper@redhat.com> 0.103-1 +- libdw: Fix using libdw.h with gcc < 4 and C++ code. Compiler bug. + +* Tue Feb 22 2005 Ulrich Drepper <drepper@redhat.com> 0.102-1 +- More Makefile and spec file cleanups. + * Fri Jan 16 2004 Jakub Jelinek <jakub@redhat.com> 0.94-1 - upgrade to 0.94 diff --git a/elfutils/configure b/elfutils/configure index 9b1f72f6..3ef36793 100755 --- a/elfutils/configure +++ b/elfutils/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Revision: 1.30 . +# From configure.ac Revision: 1.45 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for Red Hat elfutils 0.97. +# Generated by GNU Autoconf 2.59 for Red Hat elfutils 0.108. # # Report bugs to <http://bugzilla.redhat.com/bugzilla/>. # @@ -9,7 +9,7 @@ # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright (C) 1996-2003, 2004 Red Hat, Inc. +# Copyright (C) 1996-2003, 2004, 2005 Red Hat, Inc. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -272,12 +272,12 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Red Hat elfutils' PACKAGE_TARNAME='elfutils' -PACKAGE_VERSION='0.97' -PACKAGE_STRING='Red Hat elfutils 0.97' +PACKAGE_VERSION='0.108' +PACKAGE_STRING='Red Hat elfutils 0.108' PACKAGE_BUGREPORT='http://bugzilla.redhat.com/bugzilla/' ac_unique_file="libelf/libelf.h" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE USE_NLS LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -734,10 +734,6 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -746,7 +742,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Red Hat elfutils 0.97 to adapt to many kinds of systems. +\`configure' configures Red Hat elfutils 0.108 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -812,7 +808,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Red Hat elfutils 0.97:";; + short | recursive ) echo "Configuration of Red Hat elfutils 0.108:";; esac cat <<\_ACEOF @@ -822,20 +818,10 @@ Optional Features: --enable-tls enable use of thread local storage --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --disable-nls do not use Native Language Support --disable-largefile omit support for large files --disable-generic do not build generic linker --enable-mudflap build binaries with mudflap instrumentation -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir - --with-libintl-prefix=DIR search for libintl in DIR/include and DIR/lib - --without-libintl-prefix don't search for libintl in includedir and libdir - Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -843,7 +829,6 @@ Some influential environment variables: nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -944,14 +929,14 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Red Hat elfutils configure 0.97 +Red Hat elfutils configure 0.108 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright (C) 1996-2003, 2004 Red Hat, Inc. +Copyright (C) 1996-2003, 2004, 2005 Red Hat, Inc. _ACEOF exit 0 fi @@ -960,7 +945,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Red Hat elfutils $as_me 0.97, which was +It was created by Red Hat elfutils $as_me 0.108, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1610,7 +1595,7 @@ fi # Define the identity of the package. PACKAGE='elfutils' - VERSION='0.97' + VERSION='0.108' cat >>confdefs.h <<_ACEOF @@ -2937,1827 +2922,6 @@ else fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 -if test "${ac_cv_prog_gcc_traditional+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sgtty.h> -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <termio.h> -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - - - - - - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != ":"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT - -if test -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - rm -f messages.po - - # Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGMERGE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGMERGE" in - /*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; -esac -fi -MSGMERGE="$ac_cv_path_MSGMERGE" -if test "$MSGMERGE" != ":"; then - echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - - if test "$GMSGFMT" != ":"; then - if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && - (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 -echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 - GMSGFMT=":" - fi - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 - XGETTEXT=":" - fi - rm -f messages.po - fi - - ac_config_commands="$ac_config_commands default-1" - - - - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${acl_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$acl_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${acl_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - acl_cv_prog_gnu_ld=yes -else - acl_cv_prog_gnu_ld=no -fi -fi -echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 -with_gnu_ld=$acl_cv_prog_gnu_ld - - - - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 -if test "${acl_cv_rpath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" - sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi - -fi; - LIBICONV= - LTLIBICONV= - INCICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "X$found_dir" = "X/usr/lib"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" - done - fi - - - - - - - - - - - - - - - - - - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. -if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval -else - USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 - - - - LIBINTL= - LTLIBINTL= - POSUB= - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - - - - - - echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 -echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gnugettext1_libc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <libintl.h> -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; -int -main () -{ -bindtextdomain ("", ""); -return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gnugettext1_libc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gnugettext1_libc=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 - - if test "$gt_cv_func_gnugettext1_libc" != "yes"; then - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 -if test "${am_cv_func_iconv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <iconv.h> -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_func_iconv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <iconv.h> -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - -fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 - if test "$am_cv_func_iconv" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 -_ACEOF - - fi - if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libintl-prefix or --without-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then - withval="$with_libintl_prefix" - - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi - -fi; - LIBINTL= - LTLIBINTL= - INCINTL= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='intl ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "X$found_dir" = "X/usr/lib"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" - ;; - esac - done - fi - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" - done - fi - - echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 -echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <libintl.h> -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (); -int -main () -{ -bindtextdomain ("", ""); -return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gnugettext1_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gnugettext1_libintl=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <libintl.h> -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (); -int -main () -{ -bindtextdomain ("", ""); -return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - gt_cv_func_gnugettext1_libintl=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 - fi - - if test "$gt_cv_func_gnugettext1_libc" = "yes" \ - || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ - && test "$PACKAGE" != gettext; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - else - USE_NLS=no - fi - fi - - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - echo "$as_me:$LINENO: checking how to link with libintl" >&5 -echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBINTL" >&5 -echo "${ECHO_T}$LIBINTL" >&6 - - for element in $INCINTL; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - fi - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DCGETTEXT 1 -_ACEOF - - fi - - POSUB=po - fi - - - - INTLLIBS="$LIBINTL" - - - - - - if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -4879,6 +3043,7 @@ fi done test -n "$YACC" || YACC="yacc" + for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -5701,8 +3866,6 @@ fi - ac_config_files="$ac_config_files doc/Makefile" - ac_config_files="$ac_config_files lib/Makefile" @@ -5728,6 +3891,205 @@ fi ac_config_files="$ac_config_files tests/Makefile" +# Get the definitions necessary to create the Makefiles in the po +# subdirectories. This is a small subset of the gettext rules. +USE_NLS=yes + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT + +if test -n "$GMSGFMT"; then + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + rm -f messages.po + + # Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + /*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi + + ac_config_commands="$ac_config_commands default-1" + + + @@ -6122,7 +4484,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by Red Hat elfutils $as_me 0.97, which was +This file was extended by Red Hat elfutils $as_me 0.108, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6185,7 +4547,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Red Hat elfutils config.status 0.97 +Red Hat elfutils config.status 0.108 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -6306,7 +4668,6 @@ do "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "elfutils.spec" ) CONFIG_FILES="$CONFIG_FILES elfutils.spec:config/elfutils.spec.in" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "libelf/Makefile" ) CONFIG_FILES="$CONFIG_FILES libelf/Makefile" ;; "libelf-po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES libelf-po/Makefile.in" ;; @@ -6451,20 +4812,6 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t -s,@XGETTEXT@,$XGETTEXT,;t t -s,@MSGMERGE@,$MSGMERGE,;t t -s,@USE_NLS@,$USE_NLS,;t t -s,@LIBICONV@,$LIBICONV,;t t -s,@LTLIBICONV@,$LTLIBICONV,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@LIBINTL@,$LIBINTL,;t t -s,@LTLIBINTL@,$LTLIBINTL,;t t -s,@POSUB@,$POSUB,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@YACC@,$YACC,;t t @@ -6478,6 +4825,12 @@ s,@NATIVE_LD_FALSE@,$NATIVE_LD_FALSE,;t t s,@base_cpu@,$base_cpu,;t t s,@MUDFLAP_TRUE@,$MUDFLAP_TRUE,;t t s,@MUDFLAP_FALSE@,$MUDFLAP_FALSE,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/elfutils/configure.ac b/elfutils/configure.ac index e153737f..7315167b 100644 --- a/elfutils/configure.ac +++ b/elfutils/configure.ac @@ -1,7 +1,7 @@ -dnl Process this file with autoconf to produce a configure script. -*-m4-*- -dnl Configure input file for elfutils. +dnl Process this file with autoconf to produce a configure script. +dnl Configure input file for elfutils. -*-autoconf-*- dnl -dnl Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc. +dnl Copyright (C) 1996-2002, 2003, 2004, 2005 Red Hat, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -16,17 +16,17 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl -AC_INIT([Red Hat elfutils],[0.97],[http://bugzilla.redhat.com/bugzilla/], +AC_INIT([Red Hat elfutils],[0.108],[http://bugzilla.redhat.com/bugzilla/], [elfutils]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_FILES([config/Makefile]) -AC_COPYRIGHT([Copyright (C) 1996-2003, 2004 Red Hat, Inc.]) -AC_REVISION($Revision: 1.30 $) +AC_COPYRIGHT([Copyright (C) 1996-2003, 2004, 2005 Red Hat, Inc.]) +AC_REVISION($Revision: 1.45 $) AC_PREREQ(2.59) dnl Minimum Autoconf version required. -AM_INIT_AUTOMAKE([gnits 1.7 dist-bzip2]) +AM_INIT_AUTOMAKE([gnits 1.7]) AC_CONFIG_SRCDIR([libelf/libelf.h]) AC_CONFIG_FILES([Makefile]) @@ -50,9 +50,6 @@ dnl Add all the languages for which translations are available. ALL_LINGUAS= AC_PROG_CC -AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL -AM_GNU_GETTEXT([external]) AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX @@ -131,7 +128,8 @@ AM_CONDITIONAL(MUDFLAP, test "$use_mudflap" = yes) dnl The directories with content. dnl Documentation. -AC_CONFIG_FILES([doc/Makefile]) +dnl Commented out for now. +dnl AC_CONFIG_FILES([doc/Makefile]) dnl Support library. AC_CONFIG_FILES([lib/Makefile]) @@ -157,6 +155,11 @@ AC_CONFIG_FILES([src/Makefile po/Makefile.in]) dnl Test suite. AC_CONFIG_FILES([tests/Makefile]) +# Get the definitions necessary to create the Makefiles in the po +# subdirectories. This is a small subset of the gettext rules. +AC_SUBST(USE_NLS, yes) +AM_PO_SUBDIRS + dnl Test of the config.h file. We hide all kinds of configuration magic dnl in there. diff --git a/elfutils/doc/ChangeLog b/elfutils/doc/ChangeLog deleted file mode 100644 index c46ffcb6..00000000 --- a/elfutils/doc/ChangeLog +++ /dev/null @@ -1,3 +0,0 @@ -2003-08-11 Ulrich Drepper <drepper@redhat.com> - - * Moved to CVS archive. diff --git a/elfutils/doc/Makefile.am b/elfutils/doc/Makefile.am deleted file mode 100644 index b9f0e15f..00000000 --- a/elfutils/doc/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -## Process this file with automake to create Makefile.in -## Configure input file for elfutils. -## -## Copyright (C) 1996-2001, 2002 Red Hat, Inc. -## -## This program is Open Source software; you can redistribute it and/or -## modify it under the terms of the Open Software License version 1.0 as -## published by the Open Source Initiative. -## -## You should have received a copy of the Open Software License along -## with this program; if not, you may obtain a copy of the Open Software -## License version 1.0 from http://www.opensource.org/licenses/osl.php or -## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., -## 3001 King Ranch Road, Ukiah, CA 95482. */ -## -EXTRA_DIST = elfutils.sgml - -CLEANFILES = elfutils.dvi - -# We need only a few special rules to generate the various output formats -# from the SGML sources. -.PHONY: dvi pdf html -dvi: $(srcdir)elfutils.dvi -pdf: $(srcdir)elfutils.pdf - -$(srcdir)%.dvi: %.sgml - db2dvi $^ -$(srcdir)%.pdf: %.sgml - db2pdf $^ diff --git a/elfutils/doc/Makefile.in b/elfutils/doc/Makefile.in deleted file mode 100644 index cefcf9fd..00000000 --- a/elfutils/doc/Makefile.in +++ /dev/null @@ -1,319 +0,0 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = doc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATADIRNAME = @DATADIRNAME@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GMSGFMT = @GMSGFMT@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -MSGFMT = @MSGFMT@ -MSGMERGE = @MSGMERGE@ -MUDFLAP_FALSE = @MUDFLAP_FALSE@ -MUDFLAP_TRUE = @MUDFLAP_TRUE@ -NATIVE_LD_FALSE = @NATIVE_LD_FALSE@ -NATIVE_LD_TRUE = @NATIVE_LD_TRUE@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -YACC = @YACC@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -base_cpu = @base_cpu@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -EXTRA_DIST = elfutils.sgml -CLEANFILES = elfutils.dvi -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits doc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - - -# We need only a few special rules to generate the various output formats -# from the SGML sources. -.PHONY: dvi pdf html -dvi: $(srcdir)elfutils.dvi -pdf: $(srcdir)elfutils.pdf - -$(srcdir)%.dvi: %.sgml - db2dvi $^ -$(srcdir)%.pdf: %.sgml - db2pdf $^ -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/elfutils/doc/elfutils.sgml b/elfutils/doc/elfutils.sgml deleted file mode 100644 index 7ef84a8d..00000000 --- a/elfutils/doc/elfutils.sgml +++ /dev/null @@ -1,412 +0,0 @@ -<!doctype book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[ -<!ENTITY package "<filename>new-bu</filename>"> -]> - -<book> - <title>New Binutils User's and Reference Manual</title> - - <chapter> - <title><filename>libelf</filename> <acronym>ABI</acronym></title> - - <simpara>The <acronym>ABI</acronym> of the - <filename>libelf</filename> implemented in the &package; package - is following that of Sun's implementation which in turn in derived - from the original SysVr4 implementation. There are some - extensions over Sun's versions, though, which makes it impossible - to replace this implementation with Sun's.</simpara> - - <beginpage> - - <refentry xreflabel="Elf_Data" id="ElfUData"> - <refnamediv> - <refname>Elf_Data</refname> - <refpurpose>Descriptor for Data Buffer</refpurpose> - </refnamediv> - - <refsynopsisdiv> - <synopsis> -#include <libelf.h> -</synopsis> - </refsynopsisdiv> - - <refsect1> - <title>Description</title> - - <simpara>The <structname>Elf_Data</structname> structure is as - a descriptor for a data buffer associated with a section. - Every data buffer is associated with a specific section (see - <!-- xref --><structname>Elf_Scn</structname>).</simpara> - - <simpara>A data buffer is created when reading a file. In - this case only a single buffer is present in the section. The - user can add as many sections as wanted to a section and they - can be retrieved using the <function>elf_getdata</function> - and <function>elf_rawdata</function> functions.<!-- xref - --></simpara> - - <simpara>The <structname>Elf_Data</structname> structure - contains the following members:</simpara> - - <programlisting> - void *d_buf - Elf_Type d_type - size_t d_size - off_t d_off - size_t d_align - unsigned int d_version -</programlisting> - - <simpara>All these members can be modified directly by the - user. They can be used to resize a section, to change its - content or type, and many things more. This is also true for - the data read from a file. The meaning of the members is as - follows:</simpara> - - <variablelist> - <varlistentry> - <term><structfield>d_buf</structfield></term> - <listitem> - <simpara>The <structfield>d_buf</structfield> member is - the pointer to the buffer with the actual data. When - the ELF file was read from a file the first and only - data buffer of a section is allocated by the - <filename>libelf</filename> library. The user should - not try to resize or free this buffer. When the user - adds a new data buffer to a section the associated - memory block is normally allocated by the user. It is - important that the buffer must have a lifetime at least - until the ELF file is closed entirely (important when - the buffer is allocated on the stack). If the buffer is - not allocated on the stack it is the user's - responsibility to free the buffer after it is not used - anymore. The <structfield>d_buf</structfield> member - can contain a null pointer if the data buffer is - empty.</simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term><structfield>d_type</structfield></term> - <listitem> - <simpara>The <structfield>d_type</structfield> - determines how the data of the buffer is interpreted. - This type is determined from the section type and must - be the same for all data buffers for a section. See - <!-- xref --><type>Elf_Type</type> for more information. - The <function><link linkend="elfUgetdata" - endterm="elfUgetdata.refname"></link></function> - function uses this information to convert the data of - the buffer between the external form and the form - represented to the user and back if necessary.</simpara> - </listitem> - </varlistentry> - </variablelist> - </refsect1> - </refentry> - - <beginpage> - - <refentry id="elfUgetdata"> - <refnamediv> - <refname id="elfUgetdata.refname">elf_getdata</refname> - <refpurpose>Get washed data of section</refpurpose> - </refnamediv> - - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> -#include <libelf.h> -</funcsynopsisinfo> - <funcprototype> - <funcdef>Elf_Data *<function>elf_getdata</function></funcdef> - <paramdef>Elf_Scn *<parameter>scn</parameter></paramdef> - <paramdef>Elf_Data *<parameter>data</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - - <refsect1> - <title>Description</title> - - <simpara>The <function>elf_getdata</function> function allows - to retriece the data buffers of the section - <parameter>scn</parameter>. There can be more than one buffer - if the user explicitly added them. When a file is read the - <filename>libelf</filename> library creates exactly one data - buffer.</simpara> - - <simpara>The first buffer in the list can be obtained by - passing a null pointer in the parameter - <parameter>data</parameter>. To get the next data buffer the - previously returned value must be passed in the - <parameter>data</parameter> parameter. If there is no more - buffer left in the list a null pointer is returned.</simpara> - - <simpara>If the <parameter>data</parameter> parameter is not a - null pointer it must be a descriptor with for a buffer - associated with the section <parameter>scn</parameter>. If - this is not the case a null pointer is returned. To - facilitate error handling <function>elf_getdata</function> - also returns a null pointer if the <parameter>scn</parameter> - parameter is a null pointer.</simpara> - </refsect1> - </refentry> - - <refentry> - <refnamediv> - <refname id="elfUupdate.refname">elf_update</refname> - <refpurpose>update an ELF descriptor</refpurpose> - </refnamediv> - - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> -#include <libelf.h> -</funcsynopsisinfo> - <funcprototype> - <funcdef>off_t <function>elf_update</function></funcdef> - <paramdef>Elf *<parameter>elf</parameter></paramdef> - <paramdef>Elf_Cmd <parameter>cmd</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - - <refsect1> - <title>Description</title> - - <simpara>The user is responsible for filling in the following - fields in the named data structures:</simpara> - - <table> - <title>Fields not set by <function>elf_update</function></title> - <tgroup cols="3"> - <colspec colwidth="90pt"> - <colspec colwidth="110pt"> - <thead> - <row> - <entry>Data Structure</entry> - <entry>Member</entry> - <entry>Exception</entry> - </row> - </thead> - <tbody> - <row> - <entry morerows="8"><type>Elfxx_Ehdr</type></entry> - <entry>e_ident[EI_DATA]</entry> - <entry>see below</entry> - </row> - <row> - <entry></entry> - <entry>e_type</entry> - <!-- <entry morerows="1"></entry> --> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>e_machine</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>e_version</entry> - <entry>see below</entry> - </row> - <row> - <entry></entry> - <entry>e_entry</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>e_phoff</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>e_shoff</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>e_flags</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>e_shstrndx</entry> - <entry></entry> - </row> - <row> - <entry morerows="7">Elfxx_Phdr</entry> - <entry>p_type</entry> - <entry morerows="7"></entry> - </row> - <row> - <entry></entry> - <entry>p_offset</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_vaddr</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_paddr</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_filesz</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_memsz</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_flags</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>p_align</entry> - <entry></entry> - </row> - - <row> - <entry morerows="9">Elfxx_Shdr</entry> - <entry>sh_name</entry> - <entry morerows="3"></entry> - </row> - <row> - <entry></entry> - <entry>sh_type</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>sh_flags</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>sh_addr</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>sh_offset</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>sh_size</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>sh_link</entry> - <!-- <entry morerows="1"></entry> --> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>sh_info</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>sh_addralign</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>sh_entsize</entry> - <entry></entry> - </row> - - <row> - <entry morerows="5">Elf_Data</entry> - <entry>d_buf</entry> - <entry morerows="2"></entry> - </row> - <row> - <entry></entry> - <entry>d_type</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>d_size</entry> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>d_off</entry> - <entry>if <symbol>ELF_F_LAYOUT</symbol> is used</entry> - </row> - <row> - <entry></entry> - <entry>d_align</entry> - <!-- <entry morerows="1"></entry> --> - <entry></entry> - </row> - <row> - <entry></entry> - <entry>d_version</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - - <simpara>Two fields of the ELF header are handled in a special - way:</simpara> - - <variablelist> - <varlistentry> - <term>e_version</term> - <listitem> - <simpara>The user can set this field to the vvalue for - the version to be used. It is an error if the library - cannot handle this version. If the field contains the - value <symbol>EV_NONE</symbol> the library will fill in - its own internal version.</simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>e_ident[EI_DATA]</term> - <listitem> - <simpara>The user should fill in the byte ordering for - the file. If the value of the field is - <symbol>ELFDATANONE</symbol> the library replaces it - with the native byte ordering for the machine.</simpara> - </listitem> - </varlistentry> - </variablelist> - </refsect1> - </refentry> - </chapter> - - <chapter> - <title><filename>libelf</filename> Internals</title> - - <simpara>Since the binary format handling tools need constant - attention since there are always new machines and varients - therefore coming out it is important to have the implementation - weel documented. Only this way extensions can be made in the - right places and the mistakes of the past avoided.</simpara> - </chapter> -</book> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omitag:nil -sgml-shorttag:t -End: ---> diff --git a/elfutils/elfutils.spec b/elfutils/elfutils.spec index 5db4242e..f5c1faaa 100644 --- a/elfutils/elfutils.spec +++ b/elfutils/elfutils.spec @@ -1,24 +1,31 @@ -%define gpl 0 +# -*- rpm-spec-*- +%define fake 0 Summary: A collection of utilities and DSOs to handle compiled objects. Name: elfutils -Version: 0.97 +Version: 0.108 Release: 1 -Copyright: OSL +%if %{fake} +License: GPL +%else +License: OSL +%endif Group: Development/Tools #URL: file://home/devel/drepper/ Source: elfutils-%{version}.tar.gz Obsoletes: libelf libelf-devel Requires: elfutils-libelf = %{version}-%{release} -%if %{gpl} +%if %{fake} Requires: binutils >= 2.14.90.0.4-26.2 %endif +Requires: glibc >= 2.3.1-2 # ExcludeArch: xxx BuildRoot: %{_tmppath}/%{name}-root -BuildRequires: gcc >= 3.2 +BuildRequires: gcc >= 3.4 BuildRequires: bison >= 1.875 BuildRequires: flex >= 2.5.4a +BuildRequires: bzip2 %define _gnu %{nil} %define _programprefix eu- @@ -35,7 +42,11 @@ handling. %package devel Summary: Development libraries to handle compiled objects. Group: Development/Tools -Copyright: OSL +%if %{fake} +License: GPL +%else +License: OSL +%endif Requires: elfutils = %{version}-%{release} Requires: elfutils-libelf-devel = %{version}-%{release} @@ -49,8 +60,8 @@ assembler interface. %package libelf Summary: Library to read and write ELF files. Group: Development/Tools -%if %{gpl} -Copyright: GPL +%if %{fake} +License: GPL %endif %description libelf @@ -64,8 +75,8 @@ Summary: Development support for libelf Group: Development/Tools Requires: elfutils-libelf = %{version}-%{release} Conflicts: libelf-devel -%if %{gpl} -Copyright: GPL +%if %{fake} +License: GPL %endif %description libelf-devel @@ -78,47 +89,31 @@ different sections of an ELF file. %setup -q %build -mkdir build-%{_target_platform} -cd build-%{_target_platform} -../configure \ - --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ - --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ - --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ - --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ - --infodir=%{_infodir} --program-prefix=%{_programprefix} --enable-shared -cd .. +%configure --program-prefix=%{_programprefix} +make %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_prefix} -cd build-%{_target_platform} -#make check %makeinstall chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so* -%if !%{gpl} +%if !%{fake} chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so* %endif -cd .. - -%if !%{gpl} +%if !%{fake} # XXX Nuke unpackaged files { cd ${RPM_BUILD_ROOT} rm -f .%{_bindir}/eu-ld rm -f .%{_includedir}/elfutils/libasm.h - rm -f .%{_includedir}/elfutils/libdw.h rm -f .%{_libdir}/libasm-%{version}.so rm -f .%{_libdir}/libasm.a - rm -f .%{_libdir}/libdw.so - rm -f .%{_libdir}/libdw.a } %endif %check -cd build-%{_target_platform} make check %clean @@ -135,7 +130,7 @@ rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc README TODO -%if %{gpl} +%if %{fake} %doc fake-src/FULL %endif %{_bindir}/eu-elflint @@ -143,7 +138,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_bindir}/eu-readelf %{_bindir}/eu-size %{_bindir}/eu-strip -%if !%{gpl} +%{_bindir}/eu-findtextrel +%{_bindir}/eu-addr2line +%if !%{fake} #%{_bindir}/eu-ld #%{_libdir}/libasm-%{version}.so %{_libdir}/libdw-%{version}.so @@ -158,13 +155,14 @@ rm -rf ${RPM_BUILD_ROOT} %{_includedir}/dwarf.h %dir %{_includedir}/elfutils %{_includedir}/elfutils/elf-knowledge.h -%if !%{gpl} +%if !%{fake} %{_includedir}/elfutils/libebl.h +%{_includedir}/elfutils/libdw.h #%{_libdir}/libasm.a %{_libdir}/libebl.a -#%{_libdir}/libdw.a +%{_libdir}/libdw.a #%{_libdir}/libasm.so -#%{_libdir}/libdw.so +%{_libdir}/libdw.so %endif %files libelf @@ -181,6 +179,36 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.so %changelog +* Sun May 8 2005 Ulrich Drepper <@redhat.com> 0.108-1 +- strip: fix bug introduced in last change + +* Sun May 8 2005 Ulrich Drepper <@redhat.com> 0.107-1 +- readelf: improve DWARF output format +- strip: support Linux kernel modules + +* Fri Apr 29 2005 Ulrich Drepper <drepper@redhat.com> 0.107-1 +- readelf: improve DWARF output format + +* Mon Apr 4 2005 Ulrich Drepper <drepper@redhat.com> 0.106-1 +- libdw: Updated dwarf.h from DWARF3 speclibdw: add new funtions dwarf_f +unc_entrypc, dwarf_func_file, dwarf_func_line,dwarf_func_col, dwarf_ge +tsrc_file + +* Fri Apr 1 2005 Ulrich Drepper <drepper@redhat.com> 0.105-1 +- addr2line: New program +- libdw: add new functions: dwarf_addrdie, dwarf_macro_*, dwarf_getfuncs +,dwarf_func_*. +- findtextrel: use dwarf_addrdie + +* Mon Mar 28 2005 Ulrich Drepper <drepper@redhat.com> 0.104-1 +- findtextrel: New program. + +* Mon Mar 21 2005 Ulrich Drepper <drepper@redhat.com> 0.103-1 +- libdw: Fix using libdw.h with gcc < 4 and C++ code. Compiler bug. + +* Tue Feb 22 2005 Ulrich Drepper <drepper@redhat.com> 0.102-1 +- More Makefile and spec file cleanups. + * Fri Jan 16 2004 Jakub Jelinek <jakub@redhat.com> 0.94-1 - upgrade to 0.94 diff --git a/elfutils/lib/ChangeLog b/elfutils/lib/ChangeLog index 4da33b09..9ddc2163 100644 --- a/elfutils/lib/ChangeLog +++ b/elfutils/lib/ChangeLog @@ -1,3 +1,28 @@ +2005-05-03 Roland McGrath <roland@redhat.com> + + * crc32_file.c: New file. + * Makefile.am (libeu_a_SOURCES): Add it. + * system.h: Declare crc32_file. + +2005-04-30 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Use -ffunction-sections for xmalloc.c. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * dynamicsizehash.c (lookup): Mark val parameter as possibly unused. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * fixedsizehash.h: Mark unused parameters. Correct CLASS and + const order for fshash_find. + + * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fpic and -fmudflap. + 2004-01-17 Ulrich Drepper <drepper@redhat.com> * Makefile.am: Support building with mudflap. diff --git a/elfutils/lib/Makefile.am b/elfutils/lib/Makefile.am index 43a13582..facb5634 100644 --- a/elfutils/lib/Makefile.am +++ b/elfutils/lib/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 1996-2001, 2002, 2004 Red Hat, Inc. +## Copyright (C) 1996-2001, 2002, 2004, 2005 Red Hat, Inc. ## ## 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 @@ -17,21 +16,20 @@ ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -AM_CFLAGS = -Wall $(if $($(*F)_no_Werror),,-Werror) $(picflag) -if !MUDFLAP -picflag = -fpic +if MUDFLAP +AM_CFLAGS = -fmudflap +else +AM_CFLAGS = endif +AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS) INCLUDES = -I$(srcdir)/../libelf -I.. noinst_LIBRARIES = libeu.a -libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c crc32.c +libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \ + crc32.c crc32_file.c noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h EXTRA_DIST = dynamicsizehash.c -# XXX gcc has a bug in that it generates warnings for internal symbols. -if MUDFLAP -xmalloc_no_Werror = yes -crc32_no_Werror = yes -endif +xmalloc_CFLAGS = -ffunction-sections diff --git a/elfutils/lib/Makefile.in b/elfutils/lib/Makefile.in index 8014230f..4d0ff2de 100644 --- a/elfutils/lib/Makefile.in +++ b/elfutils/lib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -44,8 +44,6 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -58,7 +56,8 @@ ARFLAGS = cru libeu_a_AR = $(AR) $(ARFLAGS) libeu_a_LIBADD = am_libeu_a_OBJECTS = xstrdup.$(OBJEXT) xstrndup.$(OBJEXT) \ - xmalloc.$(OBJEXT) next_prime.$(OBJEXT) crc32.$(OBJEXT) + xmalloc.$(OBJEXT) next_prime.$(OBJEXT) crc32.$(OBJEXT) \ + crc32_file.$(OBJEXT) libeu_a_OBJECTS = $(am_libeu_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp @@ -84,7 +83,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -93,25 +91,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -129,7 +121,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -177,17 +168,18 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -AM_CFLAGS = -Wall $(if $($(*F)_no_Werror),,-Werror) $(picflag) -@MUDFLAP_FALSE@picflag = -fpic +@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ +@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS) +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ +@MUDFLAP_TRUE@ -Wunused -Wextra $($(*F)_CFLAGS) INCLUDES = -I$(srcdir)/../libelf -I.. noinst_LIBRARIES = libeu.a -libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c crc32.c +libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \ + crc32.c crc32_file.c + noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h EXTRA_DIST = dynamicsizehash.c - -# XXX gcc has a bug in that it generates warnings for internal symbols. -@MUDFLAP_TRUE@xmalloc_no_Werror = yes -@MUDFLAP_TRUE@crc32_no_Werror = yes +xmalloc_CFLAGS = -ffunction-sections all: all-am .SUFFIXES: @@ -236,6 +228,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/next_prime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrdup.Po@am__quote@ diff --git a/elfutils/lib/crc32_file.c b/elfutils/lib/crc32_file.c new file mode 100644 index 00000000..e6d468b4 --- /dev/null +++ b/elfutils/lib/crc32_file.c @@ -0,0 +1,59 @@ +#include "system.h" +#include <errno.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/mman.h> + +int +crc32_file (int fd, uint32_t *resp) +{ + unsigned char buffer[1024 * 8]; + uint32_t crc = 0; + off_t off = 0; + ssize_t count; + + struct stat st; + if (fstat (fd, &st) == 0) + { + /* Try mapping in the file data. */ + size_t mapsize = st.st_size; + void *mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, fd, 0); + if (mapped == MAP_FAILED && errno == ENOMEM) + { + const size_t pagesize = sysconf (_SC_PAGE_SIZE); + mapsize = ((mapsize / 2) + pagesize - 1) & -pagesize; + while (mapsize >= pagesize + && (mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, + fd, 0)) == MAP_FAILED && errno == ENOMEM) + mapsize /= 2; + } + if (mapped != MAP_FAILED) + { + do + { + if (st.st_size <= (off_t) mapsize) + { + *resp = crc32 (crc, mapped, st.st_size); + munmap (mapped, mapsize); + return 0; + } + crc = crc32 (crc, mapped, mapsize); + off += mapsize; + st.st_size -= mapsize; + } while (mmap (mapped, mapsize, PROT_READ, MAP_FIXED|MAP_PRIVATE, + fd, off) == mapped); + munmap (mapped, mapsize); + } + } + + while ((count = TEMP_FAILURE_RETRY (pread (fd, buffer, sizeof buffer, + off))) > 0) + { + off += count; + crc = crc32 (crc, buffer, count); + } + + *resp = crc; + + return count == 0 ? 0 : -1; +} diff --git a/elfutils/lib/dynamicsizehash.c b/elfutils/lib/dynamicsizehash.c index 16575f50..61759636 100644 --- a/elfutils/lib/dynamicsizehash.c +++ b/elfutils/lib/dynamicsizehash.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002 Red Hat, Inc. +/* Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -32,7 +32,7 @@ static size_t lookup (htab, hval, val) NAME *htab; unsigned long int hval; - TYPE val; + TYPE val __attribute__ ((unused)); { /* First hash function: simply take the modul but prevent zero. */ size_t idx = 1 + hval % htab->size; diff --git a/elfutils/lib/fixedsizehash.h b/elfutils/lib/fixedsizehash.h index c5a852c5..c1c607dd 100644 --- a/elfutils/lib/fixedsizehash.h +++ b/elfutils/lib/fixedsizehash.h @@ -1,5 +1,5 @@ /* Fixed size hash table with internal linking. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is free software; you can redistribute it and/or modify @@ -156,7 +156,8 @@ CONCAT(PREFIX,fshash_lookup) (struct CONCAT(PREFIX,fshash) *htab, CLASS int __attribute__ ((unused)) CONCAT(PREFIX,fshash_insert) (struct CONCAT(PREFIX,fshash) *htab, - const char *str, size_t len, TYPE *data) + const char *str, + size_t len __attribute__ ((unused)), TYPE *data) { HASHTYPE hval = HASHFCT (str, len ?: strlen (str)); struct CONCAT(PREFIX,fshashent) *slot; @@ -205,7 +206,9 @@ CONCAT(PREFIX,fshash_insert_hash) (struct CONCAT(PREFIX,fshash) *htab, CLASS int __attribute__ ((unused)) CONCAT(PREFIX,fshash_overwrite) (struct CONCAT(PREFIX,fshash) *htab, - const char *str, size_t len, TYPE *data) + const char *str, + size_t len __attribute__ ((unused)), + TYPE *data) { HASHTYPE hval = HASHFCT (str, len ?: strlen (str)); struct CONCAT(PREFIX,fshashent) *slot; @@ -222,9 +225,10 @@ CONCAT(PREFIX,fshash_overwrite) (struct CONCAT(PREFIX,fshash) *htab, } -const CLASS TYPE * +CLASS const TYPE * CONCAT(PREFIX,fshash_find) (const struct CONCAT(PREFIX,fshash) *htab, - const char *str, size_t len, TYPE *data) + const char *str, + size_t len __attribute__ ((unused)), TYPE *data) { HASHTYPE hval = HASHFCT (str, len ?: strlen (str)); struct CONCAT(PREFIX,fshashent) *slot; diff --git a/elfutils/lib/system.h b/elfutils/lib/system.h index 8e46feac..e29c2dbb 100644 --- a/elfutils/lib/system.h +++ b/elfutils/lib/system.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. 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 @@ -28,7 +28,7 @@ extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__)); extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len); - +extern int crc32_file (int fd, uint32_t *resp); /* A special gettext function we use if the strings are too short. */ #define sgettext(Str) \ diff --git a/elfutils/libasm/ChangeLog b/elfutils/libasm/ChangeLog index 630696d7..8b7b44d2 100644 --- a/elfutils/libasm/ChangeLog +++ b/elfutils/libasm/ChangeLog @@ -1,3 +1,32 @@ +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. + + * asm_end.c (text_end): Mark parameter as possibly unused. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Remove lint handling. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * asm_end.c (binary_end): Don't terminate with error() in case + something goes wrong. + + * Makefile.am: Check for text relocations in constructed DSO. + + * Makefile.am (AM_CFLAGS): More warnings. Add -fmudflap for MUDFLAP. + + * asm_end.c (binary_end): Remove shadowing variables. + Little cleanups. + + * asm_newsym.c: Allocate memory for the string parameter. + +2005-02-04 Ulrich Drepper <drepper@redhat.com> + + * asm_newscn_ingrp.c (asm_newscn_ingrp): Use INTUSE to reference + asm_newscn. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * asm_error.c: Make compile with gcc 4.0. @@ -20,4 +49,4 @@ 2003-08-11 Ulrich Drepper <drepper@redhat.com> - * Moved to CVS archive. + * Moved to CVS archive. diff --git a/elfutils/libasm/Makefile.am b/elfutils/libasm/Makefile.am index 9ba304d1..34b19d24 100644 --- a/elfutils/libasm/Makefile.am +++ b/elfutils/libasm/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 2002, 2004 Red Hat, Inc. +## Copyright (C) 2002, 2004, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -15,17 +14,16 @@ ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H if MUDFLAP -AM_CFLAGS = -Wall +AM_CFLAGS = -fmudflap else -AM_CFLAGS = -Wall -Werror +AM_CFLAGS = endif +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \ -I$(top_srcdir)/lib GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) VERSION = 1 -LINT = splint - lib_LIBRARIES = libasm.a if !MUDFLAP noinst_LIBRARIES = libasm_pic.a @@ -57,6 +55,7 @@ libasm.so: libasm_pic.a libasm.map -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \ -Wl,--soname,$@.$(VERSION) \ ../libebl/libebl.a ../libelf/libelf.so + if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) @@ -81,11 +80,6 @@ uninstall: uninstall-am rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils endif -.PSEUDO: lint -lint: - $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \ - $(addprefix $(srcdir)/,$(libelf_la_SOURCES)) - noinst_HEADERS = libasmP.h symbolhash.h EXTRA_DIST = libasm.map diff --git a/elfutils/libasm/Makefile.in b/elfutils/libasm/Makefile.in index 9683d4d2..7d2121c9 100644 --- a/elfutils/libasm/Makefile.in +++ b/elfutils/libasm/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -47,8 +47,6 @@ DIST_COMMON = $(euinclude_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -117,7 +115,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -126,25 +123,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -162,7 +153,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -210,13 +200,14 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -@MUDFLAP_TRUE@AM_CFLAGS = -Wall +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \ +@MUDFLAP_FALSE@ -Wformat=2 +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Werror -Wunused \ +@MUDFLAP_TRUE@ -Wextra -Wformat=2 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \ -I$(top_srcdir)/lib GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) -LINT = splint lib_LIBRARIES = libasm.a @MUDFLAP_FALSE@noinst_LIBRARIES = libasm_pic.a euincludedir = ${includedir}/elfutils @@ -562,6 +553,7 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \ @MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \ @MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION) \ @MUDFLAP_FALSE@ ../libebl/libebl.a ../libelf/libelf.so +@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION) @MUDFLAP_FALSE@%.os: %.c %.o @@ -583,11 +575,6 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \ @MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION) @MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libasm.so @MUDFLAP_FALSE@ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils - -.PSEUDO: lint -lint: - $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \ - $(addprefix $(srcdir)/,$(libelf_la_SOURCES)) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/elfutils/libasm/asm_end.c b/elfutils/libasm/asm_end.c index 01326a11..74f01f08 100644 --- a/elfutils/libasm/asm_end.c +++ b/elfutils/libasm/asm_end.c @@ -1,5 +1,5 @@ /* Finalize operations on the assembler context, free all resources. - Copyright (C) 2002, 2003 Red Hat, Inc. + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -31,7 +31,7 @@ static int -text_end (AsmCtx_t *ctx) +text_end (AsmCtx_t *ctx __attribute__ ((unused))) { // XXX Does anything have to be done? return 0; @@ -93,9 +93,10 @@ binary_end (AsmCtx_t *ctx) Elf_Data *newdata = elf_newdata (scn); if (newdata == NULL) - error (EXIT_FAILURE, 0, - _("cannot create section for output file: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } newdata->d_buf = content->data; newdata->d_type = ELF_T_BYTE; @@ -114,26 +115,19 @@ binary_end (AsmCtx_t *ctx) /* Create the symbol table if necessary. */ if (ctx->nsymbol_tab > 0) { - Elf_Scn *symscn; - Elf_Scn *strscn; - AsmSym_t *sym; - int ptr_local; - int ptr_nonlocal; - GElf_Sym syment; - uint32_t *xshndx = NULL; - void *runp; - /* Create the symbol table and string table section names. */ symscn_strent = ebl_strtabadd (ctx->section_strtab, ".symtab", 8); strscn_strent = ebl_strtabadd (ctx->section_strtab, ".strtab", 8); /* Create the symbol string table section. */ - strscn = elf_newscn (ctx->out.elf); + Elf_Scn *strscn = elf_newscn (ctx->out.elf); strtabdata = elf_newdata (strscn); shdr = gelf_getshdr (strscn, &shdr_mem); if (strtabdata == NULL || shdr == NULL) - error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } strscnndx = elf_ndxscn (strscn); ebl_strtabfinalize (ctx->symbol_strtab, strtabdata); @@ -144,12 +138,14 @@ binary_end (AsmCtx_t *ctx) (void) gelf_update_shdr (strscn, shdr); /* Create the symbol table section. */ - symscn = elf_newscn (ctx->out.elf); + Elf_Scn *symscn = elf_newscn (ctx->out.elf); data = elf_newdata (symscn); shdr = gelf_getshdr (symscn, &shdr_mem); if (data == NULL || shdr == NULL) - error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } symscnndx = elf_ndxscn (symscn); /* We know how many symbols there will be in the symbol table. */ @@ -163,20 +159,19 @@ binary_end (AsmCtx_t *ctx) data->d_off = 0; /* Clear the first entry. */ + GElf_Sym syment; memset (&syment, '\0', sizeof (syment)); (void) gelf_update_sym (data, 0, &syment); /* Iterate over the symbol table. */ - runp = NULL; - ptr_local = 1; /* Start with index 1; zero remains unused. */ - ptr_nonlocal = ctx->nsymbol_tab; + void *runp = NULL; + int ptr_local = 1; /* Start with index 1; zero remains unused. */ + int ptr_nonlocal = ctx->nsymbol_tab; + uint32_t *xshndx = NULL; + AsmSym_t *sym; while ((sym = asm_symbol_tab_iterate (&ctx->symbol_tab, &runp)) != NULL) if (asm_emit_symbol_p (ebl_string (sym->strent))) { - int ptr; - Elf32_Word ndx; - Elf_Scn *scn; - assert (ptr_local <= ptr_nonlocal); syment.st_name = ebl_strtaboffset (sym->strent); @@ -187,14 +182,15 @@ binary_end (AsmCtx_t *ctx) /* Add local symbols at the beginning, the other from the end. */ - ptr = sym->binding == STB_LOCAL ? ptr_local++ : ptr_nonlocal--; + int ptr = sym->binding == STB_LOCAL ? ptr_local++ : ptr_nonlocal--; /* Determine the section index. We have to handle the overflow correctly. */ - scn = (sym->scn->subsection_id == 0 - ? sym->scn->data.main.scn - : sym->scn->data.up->data.main.scn); + Elf_Scn *scn = (sym->scn->subsection_id == 0 + ? sym->scn->data.main.scn + : sym->scn->data.up->data.main.scn); + Elf32_Word ndx; if (unlikely (scn == ASM_ABS_SCN)) ndx = SHN_ABS; else if (unlikely (scn == ASM_COM_SCN)) @@ -206,15 +202,15 @@ binary_end (AsmCtx_t *ctx) /* The extended section index section does not yet exist. */ Elf_Scn *xndxscn; - size_t symscnndx = elf_ndxscn (symscn); xndxscn = elf_newscn (ctx->out.elf); xndxdata = elf_newdata (xndxscn); shdr = gelf_getshdr (xndxscn, &shdr_mem); if (xndxdata == NULL || shdr == NULL) - error (EXIT_FAILURE, 0, _("\ -cannot create extended section index table: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } xndxscnndx = elf_ndxscn (xndxscn); shdr->sh_type = SHT_SYMTAB_SHNDX; @@ -276,8 +272,10 @@ cannot create extended section index table: %s"), shstrtabdata = elf_newdata (shstrscn); shdr = gelf_getshdr (shstrscn, &shdr_mem); if (shstrscn == NULL || shstrtabdata == NULL || shdr == NULL) - error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } /* Add the name of the section header string table. */ @@ -300,9 +298,6 @@ cannot create extended section index table: %s"), do { Elf_Scn *scn; - GElf_Shdr shdr_mem; - GElf_Shdr *shdr; - Elf_Data *data; Elf32_Word *grpdata; scn = runp->scn; @@ -312,9 +307,10 @@ cannot create extended section index table: %s"), data = elf_newdata (scn); if (data == NULL) - error (EXIT_FAILURE, 0, - _("cannot create section group for output file: %s"), - elf_errmsg (-1)); + { + __libasm_seterrno (ASM_E_LIBELF); + return -1; + } /* It is correct to use 'elf32_fsize' instead of 'gelf_fsize' here. */ diff --git a/elfutils/libasm/asm_newscn_ingrp.c b/elfutils/libasm/asm_newscn_ingrp.c index dc0c4351..bfbdc6a0 100644 --- a/elfutils/libasm/asm_newscn_ingrp.c +++ b/elfutils/libasm/asm_newscn_ingrp.c @@ -1,5 +1,5 @@ /* Create new section, which is member of a group, in output file. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -29,7 +29,7 @@ asm_newscn_ingrp (ctx, scnname, type, flags, grp) GElf_Xword flags; AsmScnGrp_t *grp; { - AsmScn_t *result = __asm_newscn_internal (ctx, scnname, type, flags); + AsmScn_t *result = INTUSE (asm_newscn) (ctx, scnname, type, flags); if (likely (result != NULL)) { diff --git a/elfutils/libasm/asm_newsym.c b/elfutils/libasm/asm_newsym.c index 6a6df2d8..70ad9e5d 100644 --- a/elfutils/libasm/asm_newsym.c +++ b/elfutils/libasm/asm_newsym.c @@ -1,5 +1,5 @@ /* Define new symbol for current position in given section. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -54,9 +54,13 @@ asm_newsym (asmscn, name, size, type, binding) // XXX This requires getting the format from the machine backend. */ snprintf (tempsym, TEMPSYMLEN, ".L%07u", asmscn->ctx->tempsym_count++); + + name = tempsym; } - result = (AsmSym_t *) malloc (sizeof (AsmSym_t)); + size_t name_len = strlen (name) + 1; + + result = (AsmSym_t *) malloc (sizeof (AsmSym_t) + name_len); if (result == NULL) return NULL; @@ -69,15 +73,12 @@ asm_newsym (asmscn, name, size, type, binding) result->binding = binding; result->symidx = 0; result->strent = ebl_strtabadd (asmscn->ctx->symbol_strtab, - name ?: tempsym, 0); + memcpy (result + 1, name, name_len), 0); if (unlikely (asmscn->ctx->textp)) { /* We are only interested in the name and don't need to know whether it is a local name or not. */ - if (name == NULL) - name = tempsym; - /* First print the binding pseudo-op. */ if (binding == STB_GLOBAL) fprintf (asmscn->ctx->out.file, "\t.globl\t%s\n", name); @@ -97,15 +98,21 @@ asm_newsym (asmscn, name, size, type, binding) else { /* Put the symbol in the hash table so that we can later find it. */ - if (asm_symbol_tab_insert (&asmscn->ctx->symbol_tab, - elf_hash (name ?: tempsym), result) != 0) + if (asm_symbol_tab_insert (&asmscn->ctx->symbol_tab, elf_hash (name), + result) != 0) { /* The symbol already exists. */ __libasm_seterrno (ASM_E_DUPLSYM); + /* Note that we can free the entry since there must be no + reference in the string table to the string. We can only + fail to insert the symbol into the symbol table if there + is already a symbol with this name. In this case the + ebl_strtabadd function would use the previously provided + name. */ free (result); result = NULL; } - else if (name != NULL && asm_emit_symbol_p (name)) + else if (name != tempsym && asm_emit_symbol_p (name)) /* Only count non-private symbols. */ ++asmscn->ctx->nsymbol_tab; } diff --git a/elfutils/libcpu/ChangeLog b/elfutils/libcpu/ChangeLog index c46ffcb6..5c2a4ac7 100644 --- a/elfutils/libcpu/ChangeLog +++ b/elfutils/libcpu/ChangeLog @@ -1,3 +1,11 @@ +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (AM_CFLAGS): Define, instead of adding things to DEFS. + 2003-08-11 Ulrich Drepper <drepper@redhat.com> - * Moved to CVS archive. + * Moved to CVS archive. diff --git a/elfutils/libcpu/Makefile.am b/elfutils/libcpu/Makefile.am index fc85f37c..02fb8020 100644 --- a/elfutils/libcpu/Makefile.am +++ b/elfutils/libcpu/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 2002 Red Hat, Inc. +## Copyright (C) 2002, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -13,7 +12,8 @@ ## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., ## 3001 King Ranch Road, Ukiah, CA 95482. ## -DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wshadow +DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H +AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused INCLUDES = -I$(srcdir) noinst_LIBRARIES = libcpu_i386.a diff --git a/elfutils/libcpu/Makefile.in b/elfutils/libcpu/Makefile.in index abd67c34..fec0acab 100644 --- a/elfutils/libcpu/Makefile.in +++ b/elfutils/libcpu/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -42,8 +42,6 @@ subdir = libcpu DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -80,34 +78,27 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ -DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wshadow +DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -125,7 +116,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -173,6 +163,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused INCLUDES = -I$(srcdir) noinst_LIBRARIES = libcpu_i386.a libcpu_i386_a_SOURCES = i386_dis.c diff --git a/elfutils/libdw/ChangeLog b/elfutils/libdw/ChangeLog index f0c4b6b6..f6105c8c 100644 --- a/elfutils/libdw/ChangeLog +++ b/elfutils/libdw/ChangeLog @@ -1,3 +1,159 @@ +2005-05-05 Roland McGrath <roland@redhat.com> + + * dwarf_getsrc_die.c (dwarf_getsrc_die): Use binary search. + + * dwarf_getsrclines.c (dwarf_getsrclines): Sort result array, since + the line program does not produce all entries in ascending order. + +2005-04-25 Ulrich Drepper <drepper@redhat.com> + + * dwarf_getsrc_file.c (dwarf_getsrc_file): Handle multiple + occurences (e.g., inlines) better. + +2005-04-24 Ulrich Drepper <drepper@redhat.com> + + * libdw.h (DWARF_END_ABBREV): Define. + * dwarf_getabbrev.c (__libdw_getabbrev): Return DWARF_END_ABBREV if + end is reached. + * dwarf_offabbrev.c (dwarf_offabbrev): Return -1 on error, 1 if end + of records reached. + * dwarf_tag.c (__libdw_findabbrev): Also recognize DWARF_END_ABBREV + as error of __libdw_getabbrev. + +2005-04-04 Ulrich Drepper <drepper@redhat.com> + + * dwarf_getsrc_file.c (dwarf_getsrc_file): Minor optimization. + + * dwarf_getsrc_file.c (dwarf_getsrc_file): Always pass number of + results back to caller. + +2005-04-04 Roland McGrath <roland@redhat.com> + + * dwarf_getsrc_file.c (dwarf_getsrc_file): Use size_t for CUHL. + + * dwarf_func_line.c (__libdw_func_intval): Use internal_function in + defn. + +2005-04-04 Ulrich Drepper <drepper@redhat.com> + + * dwarf_getsrc_file.c (dwarf_getsrc_file): Use INTUSE. + + * dwarf_getsrc_file.c: New file. + * Makefile.am (libdw_a_SOURCES): Add dwarf_getsrc_file.c. + * libdw.h: Declare dwarf_getsrc_file. + * libdw.map: Add dwarf_getsrc_file. + +2005-04-02 Ulrich Drepper <drepper@redhat.com> + + * dwarf_func_entrypc.c: New file. + * dwarf_func_col.c: New file. + * dwarf_func_line.c: New file. + * dwarf_func_file.c: New file. + * libdw.h: Add prototypes for new functions. + * libdw.map: Add dwarf_func_entrypc, dwarf_func_col, dwarf_func_line, + dwarf_func_file. + * Makefile.am (libdw_a_SOURCES): Add dwarf_func_entrypc.c, + dwarf_func_col.c, dwarf_func_line.c, dwarf_func_file.c. + * libdwP.h (struct Dwarf_Func_s): Add cudie element. + Declare __libdw_func_intval and __dwarf_formsdata_internal. + * dwarf_getfuncs.c: Also fill in cudie in Dwarf_Func object. + * dwarf_formsdata.c: Use INTUSE and INTDEF to avoid PLTs. + + * dwarf.h: Add some DWARF3 definitions. + +2005-04-01 Ulrich Drepper <drepper@redhat.com> + + * dwarf_getfuncs.c: New file. + * dwarf_func_highpc.c: New file. + * dwarf_func_lowpc.c: New file. + * dwarf_func_name.c: New file. + * Makefile.am (libdw_a_SOURCES): Add dwarf_getfuncs.c, + dwarf_func_highpc.c, dwarf_func_lowpc.c, and dwarf_func_name.c. + * libdw.map: Add dwarf_getfuncs, dwarf_func_highpc, dwarf_func_lowpc, + and dwarf_func_name. + * libdw.h: Add prototypes for new functions. + * dwarf_child.c: Use INTUSE and INTDEF to avoid PLTs. + * dwarf_siblingof.c: Likewise. + * dwarf_dieoffset.c: Likewise. + * dwarf_highpc.c: Likewise. + * dwarf_lowpc.c: Likewise. + * libdwP.h: Add prototypes for internal functions. + Define Dwarf_Func_s structure. + +2005-03-29 Ulrich Drepper <drepper@redhat.com> + + * libdw.h: Add padding in Dwarf_die. + + * dwarf_arrayorder.c: Use INTUSE and INTDEF to avoid PLTs. + * dwarf_attr.c: Likewise. + * dwarf_begin.c: Likewise. + * dwarf_begin_elf.c: Likewise. + * dwarf_bitoffset.c: Likewise. + * dwarf_bitsize.c: Likewise. + * dwarf_bytesize.c: Likewise. + * dwarf_diename.c: Likewise. + * dwarf_formaddr.c: Likewise. + * dwarf_formblock.c: Likewise. + * dwarf_formref.c: Likewise. + * dwarf_formstring.c: Likewise. + * dwarf_formudata.c: Likewise. + * dwarf_getarange_addr.c: Likewise. + * dwarf_getarangeinfo.c: Likewise. + * dwarf_getaranges.c: Likewise. + * dwarf_getloclist.c: Likewise. + * dwarf_getmacros.c: Likewise. + * dwarf_getsrc_die.c: Likewise. + * dwarf_getsrcfiles.c: Likewise. + * dwarf_getsrclines.c: Likewise. + * dwarf_highpc.c: Likewise. + * dwarf_lowpc.c: Likewise. + * dwarf_nextcu.c: Likewise. + * dwarf_offdie.c: Likewise. + * dwarf_siblingof.c: Likewise. + * dwarf_srclang.c: Likewise. + * dwarf_tag.c: Likewise. + * libdw_findcu.c: Likewise. + * libdwP.h: Add prototypes for internal functions. + + * dwarf_addrdie.c: New file. + * dwarf_macro_opcode.c: New file. + * dwarf_macro_param1.c: New file. + * dwarf_macro_param2.c: New file. + * libdw.h: Add declarations. Move Dwarf_Macro definition to libdwP.h. + * libdwP.h: Remove Dwarf_Macro definition. + * Makefile.am (libdw_a_SOURCES): Add dwarf_addrdie.c, + dwarf_macro_opcode.c, dwarf_macro_param1.c, and dwarf_macro_param2.c. + * libdw.map: Add entries for new functions. + +2005-03-21 Ulrich Drepper <drepper@redhat.com> + + * libdw.h: Handle broken gcc < 4. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. + + * dwarf_begin_elf.c: Fix warnings. + * dwarf_dieoffset.c: Likewise. + * dwarf_end.c: Likewise. + * dwarf_error.c: Likewise. + * dwarf_getpubnames.c: Likewise. + + * libdwP.h: Add new error values. + * dwarf_error.c: Support new error values. + * dwarf_getpubnames.c: Check parameter value. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Check for text relocations in constructed DSO. + + * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. + +2005-02-04 Ulrich Drepper <drepper@redhat.com> + + * dwarf_siblingof.c (dwarf_siblingof): Add some buffer boundary + checks to not read over buffer boundaries for ill-formed DWARF data. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * dwarf_child.c: Make compile with gcc 4.0. diff --git a/elfutils/libdw/Makefile.am b/elfutils/libdw/Makefile.am index e452b43e..cdecf32d 100644 --- a/elfutils/libdw/Makefile.am +++ b/elfutils/libdw/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Makefile for libdw. ## -## Copyright (C) 2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -15,10 +14,11 @@ ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H if MUDFLAP -AM_CFLAGS = -Wall -Wshadow -std=gnu99 +AM_CFLAGS = -fmudflap else -AM_CFLAGS = -Wall -Werror -Wshadow -std=gnu99 +AM_CFLAGS = endif +AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib VERSION = 1 @@ -55,7 +55,11 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ dwarf_getloclist.c dwarf_getstring.c dwarf_offabbrev.c \ dwarf_getaranges.c dwarf_onearange.c dwarf_getarangeinfo.c \ dwarf_getarange_addr.c dwarf_getattrs.c dwarf_formflag.c \ - dwarf_getmacros.c \ + dwarf_getmacros.c dwarf_macro_opcode.c dwarf_macro_param1.c \ + dwarf_macro_param2.c dwarf_addrdie.c \ + dwarf_getfuncs.c dwarf_func_name.c dwarf_func_lowpc.c \ + dwarf_func_highpc.c dwarf_func_entrypc.c dwarf_func_file.c \ + dwarf_func_line.c dwarf_func_col.c dwarf_getsrc_file.c \ libdw_findcu.c libdw_form.c libdw_alloc.c @@ -69,6 +73,7 @@ libdw.so: libdw_pic.a $(srcdir)/libdw.map -Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \ -Wl,--soname,$@.$(VERSION),-z,defs \ ../libelf/libelf.so + if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) diff --git a/elfutils/libdw/Makefile.in b/elfutils/libdw/Makefile.in index 9ceb5d51..44ac5252 100644 --- a/elfutils/libdw/Makefile.in +++ b/elfutils/libdw/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -48,8 +48,6 @@ DIST_COMMON = $(euinclude_HEADERS) $(include_HEADERS) \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -102,8 +100,15 @@ am_libdw_a_OBJECTS = dwarf_begin.$(OBJEXT) dwarf_begin_elf.$(OBJEXT) \ dwarf_getaranges.$(OBJEXT) dwarf_onearange.$(OBJEXT) \ dwarf_getarangeinfo.$(OBJEXT) dwarf_getarange_addr.$(OBJEXT) \ dwarf_getattrs.$(OBJEXT) dwarf_formflag.$(OBJEXT) \ - dwarf_getmacros.$(OBJEXT) libdw_findcu.$(OBJEXT) \ - libdw_form.$(OBJEXT) libdw_alloc.$(OBJEXT) + dwarf_getmacros.$(OBJEXT) dwarf_macro_opcode.$(OBJEXT) \ + dwarf_macro_param1.$(OBJEXT) dwarf_macro_param2.$(OBJEXT) \ + dwarf_addrdie.$(OBJEXT) dwarf_getfuncs.$(OBJEXT) \ + dwarf_func_name.$(OBJEXT) dwarf_func_lowpc.$(OBJEXT) \ + dwarf_func_highpc.$(OBJEXT) dwarf_func_entrypc.$(OBJEXT) \ + dwarf_func_file.$(OBJEXT) dwarf_func_line.$(OBJEXT) \ + dwarf_func_col.$(OBJEXT) dwarf_getsrc_file.$(OBJEXT) \ + libdw_findcu.$(OBJEXT) libdw_form.$(OBJEXT) \ + libdw_alloc.$(OBJEXT) libdw_a_OBJECTS = $(am_libdw_a_OBJECTS) libdw_pic_a_AR = $(AR) $(ARFLAGS) libdw_pic_a_LIBADD = @@ -141,7 +146,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -150,25 +154,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -186,7 +184,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -234,8 +231,10 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -std=gnu99 -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ +@MUDFLAP_FALSE@ -Wextra -std=gnu99 +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \ +@MUDFLAP_TRUE@ -Wformat=2 -Wextra -std=gnu99 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib lib_LIBRARIES = libdw.a @MUDFLAP_FALSE@noinst_LIBRARIES = libdw_pic.a @@ -265,7 +264,11 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ dwarf_getloclist.c dwarf_getstring.c dwarf_offabbrev.c \ dwarf_getaranges.c dwarf_onearange.c dwarf_getarangeinfo.c \ dwarf_getarange_addr.c dwarf_getattrs.c dwarf_formflag.c \ - dwarf_getmacros.c \ + dwarf_getmacros.c dwarf_macro_opcode.c dwarf_macro_param1.c \ + dwarf_macro_param2.c dwarf_addrdie.c \ + dwarf_getfuncs.c dwarf_func_name.c dwarf_func_lowpc.c \ + dwarf_func_highpc.c dwarf_func_entrypc.c dwarf_func_file.c \ + dwarf_func_line.c dwarf_func_col.c dwarf_getsrc_file.c \ libdw_findcu.c libdw_form.c libdw_alloc.c @MUDFLAP_FALSE@libdw_pic_a_SOURCES = @@ -362,6 +365,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_abbrev_hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_abbrevhaschildren.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_addrdie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_arrayorder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_attr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_begin.Po@am__quote@ @@ -383,6 +387,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_formsdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_formstring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_formudata.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_col.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_entrypc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_highpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_line.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_lowpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_func_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getabbrev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getabbrevattr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getabbrevcode.Po@am__quote@ @@ -393,10 +404,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getattrcnt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getattrs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getelf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getfuncs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getloclist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getmacros.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getpubnames.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getsrc_die.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getsrc_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getsrcfiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getsrclines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getstring.Po@am__quote@ @@ -414,6 +427,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_lineprologueend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_linesrc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_lowpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_macro_opcode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_macro_param1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_macro_param2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_nextcu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_offabbrev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_offdie.Po@am__quote@ @@ -655,6 +671,7 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-includeHEADERS \ @MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \ @MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION),-z,defs \ @MUDFLAP_FALSE@ ../libelf/libelf.so +@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION) @MUDFLAP_FALSE@%.os: %.c %.o diff --git a/elfutils/libdw/dwarf.h b/elfutils/libdw/dwarf.h index 69be35a7..ce011aac 100644 --- a/elfutils/libdw/dwarf.h +++ b/elfutils/libdw/dwarf.h @@ -1,5 +1,5 @@ /* This file defines standard DWARF types, structures, and macros. - Copyright (C) 2000, 2002 Red Hat, Inc. + Copyright (C) 2000, 2002, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -64,6 +64,15 @@ enum DW_TAG_variant_part = 0x33, DW_TAG_variable = 0x34, DW_TAG_volatile_type = 0x35, + DW_TAG_dwarf_procedure = 0x36, + DW_TAG_restrict_type = 0x37, + DW_TAG_interface_type = 0x38, + DW_TAG_namespace = 0x39, + DW_TAG_imported_module = 0x3a, + DW_TAG_unspecified_type = 0x3b, + DW_TAG_partial_unit = 0x3c, + DW_TAG_imported_unit = 0x3d, + DW_TAG_mutable_type = 0x3e, DW_TAG_lo_user = 0x4080, DW_TAG_MIPS_loop = 0x4081, DW_TAG_format_label = 0x4101, @@ -146,6 +155,19 @@ enum DW_AT_variable_parameter = 0x4b, DW_AT_virtuality = 0x4c, DW_AT_vtable_elem_location = 0x4d, + DW_AT_allocated = 0x4e, + DW_AT_associated = 0x4f, + DW_AT_data_location = 0x50, + DW_AT_stride = 0x51, + DW_AT_entry_pc = 0x52, + DW_AT_use_UTF8 = 0x53, + DW_AT_extension = 0x54, + DW_AT_ranges = 0x55, + DW_AT_trampoline = 0x56, + DW_AT_call_column = 0x57, + DW_AT_call_file = 0x58, + DW_AT_call_line = 0x59, + DW_AT_description = 0x5a, DW_AT_lo_user = 0x2000, DW_AT_MIPS_fde = 0x2001, DW_AT_MIPS_loop_begin = 0x2002, @@ -371,6 +393,7 @@ enum DW_ATE_signed_char = 0x6, DW_ATE_unsigned = 0x7, DW_ATE_unsigned_char = 0x8, + DW_ATE_imaginary_float = 0x9, DW_ATE_lo_user = 0x80, DW_ATE_hi_user = 0xff @@ -488,7 +511,8 @@ enum DW_LNS_const_add_pc = 8, DW_LNS_fixed_advance_pc = 9, DW_LNS_set_prologue_end = 10, - DW_LNS_set_epilog_begin = 11 + DW_LNS_set_epilog_begin = 11, + DW_LNS_set_isa = 12 }; @@ -497,7 +521,10 @@ enum { DW_LNE_end_sequence = 1, DW_LNE_set_address = 2, - DW_LNE_define_file = 3 + DW_LNE_define_file = 3, + + DW_LNE_lo_user = 128, + DW_LNE_hi_user = 255 }; diff --git a/elfutils/libdw/dwarf_addrdie.c b/elfutils/libdw/dwarf_addrdie.c new file mode 100644 index 00000000..c3fd4661 --- /dev/null +++ b/elfutils/libdw/dwarf_addrdie.c @@ -0,0 +1,39 @@ +/* Return CU DIE containing given address. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +Dwarf_Die * +dwarf_addrdie (dbg, addr, result) + Dwarf *dbg; + Dwarf_Addr addr; + Dwarf_Die *result; +{ + Dwarf_Aranges *aranges; + size_t naranges; + Dwarf_Off off; + + if (INTUSE(dwarf_getaranges) (dbg, &aranges, &naranges) != 0 + || INTUSE(dwarf_getarangeinfo) (INTUSE(dwarf_getarange_addr) (aranges, + addr), + NULL, NULL, &off) != 0) + return NULL; + + return INTUSE(dwarf_offdie) (dbg, off, result); +} diff --git a/elfutils/libdw/dwarf_arrayorder.c b/elfutils/libdw/dwarf_arrayorder.c index 072e70db..a1ea09fa 100644 --- a/elfutils/libdw/dwarf_arrayorder.c +++ b/elfutils/libdw/dwarf_arrayorder.c @@ -1,5 +1,5 @@ /* Return array order attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,7 @@ dwarf_arrayorder (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return dwarf_formudata (dwarf_attr (die, DW_AT_ordering, &attr_mem), - &value) == 0 ? (int) value : -1; + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_ordering, + &attr_mem), + &value) == 0 ? (int) value : -1; } diff --git a/elfutils/libdw/dwarf_attr.c b/elfutils/libdw/dwarf_attr.c index a09f11ac..8ebbb8f5 100644 --- a/elfutils/libdw/dwarf_attr.c +++ b/elfutils/libdw/dwarf_attr.c @@ -1,5 +1,5 @@ /* Return specific DWARF attribute of a DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -37,3 +37,4 @@ dwarf_attr (die, search_name, result) return result->code == search_name ? result : NULL; } +INTDEF(dwarf_attr) diff --git a/elfutils/libdw/dwarf_begin.c b/elfutils/libdw/dwarf_begin.c index a2ffa1c6..70a1b07d 100644 --- a/elfutils/libdw/dwarf_begin.c +++ b/elfutils/libdw/dwarf_begin.c @@ -1,5 +1,5 @@ /* Create descriptor from file descriptor for processing file. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -72,7 +72,7 @@ dwarf_begin (fd, cmd) else { /* Do the real work now that we have an ELF descriptor. */ - result = dwarf_begin_elf (elf, cmd, NULL); + result = INTUSE(dwarf_begin_elf) (elf, cmd, NULL); /* If this failed, free the resources. */ if (result == NULL) diff --git a/elfutils/libdw/dwarf_begin_elf.c b/elfutils/libdw/dwarf_begin_elf.c index a9aa197c..a02d509f 100644 --- a/elfutils/libdw/dwarf_begin_elf.c +++ b/elfutils/libdw/dwarf_begin_elf.c @@ -1,5 +1,5 @@ /* Create descriptor from ELF descriptor for processing file. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -127,7 +127,7 @@ valid_p (Dwarf *result) static Dwarf * -global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Dwarf_Cmd cmd) +global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr) { Elf_Scn *scn = NULL; @@ -139,8 +139,7 @@ global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Dwarf_Cmd cmd) static Dwarf * -scngrp_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Dwarf_Cmd cmd, - Elf_Scn *scngrp) +scngrp_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Elf_Scn *scngrp) { /* SCNGRP is the section descriptor for a section group which might contain debug sections. */ @@ -234,9 +233,9 @@ dwarf_begin_elf (elf, cmd, scngrp) sections with the name are ignored. The DWARF specification does not really say this is allowed. */ if (scngrp == NULL) - return global_read (result, elf, ehdr, cmd); + return global_read (result, elf, ehdr); else - return scngrp_read (result, elf, ehdr, cmd, scngrp); + return scngrp_read (result, elf, ehdr, scngrp); } else if (cmd == DWARF_C_WRITE) { @@ -249,3 +248,4 @@ dwarf_begin_elf (elf, cmd, scngrp) free (result); return NULL; } +INTDEF(dwarf_begin_elf) diff --git a/elfutils/libdw/dwarf_bitoffset.c b/elfutils/libdw/dwarf_bitoffset.c index 6addbd72..52ab1759 100644 --- a/elfutils/libdw/dwarf_bitoffset.c +++ b/elfutils/libdw/dwarf_bitoffset.c @@ -1,5 +1,5 @@ /* Return bit offset attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,7 @@ dwarf_bitoffset (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return dwarf_formudata (dwarf_attr (die, DW_AT_bit_offset, &attr_mem), - &value) == 0 ? (int) value : -1; + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_bit_offset, + &attr_mem), + &value) == 0 ? (int) value : -1; } diff --git a/elfutils/libdw/dwarf_bitsize.c b/elfutils/libdw/dwarf_bitsize.c index 93688243..c67b4ccf 100644 --- a/elfutils/libdw/dwarf_bitsize.c +++ b/elfutils/libdw/dwarf_bitsize.c @@ -1,5 +1,5 @@ /* Return bit size attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,7 @@ dwarf_bitsize (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return dwarf_formudata (dwarf_attr (die, DW_AT_bit_size, &attr_mem), - &value) == 0 ? (int) value : -1; + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_bit_size, + &attr_mem), + &value) == 0 ? (int) value : -1; } diff --git a/elfutils/libdw/dwarf_bytesize.c b/elfutils/libdw/dwarf_bytesize.c index 8374676d..3e0b05a8 100644 --- a/elfutils/libdw/dwarf_bytesize.c +++ b/elfutils/libdw/dwarf_bytesize.c @@ -1,5 +1,5 @@ /* Return byte size attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,7 @@ dwarf_bytesize (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return dwarf_formudata (dwarf_attr (die, DW_AT_byte_size, &attr_mem), - &value) == 0 ? (int) value : -1; + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_byte_size, + &attr_mem), + &value) == 0 ? (int) value : -1; } diff --git a/elfutils/libdw/dwarf_child.c b/elfutils/libdw/dwarf_child.c index 0ccac099..fc27a0c1 100644 --- a/elfutils/libdw/dwarf_child.c +++ b/elfutils/libdw/dwarf_child.c @@ -1,5 +1,5 @@ /* Return vhild of current DIE. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -156,3 +156,4 @@ dwarf_child (die, result) return 0; } +INTDEF(dwarf_child) diff --git a/elfutils/libdw/dwarf_diename.c b/elfutils/libdw/dwarf_diename.c index 78555dc3..41d763c5 100644 --- a/elfutils/libdw/dwarf_diename.c +++ b/elfutils/libdw/dwarf_diename.c @@ -1,5 +1,5 @@ /* Return string in name attribute of DIE. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -26,5 +26,6 @@ dwarf_diename (die) { Dwarf_Attribute attr_mem; - return dwarf_formstring (dwarf_attr (die, DW_AT_name, &attr_mem)); + return INTUSE(dwarf_formstring) (INTUSE(dwarf_attr) (die, DW_AT_name, + &attr_mem)); } diff --git a/elfutils/libdw/dwarf_dieoffset.c b/elfutils/libdw/dwarf_dieoffset.c index 2657c223..e678a404 100644 --- a/elfutils/libdw/dwarf_dieoffset.c +++ b/elfutils/libdw/dwarf_dieoffset.c @@ -1,5 +1,5 @@ /* Return offset of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -25,6 +25,8 @@ dwarf_dieoffset (die) Dwarf_Die *die; { return (die == NULL - ? -1l - : die->addr - die->cu->dbg->sectiondata[IDX_debug_info]->d_buf); + ? ~0ul + : (Dwarf_Off) (die->addr + - die->cu->dbg->sectiondata[IDX_debug_info]->d_buf)); } +INTDEF(dwarf_dieoffset) diff --git a/elfutils/libdw/dwarf_end.c b/elfutils/libdw/dwarf_end.c index 0745d717..935bd3d2 100644 --- a/elfutils/libdw/dwarf_end.c +++ b/elfutils/libdw/dwarf_end.c @@ -1,5 +1,5 @@ /* Release debugging handling context. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -24,7 +24,7 @@ static void -noop_free (void *arg) +noop_free (void *arg __attribute__ ((unused))) { } diff --git a/elfutils/libdw/dwarf_error.c b/elfutils/libdw/dwarf_error.c index fe8966ee..dfd2171c 100644 --- a/elfutils/libdw/dwarf_error.c +++ b/elfutils/libdw/dwarf_error.c @@ -1,5 +1,5 @@ /* Retrieve ELF descriptor used for DWARF access. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -104,6 +104,7 @@ static const char *errmsgs[] = [DWARF_E_INVALID_ARANGE_IDX] = N_("invalid address range index"), [DWARF_E_NO_MATCH] = N_("no matching address range"), [DWARF_E_NO_FLAG] = N_("no flag value"), + [DWARF_E_INVALID_OFFSET] = N_("invalid offset"), }; #define nerrmsgs (sizeof (errmsgs) / sizeof (errmsgs[0])) @@ -157,7 +158,7 @@ dwarf_errmsg (error) #ifndef USE_TLS /* Free the thread specific data, this is done if a thread terminates. */ static void -free_key_mem (void *mem) +free_key_mem (void *mem __attribute__ ((unused))) { setspecific (key, NULL); } diff --git a/elfutils/libdw/dwarf_formaddr.c b/elfutils/libdw/dwarf_formaddr.c index 4e8cdb0b..168eb89a 100644 --- a/elfutils/libdw/dwarf_formaddr.c +++ b/elfutils/libdw/dwarf_formaddr.c @@ -1,5 +1,5 @@ /* Return address represented by attribute. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -41,3 +41,4 @@ dwarf_formaddr (attr, return_addr) return 0; } +INTDEF(dwarf_formaddr) diff --git a/elfutils/libdw/dwarf_formblock.c b/elfutils/libdw/dwarf_formblock.c index 08566829..19169e29 100644 --- a/elfutils/libdw/dwarf_formblock.c +++ b/elfutils/libdw/dwarf_formblock.c @@ -1,5 +1,5 @@ /* Return block represented by attribute. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -71,3 +71,4 @@ dwarf_formblock (attr, return_block) return 0; } +INTDEF(dwarf_formblock) diff --git a/elfutils/libdw/dwarf_formref.c b/elfutils/libdw/dwarf_formref.c index d6b1f0f6..aca74308 100644 --- a/elfutils/libdw/dwarf_formref.c +++ b/elfutils/libdw/dwarf_formref.c @@ -1,5 +1,5 @@ /* Return reference offset represented by attribute. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -66,3 +66,4 @@ dwarf_formref (attr, return_offset) return 0; } +INTDEF(dwarf_formref) diff --git a/elfutils/libdw/dwarf_formsdata.c b/elfutils/libdw/dwarf_formsdata.c index ad845102..13a785c4 100644 --- a/elfutils/libdw/dwarf_formsdata.c +++ b/elfutils/libdw/dwarf_formsdata.c @@ -1,5 +1,5 @@ /* Return signed constant represented by attribute. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -68,3 +68,4 @@ dwarf_formsdata (attr, return_sval) return 0; } +INTDEF(dwarf_formsdata) diff --git a/elfutils/libdw/dwarf_formstring.c b/elfutils/libdw/dwarf_formstring.c index c4e59d78..eac1cc05 100644 --- a/elfutils/libdw/dwarf_formstring.c +++ b/elfutils/libdw/dwarf_formstring.c @@ -1,5 +1,5 @@ /* Return string associated with given attribute. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -55,3 +55,4 @@ dwarf_formstring (attrp) return (const char *) dbg->sectiondata[IDX_debug_str]->d_buf + off; } +INTDEF(dwarf_formstring) diff --git a/elfutils/libdw/dwarf_formudata.c b/elfutils/libdw/dwarf_formudata.c index 66b8c2a3..5483af81 100644 --- a/elfutils/libdw/dwarf_formudata.c +++ b/elfutils/libdw/dwarf_formudata.c @@ -1,5 +1,5 @@ /* Return unsigned constant represented by attribute. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -68,3 +68,4 @@ dwarf_formudata (attr, return_uval) return 0; } +INTDEF(dwarf_formudata) diff --git a/elfutils/libdw/dwarf_func_col.c b/elfutils/libdw/dwarf_func_col.c new file mode 100644 index 00000000..feda1435 --- /dev/null +++ b/elfutils/libdw/dwarf_func_col.c @@ -0,0 +1,27 @@ +/* Get line number of beginning of given function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <dwarf.h> +#include "libdwP.h" + + +int +dwarf_func_col (Dwarf_Func *func, int *colp) +{ + return __libdw_func_intval (func, colp, DW_AT_decl_column); +} diff --git a/elfutils/libdw/dwarf_func_entrypc.c b/elfutils/libdw/dwarf_func_entrypc.c new file mode 100644 index 00000000..6b5103e0 --- /dev/null +++ b/elfutils/libdw/dwarf_func_entrypc.c @@ -0,0 +1,33 @@ +/* Get entry address of function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <dwarf.h> +#include "libdwP.h" + + +int +dwarf_func_entrypc (Dwarf_Func *func, Dwarf_Addr *return_addr) +{ + Dwarf_Attribute attr_mem; + Dwarf_Attribute *attr = INTUSE(dwarf_attr) (func->die, DW_AT_entry_pc, + &attr_mem); + if (attr != NULL) + return INTUSE(dwarf_formaddr) (attr, return_addr); + + return INTUSE(dwarf_lowpc) (func->die, return_addr); +} diff --git a/elfutils/libdw/dwarf_func_file.c b/elfutils/libdw/dwarf_func_file.c new file mode 100644 index 00000000..d5302df0 --- /dev/null +++ b/elfutils/libdw/dwarf_func_file.c @@ -0,0 +1,72 @@ +/* Return file name containing definition of the given function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <assert.h> +#include <dwarf.h> +#include "libdwP.h" + + +const char * +dwarf_func_file (Dwarf_Func *func) +{ + Dwarf_Attribute attr_mem; + Dwarf_Sword idx = 0; + Dwarf_Die *die = func->die; + + if (INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr) (die, DW_AT_decl_file, + &attr_mem), &idx) != 0) + return NULL; + + /* Zero means no source file information available. */ + if (idx == 0) + { + __libdw_seterrno (DWARF_E_NO_ENTRY); + return NULL; + } + + /* Get the array of source files for the CU. */ + struct Dwarf_CU *cu = die->cu; + if (cu->lines == NULL) + { + Dwarf_Lines *lines; + size_t nlines; + + /* Let the more generic function do the work. It'll create more + data but that will be needed in an real program anyway. */ + (void) INTUSE(dwarf_getsrclines) (func->cudie, &lines, &nlines); + assert (cu->lines != NULL); + } + + if (cu->lines == (void *) -1l) + { + /* If the file index is not zero, there must be file information + available. */ + __libdw_seterrno (DWARF_E_INVALID_DWARF); + return NULL; + } + + assert (cu->files != NULL && cu->files != (void *) -1l); + + if (idx >= cu->files->nfiles) + { + __libdw_seterrno (DWARF_E_INVALID_DWARF); + return NULL; + } + + return cu->files->info[idx].name; +} diff --git a/elfutils/libdw/dwarf_func_highpc.c b/elfutils/libdw/dwarf_func_highpc.c new file mode 100644 index 00000000..c5d2eec3 --- /dev/null +++ b/elfutils/libdw/dwarf_func_highpc.c @@ -0,0 +1,26 @@ +/* Get end address of function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +int +dwarf_func_highpc (Dwarf_Func *func, Dwarf_Addr *return_addr) +{ + return INTUSE(dwarf_highpc) (func->die, return_addr); +} diff --git a/elfutils/libdw/dwarf_func_line.c b/elfutils/libdw/dwarf_func_line.c new file mode 100644 index 00000000..6259b9f1 --- /dev/null +++ b/elfutils/libdw/dwarf_func_line.c @@ -0,0 +1,47 @@ +/* Get line number of beginning of given function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <assert.h> +#include <dwarf.h> +#include <limits.h> +#include "libdwP.h" + + +int +dwarf_func_line (Dwarf_Func *func, int *linep) +{ + return __libdw_func_intval (func, linep, DW_AT_decl_line); +} + + +int internal_function +__libdw_func_intval (Dwarf_Func *func, int *linep, int attval) +{ + Dwarf_Attribute attr_mem; + Dwarf_Sword line; + + int res = INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr) (func->die, attval, + &attr_mem), &line); + if (res == 0) + { + assert (line >= 0 && line <= INT_MAX); + *linep = line; + } + + return res; +} diff --git a/elfutils/libdw/dwarf_func_lowpc.c b/elfutils/libdw/dwarf_func_lowpc.c new file mode 100644 index 00000000..d364e6c6 --- /dev/null +++ b/elfutils/libdw/dwarf_func_lowpc.c @@ -0,0 +1,26 @@ +/* Get start address of function. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +int +dwarf_func_lowpc (Dwarf_Func *func, Dwarf_Addr *return_addr) +{ + return INTUSE(dwarf_lowpc) (func->die, return_addr); +} diff --git a/elfutils/libdw/dwarf_func_name.c b/elfutils/libdw/dwarf_func_name.c new file mode 100644 index 00000000..4151c359 --- /dev/null +++ b/elfutils/libdw/dwarf_func_name.c @@ -0,0 +1,30 @@ +/* Get function name. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <dwarf.h> +#include "libdwP.h" + + +const char * +dwarf_func_name (Dwarf_Func *func) +{ + Dwarf_Attribute attr_mem; + + return INTUSE(dwarf_formstring) (INTUSE(dwarf_attr) (func->die, DW_AT_name, + &attr_mem)); +} diff --git a/elfutils/libdw/dwarf_getabbrev.c b/elfutils/libdw/dwarf_getabbrev.c index 0021e222..dc89823d 100644 --- a/elfutils/libdw/dwarf_getabbrev.c +++ b/elfutils/libdw/dwarf_getabbrev.c @@ -1,5 +1,5 @@ /* Get abbreviation at given offset. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -38,7 +38,7 @@ __libdw_getabbrev (dbg, cu, offset, lengthp, result) = (unsigned char *) dbg->sectiondata[IDX_debug_abbrev]->d_buf + offset; if (*abbrevp == '\0') /* We are past the last entry. */ - return NULL; + return DWARF_END_ABBREV; /* 7.5.3 Abbreviations Tables diff --git a/elfutils/libdw/dwarf_getarange_addr.c b/elfutils/libdw/dwarf_getarange_addr.c index df143d02..9c6b4cfb 100644 --- a/elfutils/libdw/dwarf_getarange_addr.c +++ b/elfutils/libdw/dwarf_getarange_addr.c @@ -1,5 +1,5 @@ /* Get address range which includes given address. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -35,3 +35,4 @@ dwarf_getarange_addr (aranges, addr) __libdw_seterrno (DWARF_E_NO_MATCH); return NULL; } +INTDEF(dwarf_getarange_addr) diff --git a/elfutils/libdw/dwarf_getarangeinfo.c b/elfutils/libdw/dwarf_getarangeinfo.c index b96c6316..eb1f539d 100644 --- a/elfutils/libdw/dwarf_getarangeinfo.c +++ b/elfutils/libdw/dwarf_getarangeinfo.c @@ -1,5 +1,5 @@ /* Return list address ranges. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -35,3 +35,4 @@ dwarf_getarangeinfo (Dwarf_Arange *arange, Dwarf_Addr *addrp, return 0; } +INTDEF(dwarf_getarangeinfo) diff --git a/elfutils/libdw/dwarf_getaranges.c b/elfutils/libdw/dwarf_getaranges.c index 754baeca..9cf18e8e 100644 --- a/elfutils/libdw/dwarf_getaranges.c +++ b/elfutils/libdw/dwarf_getaranges.c @@ -1,5 +1,5 @@ /* Return list address ranges. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -182,3 +182,4 @@ dwarf_getaranges (dbg, aranges, naranges) return 0; } +INTDEF(dwarf_getaranges) diff --git a/elfutils/libdw/dwarf_getfuncs.c b/elfutils/libdw/dwarf_getfuncs.c new file mode 100644 index 00000000..149f1860 --- /dev/null +++ b/elfutils/libdw/dwarf_getfuncs.c @@ -0,0 +1,63 @@ +/* Get function information. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <dwarf.h> +#include "libdwP.h" + + +ptrdiff_t +dwarf_getfuncs (Dwarf_Die *cudie, int (*callback) (Dwarf_Func *, void *), + void *arg, ptrdiff_t offset) +{ + if (unlikely (cudie == NULL + || INTUSE(dwarf_tag) (cudie) != DW_TAG_compile_unit)) + return -1; + + Dwarf_Die die_mem; + Dwarf_Die *die; + + int res; + if (offset == 0) + res = INTUSE(dwarf_child) (cudie, &die_mem); + else + { + die = INTUSE(dwarf_offdie) (cudie->cu->dbg, offset, &die_mem); + res = INTUSE(dwarf_siblingof) (die, &die_mem); + } + die = res != 0 ? NULL : &die_mem; + + while (die != NULL) + { + if (INTUSE(dwarf_tag) (die) == DW_TAG_subprogram) + { + Dwarf_Func fct; + + fct.die = die; + fct.cudie = cudie; + + if (callback (&fct, arg) != DWARF_CB_OK) + return INTUSE(dwarf_dieoffset) (die); + } + + if (INTUSE(dwarf_siblingof) (die, &die_mem) != 0) + break; + } + + /* That's all. */ + return 0; +} diff --git a/elfutils/libdw/dwarf_getloclist.c b/elfutils/libdw/dwarf_getloclist.c index 6339a8c8..152af649 100644 --- a/elfutils/libdw/dwarf_getloclist.c +++ b/elfutils/libdw/dwarf_getloclist.c @@ -1,5 +1,5 @@ /* Return location expression list. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -71,7 +71,7 @@ dwarf_getloclist (attr, llbuf, listlen) /* Must have the form data4 or data8 which act as an offset. */ Dwarf_Block block; - if (dwarf_formblock (attr, &block) != 0) + if (INTUSE(dwarf_formblock) (attr, &block) != 0) return -1; /* Check whether we already looked at this list. */ diff --git a/elfutils/libdw/dwarf_getmacros.c b/elfutils/libdw/dwarf_getmacros.c index f6f933aa..c1abdcec 100644 --- a/elfutils/libdw/dwarf_getmacros.c +++ b/elfutils/libdw/dwarf_getmacros.c @@ -1,5 +1,5 @@ -/* Get public symbol information. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. +/* Get macro information. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -31,12 +31,12 @@ dwarf_getmacros (die, callback, arg, offset) { /* Get the appropriate attribute. */ Dwarf_Attribute attr; - if (dwarf_attr (die, DW_AT_macro_info, &attr) == NULL) + if (INTUSE(dwarf_attr) (die, DW_AT_macro_info, &attr) == NULL) return -1; /* Offset into the .debug_macinfo section. */ Dwarf_Word macoff; - if (dwarf_formudata (&attr, &macoff) != 0) + if (INTUSE(dwarf_formudata) (&attr, &macoff) != 0) return -1; const unsigned char *readp diff --git a/elfutils/libdw/dwarf_getpubnames.c b/elfutils/libdw/dwarf_getpubnames.c index c3cb5e2e..5700cd77 100644 --- a/elfutils/libdw/dwarf_getpubnames.c +++ b/elfutils/libdw/dwarf_getpubnames.c @@ -1,5 +1,5 @@ /* Get public symbol information. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -127,9 +127,16 @@ dwarf_getpubnames (dbg, callback, arg, offset) if (dbg == NULL) return -1l; + if (offset < 0) + { + __libdw_seterrno (DWARF_E_INVALID_OFFSET); + return -1l; + } + /* Make sure it is a valid offset. */ if (unlikely (dbg->sectiondata[IDX_debug_pubnames] == NULL - || offset >= dbg->sectiondata[IDX_debug_pubnames]->d_size)) + || ((size_t) offset + >= dbg->sectiondata[IDX_debug_pubnames]->d_size))) /* No (more) entry. */ return 0; @@ -147,9 +154,10 @@ dwarf_getpubnames (dbg, callback, arg, offset) else { for (cnt = 0; cnt + 1 < dbg->pubnames_nsets; ++cnt) - if (offset >= dbg->pubnames_sets[cnt].set_start) + if ((Dwarf_Off) offset >= dbg->pubnames_sets[cnt].set_start) { - assert (offset < dbg->pubnames_sets[cnt + 1].set_start); + assert ((Dwarf_Off) offset + < dbg->pubnames_sets[cnt + 1].set_start); break; } assert (cnt + 1 < dbg->pubnames_nsets); diff --git a/elfutils/libdw/dwarf_getsrc_die.c b/elfutils/libdw/dwarf_getsrc_die.c index 33cbd7b3..e3ce4f2a 100644 --- a/elfutils/libdw/dwarf_getsrc_die.c +++ b/elfutils/libdw/dwarf_getsrc_die.c @@ -1,5 +1,5 @@ /* Find line information for address. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -17,6 +17,7 @@ #endif #include "libdwP.h" +#include <assert.h> Dwarf_Line * @@ -25,13 +26,32 @@ dwarf_getsrc_die (Dwarf_Die *cudie, Dwarf_Addr addr) Dwarf_Lines *lines; size_t nlines; - if (dwarf_getsrclines (cudie, &lines, &nlines) != 0) + if (INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines) != 0) return NULL; - if (addr >= lines->info[0].addr ) - for (size_t n = 1; n < nlines; ++n) - if (addr < lines->info[n].addr) - return &lines->info[n - 1]; + /* The lines are sorted by address, so we can use binary search. */ + size_t l = 0, u = nlines; + while (l < u) + { + size_t idx = (l + u) / 2; + if (addr < lines->info[idx].addr) + u = idx; + else if (addr > lines->info[idx].addr) + l = idx + 1; + else + return &lines->info[idx]; + } + + if (nlines > 0) + assert (lines->info[nlines - 1].end_sequence); + + /* If none were equal, the closest one below is what we want. We + never want the last one, because it's the end-sequence marker + with an address at the high bound of the CU's code. If the debug + information is faulty and no end-sequence marker is present, we + still ignore it. */ + if (u > 0 && u < nlines && addr > lines->info[u - 1].addr) + return &lines->info[u - 1]; __libdw_seterrno (DWARF_E_ADDR_OUTOFRANGE); return NULL; diff --git a/elfutils/libdw/dwarf_getsrc_file.c b/elfutils/libdw/dwarf_getsrc_file.c new file mode 100644 index 00000000..a10581d4 --- /dev/null +++ b/elfutils/libdw/dwarf_getsrc_file.c @@ -0,0 +1,158 @@ +/* Find line information for given file/line/column triple. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <assert.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> + +#include "libdwP.h" + + +int +dwarf_getsrc_file (Dwarf *dbg, const char *fname, int lineno, int column, + Dwarf_Line ***srcsp, size_t *nsrcs) +{ + if (dbg == NULL) + return -1; + + bool is_basename = strchr (fname, '/') == NULL; + + size_t max_match = *nsrcs ?: ~0u; + size_t act_match = *nsrcs; + size_t cur_match = 0; + Dwarf_Line **match = *nsrcs == 0 ? NULL : *srcsp; + + Dwarf_Off off = 0; + size_t cuhl; + Dwarf_Off noff; + + while (INTUSE(dwarf_nextcu) (dbg, off, &noff, &cuhl, NULL, NULL, NULL) == 0) + { + Dwarf_Die cudie_mem; + Dwarf_Die *cudie = INTUSE(dwarf_offdie) (dbg, off + cuhl, &cudie_mem); + if (cudie == NULL) + continue; + + /* Get the line number information for this file. */ + Dwarf_Lines *lines; + size_t nlines; + if (INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines) != 0) + return -1; + + /* Search through all the line number records for a matching + file and line/column number. If any of the numbers is zero, + no match is performed. */ + unsigned int lastfile = UINT_MAX; + bool lastmatch = false; + for (size_t cnt = 0; cnt < nlines; ++cnt) + { + Dwarf_Line *line = &lines->info[cnt]; + + if (lastfile != line->file) + { + lastfile = line->file; + if (lastfile >= line->files->nfiles) + { + __libdw_seterrno (DWARF_E_INVALID_DWARF); + return -1; + } + + /* Match the name with the name the user provided. */ + const char *fname2 = line->files->info[lastfile].name; + if (is_basename) + lastmatch = strcmp (basename (fname2), fname) == 0; + else + lastmatch = strcmp (fname2, fname) == 0; + } + if (!lastmatch) + continue; + + /* See whether line and possibly column match. */ + if (lineno != 0 + && (lineno > line->line + || (column != 0 && column > line->column))) + /* Cannot match. */ + continue; + + /* Determine whether this is the best match so far. */ + size_t inner; + for (inner = 0; inner < cur_match; ++inner) + if (match[inner]->files == line->files + && match[inner]->file == line->file) + break; + if (inner < cur_match + && (match[inner]->line != line->line + || match[inner]->line != lineno + || (column != 0 + && (match[inner]->column != line->column + || match[inner]->column != column)))) + { + /* We know about this file already. If this is a better + match for the line number, use it. */ + if (match[inner]->line >= line->line + && (match[inner]->line != line->line + || match[inner]->column >= line->column)) + /* Use the new line. Otherwise the old one. */ + match[inner] = line; + continue; + } + + if (cur_match < max_match) + { + if (cur_match == act_match) + { + /* Enlarge the array for the results. */ + act_match += 10; + Dwarf_Line **newp = realloc (match, + act_match + * sizeof (Dwarf_Line *)); + if (newp == NULL) + { + free (match); + __libdw_seterrno (DWARF_E_NOMEM); + return -1; + } + match = newp; + } + + match[cur_match++] = line; + } + } + + /* If we managed to find as many matches as the user requested + already, there is no need to go on to the next CU. */ + if (cur_match == max_match) + break; + + off = noff; + } + + if (cur_match > 0) + { + assert (*nsrcs == 0 || *srcsp == match); + + *nsrcs = cur_match; + *srcsp = match; + + return 0; + } + + __libdw_seterrno (DWARF_E_NO_MATCH); + return -1; +} diff --git a/elfutils/libdw/dwarf_getsrcfiles.c b/elfutils/libdw/dwarf_getsrcfiles.c index 1775168d..334c27b6 100644 --- a/elfutils/libdw/dwarf_getsrcfiles.c +++ b/elfutils/libdw/dwarf_getsrcfiles.c @@ -1,5 +1,5 @@ /* Return source file information of CU. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -24,7 +24,8 @@ int dwarf_getsrcfiles (Dwarf_Die *cudie, Dwarf_Files **files, size_t *nfiles) { - if (unlikely (cudie == NULL || dwarf_tag (cudie) != DW_TAG_compile_unit)) + if (unlikely (cudie == NULL + || INTUSE(dwarf_tag) (cudie) != DW_TAG_compile_unit)) return -1; int res = -1; @@ -38,7 +39,7 @@ dwarf_getsrcfiles (Dwarf_Die *cudie, Dwarf_Files **files, size_t *nfiles) /* Let the more generic function do the work. It'll create more data but that will be needed in an real program anyway. */ - res = dwarf_getsrclines (cudie, &lines, &nlines); + res = INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines); } else if (cu->files != (void *) -1l) /* We already have the information. */ diff --git a/elfutils/libdw/dwarf_getsrclines.c b/elfutils/libdw/dwarf_getsrclines.c index a372af2f..74a591c3 100644 --- a/elfutils/libdw/dwarf_getsrclines.c +++ b/elfutils/libdw/dwarf_getsrclines.c @@ -1,5 +1,5 @@ /* Return line number information of CU. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -36,7 +36,18 @@ struct linelist }; -/* Adds a new line to the matrix. We cannot definte a function because +/* Compare by Dwarf_Line.addr, given pointers into an array of pointeers. */ +static int +compare_lines (const void *a, const void *b) +{ + Dwarf_Line *const *p1 = a; + Dwarf_Line *const *p2 = b; + + return (*p1)->addr - (*p2)->addr; +} + + +/* Adds a new line to the matrix. We cannot define a function because we want to use alloca. */ #define NEW_LINE(end_seq) \ do { \ @@ -63,7 +74,8 @@ struct linelist int dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) { - if (unlikely (cudie == NULL || dwarf_tag (cudie) != DW_TAG_compile_unit)) + if (unlikely (cudie == NULL + || INTUSE(dwarf_tag) (cudie) != DW_TAG_compile_unit)) return -1; int res = -1; @@ -78,13 +90,13 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) /* The die must have a statement list associated. */ Dwarf_Attribute stmt_list_mem; - Dwarf_Attribute *stmt_list = dwarf_attr (cudie, DW_AT_stmt_list, - &stmt_list_mem); + Dwarf_Attribute *stmt_list = INTUSE(dwarf_attr) (cudie, DW_AT_stmt_list, + &stmt_list_mem); /* Get the offset into the .debug_line section. NB: this call also checks whether the previous dwarf_attr call failed. */ Dwarf_Word offset; - if (dwarf_formudata (stmt_list, &offset) != 0) + if (INTUSE(dwarf_formudata) (stmt_list, &offset) != 0) goto out; Dwarf *dbg = cu->dbg; @@ -99,9 +111,10 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) /* Get the compilation directory. */ Dwarf_Attribute compdir_attr_mem; - Dwarf_Attribute *compdir_attr = dwarf_attr (cudie, DW_AT_comp_dir, - &compdir_attr_mem); - const char *comp_dir = dwarf_formstring (compdir_attr); + Dwarf_Attribute *compdir_attr = INTUSE(dwarf_attr) (cudie, + DW_AT_comp_dir, + &compdir_attr_mem); + const char *comp_dir = INTUSE(dwarf_formstring) (compdir_attr); if (unlikely (linep + 4 > lineendp)) { @@ -581,18 +594,43 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) /* Make the file data structure available through the CU. */ cu->files = files; - cu->lines = libdw_alloc (dbg, Dwarf_Lines, (sizeof (Dwarf_Lines) + void *buf = libdw_alloc (dbg, Dwarf_Lines, (sizeof (Dwarf_Lines) + (sizeof (Dwarf_Line) * nlinelist)), 1); - cu->lines->nlines = nlinelist; - while (nlinelist-- > 0) + + /* First use the buffer for the pointers, and sort the entries. + We'll write the pointers in the end of the buffer, and then + copy into the buffer from the beginning so the overlap works. */ + assert (sizeof (Dwarf_Line) >= sizeof (Dwarf_Line *)); + Dwarf_Line **sortlines = (buf + sizeof (Dwarf_Lines) + + ((sizeof (Dwarf_Line) + - sizeof (Dwarf_Line *)) * nlinelist)); + + /* The list is in LIFO order and usually they come in clumps with + ascending addresses. So fill from the back to probably start with + runs already in order before we sort. */ + unsigned int i = nlinelist; + while (i-- > 0) { - cu->lines->info[nlinelist] = linelist->line; - cu->lines->info[nlinelist].files = files; + sortlines[i] = &linelist->line; linelist = linelist->next; } assert (linelist == NULL); + /* Sort by ascending address. */ + qsort (sortlines, nlinelist, sizeof sortlines[0], &compare_lines); + + /* Now that they are sorted, put them in the final array. + The buffers overlap, so we've clobbered the early elements + of SORTLINES by the time we're reading the later ones. */ + cu->lines = buf; + cu->lines->nlines = nlinelist; + for (i = 0; i < nlinelist; ++i) + { + cu->lines->info[i] = *sortlines[i]; + cu->lines->info[i].files = files; + } + /* Success. */ res = 0; } @@ -611,3 +649,4 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) return res; } +INTDEF(dwarf_getsrclines) diff --git a/elfutils/libdw/dwarf_highpc.c b/elfutils/libdw/dwarf_highpc.c index 019cf141..d842569a 100644 --- a/elfutils/libdw/dwarf_highpc.c +++ b/elfutils/libdw/dwarf_highpc.c @@ -1,5 +1,5 @@ /* Return high PC attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,8 @@ dwarf_highpc (die, return_addr) { Dwarf_Attribute attr_mem; - return dwarf_formaddr (dwarf_attr (die, DW_AT_high_pc, &attr_mem), - return_addr); + return INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (die, DW_AT_high_pc, + &attr_mem), + return_addr); } +INTDEF(dwarf_highpc) diff --git a/elfutils/libdw/dwarf_lowpc.c b/elfutils/libdw/dwarf_lowpc.c index 95d29120..c8cec0c1 100644 --- a/elfutils/libdw/dwarf_lowpc.c +++ b/elfutils/libdw/dwarf_lowpc.c @@ -1,5 +1,5 @@ /* Return low PC attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,8 @@ dwarf_lowpc (die, return_addr) { Dwarf_Attribute attr_mem; - return dwarf_formaddr (dwarf_attr (die, DW_AT_low_pc, &attr_mem), - return_addr); + return INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (die, DW_AT_low_pc, + &attr_mem), + return_addr); } +INTDEF(dwarf_lowpc) diff --git a/elfutils/libdw/dwarf_macro_opcode.c b/elfutils/libdw/dwarf_macro_opcode.c new file mode 100644 index 00000000..1401db2d --- /dev/null +++ b/elfutils/libdw/dwarf_macro_opcode.c @@ -0,0 +1,31 @@ +/* Return macro opcode. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +int +dwarf_macro_opcode (Dwarf_Macro *macro, unsigned int *opcodep) +{ + if (macro == NULL) + return -1; + + *opcodep = macro->opcode; + + return 0; +} diff --git a/elfutils/libdw/dwarf_macro_param1.c b/elfutils/libdw/dwarf_macro_param1.c new file mode 100644 index 00000000..adac7613 --- /dev/null +++ b/elfutils/libdw/dwarf_macro_param1.c @@ -0,0 +1,31 @@ +/* Return first macro parameter. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +int +dwarf_macro_param1 (Dwarf_Macro *macro, Dwarf_Word *paramp) +{ + if (macro == NULL) + return -1; + + *paramp = macro->param1; + + return 0; +} diff --git a/elfutils/libdw/dwarf_macro_param2.c b/elfutils/libdw/dwarf_macro_param2.c new file mode 100644 index 00000000..1b49aa7f --- /dev/null +++ b/elfutils/libdw/dwarf_macro_param2.c @@ -0,0 +1,34 @@ +/* Return second macro parameter. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libdwP.h" + + +int +dwarf_macro_param2 (Dwarf_Macro *macro, Dwarf_Word *paramp, const char **strp) +{ + if (macro == NULL) + return -1; + + if (paramp != NULL) + *paramp = macro->param2.u; + if (strp != NULL) + *strp = macro->param2.s; + + return 0; +} diff --git a/elfutils/libdw/dwarf_nextcu.c b/elfutils/libdw/dwarf_nextcu.c index e674a66e..9dc7633e 100644 --- a/elfutils/libdw/dwarf_nextcu.c +++ b/elfutils/libdw/dwarf_nextcu.c @@ -1,5 +1,5 @@ /* Advance to next CU header. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -129,3 +129,4 @@ dwarf_nextcu (dwarf, off, next_off, header_sizep, abbrev_offsetp, return 0; } +INTDEF(dwarf_nextcu) diff --git a/elfutils/libdw/dwarf_offabbrev.c b/elfutils/libdw/dwarf_offabbrev.c index 17978fbc..97370d60 100644 --- a/elfutils/libdw/dwarf_offabbrev.c +++ b/elfutils/libdw/dwarf_offabbrev.c @@ -1,5 +1,5 @@ /* Get abbreviation at given offset. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -26,5 +26,11 @@ dwarf_offabbrev (Dwarf *dbg, Dwarf_Off offset, size_t *lengthp, if (dbg == NULL) return -1; - return __libdw_getabbrev (dbg, NULL, offset, lengthp, abbrevp) == NULL; + Dwarf_Abbrev *abbrev = __libdw_getabbrev (dbg, NULL, offset, lengthp, + abbrevp); + + if (abbrev == NULL) + return -1; + + return abbrev == DWARF_END_ABBREV ? 1 : 0; } diff --git a/elfutils/libdw/dwarf_offdie.c b/elfutils/libdw/dwarf_offdie.c index 6ef5595c..84300e1a 100644 --- a/elfutils/libdw/dwarf_offdie.c +++ b/elfutils/libdw/dwarf_offdie.c @@ -1,5 +1,5 @@ /* Return DIE at given offset. - Copyright (C) 2002, 2003 Red Hat, Inc. + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -52,3 +52,4 @@ dwarf_offdie (dbg, offset, result) return result; } +INTDEF(dwarf_offdie) diff --git a/elfutils/libdw/dwarf_siblingof.c b/elfutils/libdw/dwarf_siblingof.c index 90081c64..bd965ea8 100644 --- a/elfutils/libdw/dwarf_siblingof.c +++ b/elfutils/libdw/dwarf_siblingof.c @@ -1,5 +1,5 @@ /* Return sibling of given DIE. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -40,6 +40,10 @@ dwarf_siblingof (die, result) sibattr.cu = this_die.cu; /* That's the address we start looking. */ unsigned char *addr = this_die.addr; + /* End of the buffer. */ + unsigned char *endp + = ((unsigned char *) sibattr.cu->dbg->sectiondata[IDX_debug_info]->d_buf + + sibattr.cu->end); /* Search for the beginning of the next die on this level. We must not return the dies for children of the given die. */ @@ -52,7 +56,7 @@ dwarf_siblingof (die, result) { Dwarf_Off offset; sibattr.valp = addr; - if (dwarf_formref (&sibattr, &offset) != 0) + if (INTUSE(dwarf_formref) (&sibattr, &offset) != 0) /* Something went wrong. */ return -1; @@ -68,9 +72,17 @@ dwarf_siblingof (die, result) /* This abbreviation has children. */ ++level; - /* Check that we are not yet at the end. */ - while (*addr == '\0') + + while (1) { + /* Make sure we are still in range. Some producers might skip + the trailing NUL bytes. */ + if (addr >= endp) + return 1; + + if (*addr != '\0') + break; + if (level-- == 0) /* No more sibling at all. */ return 1; @@ -85,9 +97,7 @@ dwarf_siblingof (die, result) while (level > 0); /* Maybe we reached the end of the CU. */ - if (addr - >= ((unsigned char *) sibattr.cu->dbg->sectiondata[IDX_debug_info]->d_buf - + sibattr.cu->end)) + if (addr >= endp) return 1; /* Clear the entire DIE structure. This signals we have not yet @@ -102,3 +112,4 @@ dwarf_siblingof (die, result) return 0; } +INTDEF(dwarf_siblingof) diff --git a/elfutils/libdw/dwarf_srclang.c b/elfutils/libdw/dwarf_srclang.c index fc256321..3fb06a1e 100644 --- a/elfutils/libdw/dwarf_srclang.c +++ b/elfutils/libdw/dwarf_srclang.c @@ -1,5 +1,5 @@ /* Return source language attribute of DIE. - Copyright (C) 2003 Red Hat, Inc. + Copyright (C) 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -27,6 +27,7 @@ dwarf_srclang (die) Dwarf_Attribute attr_mem; Dwarf_Word value; - return dwarf_formudata (dwarf_attr (die, DW_AT_language, &attr_mem), - &value) == 0 ? (int) value : -1; + return INTUSE(dwarf_formudata) (INTUSE(dwarf_attr) (die, DW_AT_language, + &attr_mem), + &value) == 0 ? (int) value : -1; } diff --git a/elfutils/libdw/dwarf_tag.c b/elfutils/libdw/dwarf_tag.c index 23814cbc..a47cfeae 100644 --- a/elfutils/libdw/dwarf_tag.c +++ b/elfutils/libdw/dwarf_tag.c @@ -1,5 +1,5 @@ /* Return tag of given DIE. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -36,7 +36,7 @@ __libdw_findabbrev (struct Dwarf_CU *cu, unsigned int code) hash table. */ abb = __libdw_getabbrev (cu->dbg, cu, cu->last_abbrev_offset, &length, NULL); - if (abb == NULL) + if (abb == NULL || abb == DWARF_END_ABBREV) { /* Make sure we do not try to search for it again. */ cu->last_abbrev_offset = (size_t) -1l; @@ -79,3 +79,4 @@ dwarf_tag (die) return die->abbrev->tag; } +INTDEF(dwarf_tag) diff --git a/elfutils/libdw/libdw.h b/elfutils/libdw/libdw.h index eee986ff..860212f5 100644 --- a/elfutils/libdw/libdw.h +++ b/elfutils/libdw/libdw.h @@ -1,5 +1,5 @@ /* Interfaces for libdw. - Copyright (C) 2002, 2004 Red Hat, Inc. + Copyright (C) 2002, 2004, 2005 Red Hat, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -69,6 +69,9 @@ typedef GElf_Half Dwarf_Half; /* DWARF abbreviation record. */ typedef struct Dwarf_Abbrev Dwarf_Abbrev; +/* Returned to show the last DIE has be returned. */ +#define DWARF_END_ABBREV ((Dwarf_Abbrev *) -1l) + /* Source code line information for CU. */ typedef struct Dwarf_Lines_s Dwarf_Lines; @@ -87,6 +90,12 @@ typedef struct Dwarf_Aranges_s Dwarf_Aranges; /* CU representation. */ struct Dwarf_CU; +/* Function information. */ +typedef struct Dwarf_Func_s Dwarf_Func; + +/* Macro information. */ +typedef struct Dwarf_Macro_s Dwarf_Macro; + /* Attribute representation. */ typedef struct { @@ -105,19 +114,6 @@ typedef struct } Dwarf_Block; -/* Macro information. */ -typedef struct -{ - unsigned int opcode; - Dwarf_Word param1; - union - { - Dwarf_Word u; - const char *s; - } param2; -} Dwarf_Macro; - - /* DIE information. */ typedef struct { @@ -126,6 +122,7 @@ typedef struct struct Dwarf_CU *cu; Dwarf_Abbrev *abbrev; // XXX We'll see what other information will be needed. + long int padding__; } Dwarf_Die; /* Returned to show the last DIE has be returned. */ @@ -157,7 +154,11 @@ typedef struct Dwarf Dwarf; /* Out-Of-Memory handler. */ +#if __GNUC__ < 4 +typedef void (*Dwarf_OOM) (void); +#else typedef void (*__attribute__ ((noreturn)) Dwarf_OOM) (void); +#endif /* Create a handle for a new debug session. */ @@ -193,7 +194,11 @@ extern Dwarf_Off dwarf_dieoffset (Dwarf_Die *die); /* Return offset of DIE in CU. */ extern Dwarf_Off dwarf_cuoffset (Dwarf_Die *die); -/* Return vhild of current DIE. */ +/* Return CU DIE containing given address. */ +extern Dwarf_Die *dwarf_addrdie (Dwarf *dbg, Dwarf_Addr addr, + Dwarf_Die *result) __nonnull_attribute__ (3); + +/* Return child of current DIE. */ extern int dwarf_child (Dwarf_Die *die, Dwarf_Die *result) __nonnull_attribute__ (2); @@ -346,6 +351,12 @@ extern int dwarf_getsrcfiles (Dwarf_Die *cudie, Dwarf_Files **files, /* Get source for address in CU. */ extern Dwarf_Line *dwarf_getsrc_die (Dwarf_Die *cudie, Dwarf_Addr addr); +/* Get source for file and line number. */ +extern int dwarf_getsrc_file (Dwarf *dbg, const char *fname, int line, int col, + Dwarf_Line ***srcsp, size_t *nsrcs) + __nonnull_attribute__ (2, 5, 6); + + /* Return line address. */ extern int dwarf_lineaddr (Dwarf_Line *line, Dwarf_Addr *addrp); @@ -410,6 +421,39 @@ extern Dwarf_Arange *dwarf_getarange_addr (Dwarf_Aranges *aranges, Dwarf_Addr addr); + +/* Get functions in CUDIE. */ +extern ptrdiff_t dwarf_getfuncs (Dwarf_Die *cudie, + int (*callback) (Dwarf_Func *, void *), + void *arg, ptrdiff_t offset); + +/* Return name of function. */ +extern const char *dwarf_func_name (Dwarf_Func *func); + +/* Return start address of function. */ +extern int dwarf_func_lowpc (Dwarf_Func *func, Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); + +/* Return end address of function. */ +extern int dwarf_func_highpc (Dwarf_Func *func, Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); + +/* Return entry point address of function. */ +extern int dwarf_func_entrypc (Dwarf_Func *func, Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); + +/* Return file name containing definition of the given function. */ +extern const char *dwarf_func_file (Dwarf_Func *func); + +/* Get line number of beginning of given function. */ +extern int dwarf_func_line (Dwarf_Func *func, int *linep) + __nonnull_attribute__ (2); + +/* Get column number of beginning of given function. */ +extern int dwarf_func_col (Dwarf_Func *func, int *colp) + __nonnull_attribute__ (2); + + /* Call callback function for each of the macro information entry for the CU. */ extern ptrdiff_t dwarf_getmacros (Dwarf_Die *cudie, @@ -417,6 +461,18 @@ extern ptrdiff_t dwarf_getmacros (Dwarf_Die *cudie, void *arg, ptrdiff_t offset) __nonnull_attribute__ (2); +/* Return macro opcode. */ +extern int dwarf_macro_opcode (Dwarf_Macro *macro, unsigned int *opcodep) + __nonnull_attribute__ (2); + +/* Return first macro parameter. */ +extern int dwarf_macro_param1 (Dwarf_Macro *macro, Dwarf_Word *paramp) + __nonnull_attribute__ (2); + +/* Return second macro parameter. */ +extern int dwarf_macro_param2 (Dwarf_Macro *macro, Dwarf_Word *paramp, + const char **strp); + /* Return error code of last failing function call. This value is kept separately for each thread. */ diff --git a/elfutils/libdw/libdw.map b/elfutils/libdw/libdw.map index e9ae2b9b..eb224ba4 100644 --- a/elfutils/libdw/libdw.map +++ b/elfutils/libdw/libdw.map @@ -1,6 +1,7 @@ ELFUTILS_1.0 { global: dwarf_abbrevhaschildren; + dwarf_addrdie; dwarf_attr; dwarf_arrayorder; dwarf_begin; @@ -23,6 +24,13 @@ ELFUTILS_1.0 { dwarf_formsdata; dwarf_formstring; dwarf_formudata; + dwarf_func_col; + dwarf_func_entrypc; + dwarf_func_file; + dwarf_func_highpc; + dwarf_func_line; + dwarf_func_lowpc; + dwarf_func_name; dwarf_getabbrev; dwarf_getabbrevattr; dwarf_getabbrevcode; @@ -33,11 +41,13 @@ ELFUTILS_1.0 { dwarf_getattrcnt; dwarf_getattrs; dwarf_getelf; + dwarf_getfuncs; dwarf_getloclist; dwarf_getmacros; dwarf_getpubnames; dwarf_getscn_info; dwarf_getsrc_die; + dwarf_getsrc_file; dwarf_getsrcfiles; dwarf_getsrclines; dwarf_getstring; @@ -55,6 +65,9 @@ ELFUTILS_1.0 { dwarf_lineprologueend; dwarf_linesrc; dwarf_lowpc; + dwarf_macro_opcode; + dwarf_macro_param1; + dwarf_macro_param2; dwarf_offabbrev; dwarf_offdie; dwarf_onearange; diff --git a/elfutils/libdw/libdwP.h b/elfutils/libdw/libdwP.h index 892ad513..669e7455 100644 --- a/elfutils/libdw/libdwP.h +++ b/elfutils/libdw/libdwP.h @@ -1,5 +1,5 @@ /* Internal definitions for libdwarf. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -97,6 +97,7 @@ enum DWARF_E_INVALID_ARANGE_IDX, DWARF_E_NO_MATCH, DWARF_E_NO_FLAG, + DWARF_E_INVALID_OFFSET, }; @@ -245,6 +246,28 @@ struct Dwarf_CU }; +/* Function information. */ +struct Dwarf_Func_s +{ + // XXX If we want to cache functions, we need to change this struct. + Dwarf_Die *die; + Dwarf_Die *cudie; +}; + + +/* Macro information. */ +struct Dwarf_Macro_s +{ + unsigned int opcode; + Dwarf_Word param1; + union + { + Dwarf_Word u; + const char *s; + } param2; +}; + + /* We have to include the file at this point because the inline functions access internals of the Dwarf structure. */ #include "memory-access.h" @@ -312,4 +335,65 @@ extern unsigned char *__libdw_find_attr (Dwarf_Die *die, unsigned int *formp) __nonnull_attribute__ (1) internal_function; +/* Helper function to access integer attribute. */ +extern int __libdw_func_intval (Dwarf_Func *func, int *linep, int attval) + __nonnull_attribute__ (1, 2) internal_function; + + +/* Aliases to avoid PLTs. */ +extern Dwarf *__dwarf_begin_elf_internal (Elf *elf, Dwarf_Cmd cmd, + Elf_Scn *scngrp); +extern int __dwarf_getaranges_internal (Dwarf *dbg, Dwarf_Aranges **aranges, + size_t *naranges) + __nonnull_attribute__ (2); +extern int __dwarf_getarangeinfo_internal (Dwarf_Arange *arange, + Dwarf_Addr *addrp, + Dwarf_Word *lengthp, + Dwarf_Off *offsetp); +extern Dwarf_Arange *__dwarf_getarange_addr_internal (Dwarf_Aranges *aranges, + Dwarf_Addr addr); +extern Dwarf_Die *__dwarf_offdie_internal (Dwarf *dbg, Dwarf_Off offset, + Dwarf_Die *result) + __nonnull_attribute__ (3); +extern int __dwarf_getsrclines_internal (Dwarf_Die *cudie, Dwarf_Lines **lines, + size_t *nlines) + __nonnull_attribute__ (2, 3); +extern Dwarf_Attribute *__dwarf_attr_internal (Dwarf_Die *die, + unsigned int search_name, + Dwarf_Attribute *result) + __nonnull_attribute__ (3); +extern int __dwarf_formudata_internal (Dwarf_Attribute *attr, + Dwarf_Word *return_uval) + __nonnull_attribute__ (2); +extern int __dwarf_formblock_internal (Dwarf_Attribute *attr, + Dwarf_Block *return_block) + __nonnull_attribute__ (2); +extern const char *__dwarf_formstring_internal (Dwarf_Attribute *attrp); +extern int __dwarf_formaddr_internal (Dwarf_Attribute *attr, + Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); +extern int __dwarf_tag_internal (Dwarf_Die *die); +extern int __dwarf_formref_internal (Dwarf_Attribute *attr, + Dwarf_Off *return_offset) + __nonnull_attribute__ (2); +extern int __dwarf_nextcu_internal (Dwarf *dwarf, Dwarf_Off off, + Dwarf_Off *next_off, size_t *header_sizep, + Dwarf_Off *abbrev_offsetp, + uint8_t *address_sizep, + uint8_t *offset_sizep) + __nonnull_attribute__ (3); +extern int __dwarf_child_internal (Dwarf_Die *die, Dwarf_Die *result) + __nonnull_attribute__ (2); +extern int __dwarf_siblingof_internal (Dwarf_Die *die, Dwarf_Die *result) + __nonnull_attribute__ (2); +extern Dwarf_Off __dwarf_dieoffset_internal (Dwarf_Die *die); +extern int __dwarf_highpc_internal (Dwarf_Die *die, Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); +extern int __dwarf_lowpc_internal (Dwarf_Die *die, Dwarf_Addr *return_addr) + __nonnull_attribute__ (2); +extern int __dwarf_formsdata_internal (Dwarf_Attribute *attr, + Dwarf_Sword *return_uval) + __nonnull_attribute__ (2); + + #endif /* libdwP.h */ diff --git a/elfutils/libdw/libdw_findcu.c b/elfutils/libdw/libdw_findcu.c index b8166572..c1d3a451 100644 --- a/elfutils/libdw/libdw_findcu.c +++ b/elfutils/libdw/libdw_findcu.c @@ -1,5 +1,5 @@ /* Find CU for given offset. - Copyright (C) 2003, 2004 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or @@ -73,8 +73,9 @@ __libdw_findcu (dbg, start) uint8_t offset_size; Dwarf_Off abbrev_offset; - if (dwarf_nextcu (dbg, oldoff, &dbg->next_cu_offset, NULL, - &abbrev_offset, &address_size, &offset_size) != 0) + if (INTUSE(dwarf_nextcu) (dbg, oldoff, &dbg->next_cu_offset, NULL, + &abbrev_offset, &address_size, &offset_size) + != 0) /* No more entries. */ return NULL; diff --git a/elfutils/libebl/ChangeLog b/elfutils/libebl/ChangeLog index e749c226..533a8de0 100644 --- a/elfutils/libebl/ChangeLog +++ b/elfutils/libebl/ChangeLog @@ -1,3 +1,86 @@ +2005-05-03 Roland McGrath <roland@redhat.com> + + * libebl.h (Ebl): Add `reloc_simple_type' member. + * eblopenbackend.c (default_reloc_simple_type): New function. + (openbackend): Use that as default reloc_simple_type callback. + * eblrelocsimpletype.c: New file. + * Makefile.am (gen_SOURCES): Add it. + * i386_symbol.c (i386_reloc_simple_type): New function. + * libebl_i386.h: Declare it. + * i386_init.c (i386_init): Use it. + * x86_64_symbol.c (x86_64_reloc_simple_type): New function. + * libebl_x86_64.h: Declare it. + * x86_64_init.c (x86_64_init): Use it. + * ppc_symbol.c (ppc_reloc_simple_type): New function. + * libebl_ppc.h: Declare it. + * ppc_init.c (ppc_init): Use it. + * ppc64_symbol.c (ppc64_reloc_simple_type): New function. + * libebl_ppc64.h: Declare it. + * ppc64_init.c (ppc64_init): Use it. + +2005-03-17 Ulrich Drepper <drepper@redhat.com> + + * eblcorenote.c (ebl_core_note): Add support for AT_SECURE. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (AM_CFLAGS): Add -Wformat=2. + +2005-02-14 Ulrich Drepper <drepper@redhat.com> + + * alpha_destr.c: Add __attribute__((unused)) where needed. + * alpha_init.c: Likewise. + * alpha_symbol.c: Likewise. + * arm_destr.c: Likewise. + * arm_init.c: Likewise. + * arm_symbol.c: Likewise. + * i386_corenote.c: Likewise. + * i386_destr.c: Likewise. + * i386_init.c: Likewise. + * i386_symbol.c: Likewise. + * ia64_destr.c: Likewise. + * ia64_init.c: Likewise. + * ia64_symbol.c: Likewise. + * mips_destr.c: Likewise. + * mips_init.c: Likewise. + * mips_symbol.c: Likewise. + * ppc64_destr.c: Likewise. + * ppc64_init.c: Likewise. + * ppc64_symbol.c: Likewise. + * ppc_destr.c: Likewise. + * ppc_init.c: Likewise. + * ppc_symbol.c: Likewise. + * sh_destr.c: Likewise. + * sh_init.c: Likewise. + * sh_symbol.c: Likewise. + * sparc_destr.c: Likewise. + * sparc_init.c: Likewise. + * sparc_symbol.c: Likewise. + * x86_64_destr.c: Likewise. + * x86_64_init.c: Likewise. + * x86_64_symbol.c: Likewise. + + * x86_64_symbol.c (reloc_map_table): Fix entries for R_X86_64_64 + and R_X86_64_32.. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * eblstrtab.c: A few cleanups. + + * eblopenbackend.c: Mark unused parameters. + + * eblgstrtab.c: Cleanups a few printf format strings. + + * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Check for text relocations in constructed DSOs. + + * eblstrtab.c: Minor cleanups. + + * Makefile.am (AM_CFLAGS): Add -std=gnu99 and -fmudflap for MUDFLAP. + 2004-08-16 Ulrich Drepper <drepper@redhat.com> * Makefile.am (AM_CFLAGS): Add LIBSTR definition with base name of diff --git a/elfutils/libebl/Makefile.am b/elfutils/libebl/Makefile.am index 71514c85..3965185a 100644 --- a/elfutils/libebl/Makefile.am +++ b/elfutils/libebl/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -15,11 +14,12 @@ ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" if MUDFLAP -AM_CFLAGS = -Wall -Wshadow -fpic +AM_CFLAGS = -fmudflap else -AM_CFLAGS = -Wall -Werror -Wshadow -fpic +AM_CFLAGS = endif -AM_CFLAGS += -DLIBSTR=\"$$(basename $(libdir))\" +AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \ + -std=gnu99 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. VERSION = 1 @@ -43,18 +43,13 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblobjecttypename.c eblsymbolbindingname.c \ eblbackendname.c eblshflagscombine.c eblwstrtab.c \ eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ - eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ - eblcorenotetypename.c eblobjnotetypename.c \ + eblreloctypecheck.c eblrelocvaliduse.c eblrelocsimpletype.c \ + ebldynamictagcheck.c eblcorenotetypename.c eblobjnotetypename.c \ eblcorenote.c eblobjnote.c ebldebugscnp.c \ eblgotpcreloccheck.c libebl_a_SOURCES = $(gen_SOURCES) -# -# XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when -# using dlopen correctly. -# -Wl,--rpath,\$$ORIGIN/elfutils \ -# i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c libebl_i386_pic_a_SOURCES = am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) @@ -67,11 +62,14 @@ libelf = ../libelf/libelf.so libmudflap = endif +textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi + libebl_i386_so_SOURCES = libebl_i386.so: libebl_i386_pic.a libebl_i386.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_i386.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) sh_SRCS = sh_init.c sh_destr.c sh_symbol.c @@ -83,6 +81,7 @@ libebl_sh.so: libebl_sh_pic.a libebl_sh.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_sh.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) mips_SRCS = mips_init.c mips_destr.c mips_symbol.c @@ -94,6 +93,7 @@ libebl_mips.so: libebl_mips_pic.a libebl_mips.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_mips.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c @@ -105,6 +105,7 @@ libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c @@ -116,6 +117,7 @@ libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ia64.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c @@ -127,6 +129,7 @@ libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_alpha.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) arm_SRCS = arm_init.c arm_destr.c arm_symbol.c @@ -138,6 +141,7 @@ libebl_arm.so: libebl_arm_pic.a libebl_arm.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_arm.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c @@ -149,6 +153,7 @@ libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_sparc.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) ppc_SRCS = ppc_init.c ppc_destr.c ppc_symbol.c @@ -160,6 +165,7 @@ libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c @@ -171,6 +177,7 @@ libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) %.os: %.c %.o diff --git a/elfutils/libebl/Makefile.in b/elfutils/libebl/Makefile.in index aaff3fe7..e43ee333 100644 --- a/elfutils/libebl/Makefile.in +++ b/elfutils/libebl/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -46,8 +46,6 @@ DIST_COMMON = $(euinclude_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -77,10 +75,10 @@ am__objects_1 = eblopenbackend.$(OBJEXT) eblclosebackend.$(OBJEXT) \ eblwstrtab.$(OBJEXT) eblgstrtab.$(OBJEXT) \ eblosabiname.$(OBJEXT) eblmachineflagcheck.$(OBJEXT) \ eblreloctypecheck.$(OBJEXT) eblrelocvaliduse.$(OBJEXT) \ - ebldynamictagcheck.$(OBJEXT) eblcorenotetypename.$(OBJEXT) \ - eblobjnotetypename.$(OBJEXT) eblcorenote.$(OBJEXT) \ - eblobjnote.$(OBJEXT) ebldebugscnp.$(OBJEXT) \ - eblgotpcreloccheck.$(OBJEXT) + eblrelocsimpletype.$(OBJEXT) ebldynamictagcheck.$(OBJEXT) \ + eblcorenotetypename.$(OBJEXT) eblobjnotetypename.$(OBJEXT) \ + eblcorenote.$(OBJEXT) eblobjnote.$(OBJEXT) \ + ebldebugscnp.$(OBJEXT) eblgotpcreloccheck.$(OBJEXT) am_libebl_a_OBJECTS = $(am__objects_1) libebl_a_OBJECTS = $(am_libebl_a_OBJECTS) libebl_alpha_pic_a_AR = $(AR) $(ARFLAGS) @@ -194,7 +192,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -203,25 +200,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -239,7 +230,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -287,10 +277,10 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -fpic \ -@MUDFLAP_FALSE@ -DLIBSTR=\"$$(basename $(libdir))\" -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -fpic -DLIBSTR=\"$$(basename \ -@MUDFLAP_TRUE@ $(libdir))\" +@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ +@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ +@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. lib_LIBRARIES = libebl.a modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64 @@ -308,18 +298,12 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ eblobjecttypename.c eblsymbolbindingname.c \ eblbackendname.c eblshflagscombine.c eblwstrtab.c \ eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ - eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ - eblcorenotetypename.c eblobjnotetypename.c \ + eblreloctypecheck.c eblrelocvaliduse.c eblrelocsimpletype.c \ + ebldynamictagcheck.c eblcorenotetypename.c eblobjnotetypename.c \ eblcorenote.c eblobjnote.c ebldebugscnp.c \ eblgotpcreloccheck.c libebl_a_SOURCES = $(gen_SOURCES) - -# -# XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when -# using dlopen correctly. -# -Wl,--rpath,\$$ORIGIN/elfutils \ -# i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c libebl_i386_pic_a_SOURCES = am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) @@ -327,6 +311,7 @@ am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) @MUDFLAP_TRUE@libelf = ../libelf/libelf.a @MUDFLAP_FALSE@libmudflap = @MUDFLAP_TRUE@libmudflap = -lmudflap +textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi libebl_i386_so_SOURCES = sh_SRCS = sh_init.c sh_destr.c sh_symbol.c libebl_sh_pic_a_SOURCES = @@ -506,6 +491,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblobjnotetypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblopenbackend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblosabiname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblrelocsimpletype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblreloctypecheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblreloctypename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblrelocvaliduse.Po@am__quote@ @@ -723,42 +709,52 @@ libebl_i386.so: libebl_i386_pic.a libebl_i386.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_i386.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) libebl_sh.so: libebl_sh_pic.a libebl_sh.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_sh.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_mips.so: libebl_mips_pic.a libebl_mips.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_mips.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ia64.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_alpha.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_arm.so: libebl_arm_pic.a libebl_arm.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_arm.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_sparc.map \ -Wl,-z,defs $(libmudflap) + $(textrel_check) libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ -Wl,-z,defs $(libelf) $(libmudflap) + $(textrel_check) %.os: %.c %.o if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ diff --git a/elfutils/libebl/alpha_destr.c b/elfutils/libebl/alpha_destr.c index c599d591..4fc5cf85 100644 --- a/elfutils/libebl/alpha_destr.c +++ b/elfutils/libebl/alpha_destr.c @@ -1,5 +1,5 @@ /* Destructor for Alpha specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void alpha_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/alpha_init.c b/elfutils/libebl/alpha_init.c index b688bb73..eb80c531 100644 --- a/elfutils/libebl/alpha_init.c +++ b/elfutils/libebl/alpha_init.c @@ -1,5 +1,5 @@ /* Initialization of Alpha specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int alpha_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/alpha_symbol.c b/elfutils/libebl/alpha_symbol.c index 749f4f55..4927edce 100644 --- a/elfutils/libebl/alpha_symbol.c +++ b/elfutils/libebl/alpha_symbol.c @@ -1,5 +1,5 @@ /* Alpha specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -71,7 +71,8 @@ static const char *reloc_map_table[] = /* Determine relocation type string for Alpha. */ const char * -alpha_reloc_type_name (int type, char *buf, size_t len) +alpha_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < 0 || ((size_t) type diff --git a/elfutils/libebl/arm_destr.c b/elfutils/libebl/arm_destr.c index 3851240a..2675720a 100644 --- a/elfutils/libebl/arm_destr.c +++ b/elfutils/libebl/arm_destr.c @@ -1,5 +1,5 @@ /* Destructor for Arm specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void arm_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/arm_init.c b/elfutils/libebl/arm_init.c index 3dee75a7..3a37f435 100644 --- a/elfutils/libebl/arm_init.c +++ b/elfutils/libebl/arm_init.c @@ -1,5 +1,5 @@ /* Initialization of Arm specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int arm_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/arm_symbol.c b/elfutils/libebl/arm_symbol.c index 224beea3..ccd9db29 100644 --- a/elfutils/libebl/arm_symbol.c +++ b/elfutils/libebl/arm_symbol.c @@ -1,5 +1,5 @@ /* Arm specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -88,7 +88,8 @@ static const char *reloc_map_table3[] = /* Determine relocation type string for Alpha. */ const char * -arm_reloc_type_name (int type, char *buf, size_t len) +arm_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type >= R_ARM_NONE && type <= R_ARM_ALU_SBREL_27_20) return reloc_map_table[type]; diff --git a/elfutils/libebl/eblcorenote.c b/elfutils/libebl/eblcorenote.c index 6cc384fa..30e46272 100644 --- a/elfutils/libebl/eblcorenote.c +++ b/elfutils/libebl/eblcorenote.c @@ -1,5 +1,5 @@ /* Print contents of core note. - Copyright (C) 2002, 2004 Red Hat, Inc. + Copyright (C) 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -96,6 +96,7 @@ ebl_core_note (ebl, name, type, descsz, desc) NEW_AT (ICACHEBSIZE); NEW_AT (UCACHEBSIZE); NEW_AT (IGNOREPPC); + NEW_AT (SECURE); default: at = "???"; @@ -125,6 +126,7 @@ ebl_core_note (ebl, name, type, descsz, desc) case AT_DCACHEBSIZE: case AT_ICACHEBSIZE: case AT_UCACHEBSIZE: + case AT_SECURE: printf (" %s: %" PRId64 "\n", at, (int64_t) val); break; @@ -134,7 +136,7 @@ ebl_core_note (ebl, name, type, descsz, desc) case AT_ENTRY: case AT_PLATFORM: /* XXX Get string? */ case AT_HWCAP: /* XXX Print flags? */ - printf (" %s: %" PRIx64 "\n", at, (uint64_t) val); + printf (" %s: %#" PRIx64 "\n", at, (uint64_t) val); break; } diff --git a/elfutils/libebl/eblgstrtab.c b/elfutils/libebl/eblgstrtab.c index 1fee0e89..57cb2d8f 100644 --- a/elfutils/libebl/eblgstrtab.c +++ b/elfutils/libebl/eblgstrtab.c @@ -1,5 +1,5 @@ /* Generic string table handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -139,16 +139,11 @@ ebl_gstrtabfree (struct Ebl_GStrtab *st) static struct Ebl_GStrent * newstring (struct Ebl_GStrtab *st, const char *str, size_t len) { - struct Ebl_GStrent *newstr; - size_t align; - size_t i; - size_t j; - /* Compute the amount of padding needed to make the structure aligned. */ - align = ((__alignof__ (struct Ebl_GStrent) - - (((uintptr_t) st->backp) - & (__alignof__ (struct Ebl_GStrent) - 1))) - & (__alignof__ (struct Ebl_GStrent) - 1)); + size_t align = ((__alignof__ (struct Ebl_GStrent) + - (((uintptr_t) st->backp) + & (__alignof__ (struct Ebl_GStrent) - 1))) + & (__alignof__ (struct Ebl_GStrent) - 1)); /* Make sure there is enough room in the memory block. */ if (st->left < align + sizeof (struct Ebl_GStrent) + len * st->width) @@ -158,7 +153,7 @@ newstring (struct Ebl_GStrtab *st, const char *str, size_t len) } /* Create the reserved string. */ - newstr = (struct Ebl_GStrent *) (st->backp + align); + struct Ebl_GStrent *newstr = (struct Ebl_GStrent *) (st->backp + align); newstr->string = str; newstr->len = len; newstr->width = st->width; @@ -166,10 +161,10 @@ newstring (struct Ebl_GStrtab *st, const char *str, size_t len) newstr->left = NULL; newstr->right = NULL; newstr->offset = 0; - for (i = len - 2; i >= 0; --i) - for (j = st->width - 1; j >= 0; --j) + for (int i = len - 2; i >= 0; --i) + for (int j = st->width - 1; j >= 0; --j) newstr->reverse[i * st->width + j] = str[(len - 2 - i) * st->width + j]; - for (j = 0; j < st->width; ++j) + for (size_t j = 0; j < st->width; ++j) newstr->reverse[(len - 1) * st->width + j] = '\0'; st->backp += align + sizeof (struct Ebl_GStrent) + len * st->width; st->left -= align + sizeof (struct Ebl_GStrent) + len * st->width; diff --git a/elfutils/libebl/eblopenbackend.c b/elfutils/libebl/eblopenbackend.c index c801a6a0..cc03fe70 100644 --- a/elfutils/libebl/eblopenbackend.c +++ b/elfutils/libebl/eblopenbackend.c @@ -1,5 +1,5 @@ /* Generate ELF backend handle. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -123,6 +123,7 @@ static const char *default_object_type_name (int ignore, char *buf, static const char *default_reloc_type_name (int ignore, char *buf, size_t len); static bool default_reloc_type_check (int ignore); static bool default_reloc_valid_use (Elf *elf, int ignore); +static Elf_Type default_reloc_simple_type (Elf *elf, int ignore); static bool default_gotpc_reloc_check (Elf *elf, int ignore); static const char *default_segment_type_name (int ignore, char *buf, size_t len); @@ -180,6 +181,7 @@ openbackend (elf, emulation, machine) result->reloc_type_name = default_reloc_type_name; result->reloc_type_check = default_reloc_type_check; result->reloc_valid_use = default_reloc_valid_use; + result->reloc_simple_type = default_reloc_simple_type; result->gotpc_reloc_check = default_gotpc_reloc_check; result->segment_type_name = default_segment_type_name; result->section_type_name = default_section_type_name; @@ -219,7 +221,7 @@ openbackend (elf, emulation, machine) try to load the module. */ char dsoname[100]; strcpy (stpcpy (stpcpy (dsoname, - "$ORIGIN/../" LIBSTR "/elfutils/libebl_"), + "$ORIGIN/../$LIB/elfutils/libebl_"), machines[cnt].dsoname), ".so"); @@ -321,85 +323,111 @@ ebl_openbackend_emulation (const char *emulation) /* Default callbacks. Mostly they just return the error value. */ static const char * -default_object_type_name (int ignore, char *buf, size_t len) +default_object_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_reloc_type_name (int ignore, char *buf, size_t len) +default_reloc_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_reloc_type_check (int ignore) +default_reloc_type_check (int ignore __attribute__ ((unused))) { return false; } static bool -default_reloc_valid_use (Elf *elf, int ignore) +default_reloc_valid_use (Elf *elf __attribute__ ((unused)), + int ignore __attribute__ ((unused))) { return false; } +static Elf_Type +default_reloc_simple_type (Elf *elf __attribute__ ((unused)), + int ignore __attribute__ ((unused))) +{ + return ELF_T_NUM; +} + static bool -default_gotpc_reloc_check (Elf *elf, int ignore) +default_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), + int ignore __attribute__ ((unused))) { return false; } static const char * -default_segment_type_name (int ignore, char *buf, size_t len) +default_segment_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_section_type_name (int ignore, char *buf, size_t len) +default_section_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_section_name (int ignore, int ignore2, char *buf, size_t len) +default_section_name (int ignore __attribute__ ((unused)), + int ignore2 __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_machine_flag_name (Elf64_Word *ignore) +default_machine_flag_name (Elf64_Word *ignore __attribute__ ((unused))) { return NULL; } static bool -default_machine_flag_check (Elf64_Word flags) +default_machine_flag_check (Elf64_Word flags __attribute__ ((unused))) { return flags == 0; } static const char * -default_symbol_type_name (int ignore, char *buf, size_t len) +default_symbol_type_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_symbol_binding_name (int ignore, char *buf, size_t len) +default_symbol_binding_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_dynamic_tag_name (int64_t ignore, char *buf, size_t len) +default_dynamic_tag_name (int64_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_dynamic_tag_check (int64_t ignore) +default_dynamic_tag_check (int64_t ignore __attribute__ ((unused))) { return false; } @@ -411,38 +439,48 @@ default_sh_flags_combine (GElf_Word flags1, GElf_Word flags2) } static void -default_destr (struct ebl *ignore) +default_destr (struct ebl *ignore __attribute__ ((unused))) { } static const char * -default_osabi_name (int ignore, char *buf, size_t len) +default_osabi_name (int ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_core_note_type_name (uint32_t ignore, char *buf, size_t len) +default_core_note_type_name (uint32_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static const char * -default_object_note_type_name (uint32_t ignore, char *buf, size_t len) +default_object_note_type_name (uint32_t ignore __attribute__ ((unused)), + char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { return NULL; } static bool -default_core_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc) +default_core_note (const char *name __attribute__ ((unused)), + uint32_t type __attribute__ ((unused)), + uint32_t descsz __attribute__ ((unused)), + const char *desc __attribute__ ((unused))) { return NULL; } static bool -default_object_note (const char *name, uint32_t type, uint32_t descsz, - const char *desc) +default_object_note (const char *name __attribute__ ((unused)), + uint32_t type __attribute__ ((unused)), + uint32_t descsz __attribute__ ((unused)), + const char *desc __attribute__ ((unused))) { return NULL; } @@ -481,9 +519,7 @@ default_debugscn_p (const char *name) }; const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); - size_t cnt; - - for (cnt = 0; cnt < ndwarf_scn_names; ++cnt) + for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt) if (strcmp (name, dwarf_scn_names[cnt]) == 0) return true; diff --git a/elfutils/libebl/eblrelocsimpletype.c b/elfutils/libebl/eblrelocsimpletype.c new file mode 100644 index 00000000..3e048d1f --- /dev/null +++ b/elfutils/libebl/eblrelocsimpletype.c @@ -0,0 +1,27 @@ +/* Check relocation type for simple types. + Copyright (C) 2005 Red Hat, Inc. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libeblP.h> + + +Elf_Type +ebl_reloc_simple_type (ebl, reloc) + Ebl *ebl; + int reloc; +{ + return ebl != NULL ? ebl->reloc_simple_type (ebl->elf, reloc) : ELF_T_NUM; +} diff --git a/elfutils/libebl/eblstrtab.c b/elfutils/libebl/eblstrtab.c index bbf0d6ee..165909f4 100644 --- a/elfutils/libebl/eblstrtab.c +++ b/elfutils/libebl/eblstrtab.c @@ -1,5 +1,5 @@ /* ELF string table handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -73,15 +73,14 @@ static size_t ps; struct Ebl_Strtab * ebl_strtabinit (bool nullstr) { - struct Ebl_Strtab *ret; - if (ps == 0) { ps = sysconf (_SC_PAGESIZE) - 2 * sizeof (void *); assert (sizeof (struct memoryblock) < ps); } - ret = (struct Ebl_Strtab *) calloc (1, sizeof (struct Ebl_Strtab)); + struct Ebl_Strtab *ret + = (struct Ebl_Strtab *) calloc (1, sizeof (struct Ebl_Strtab)); if (ret != NULL) { ret->nullstr = nullstr; @@ -100,11 +99,10 @@ ebl_strtabinit (bool nullstr) static int morememory (struct Ebl_Strtab *st, size_t len) { - struct memoryblock *newmem; - if (len < ps) len = ps; - newmem = (struct memoryblock *) malloc (len); + + struct memoryblock *newmem = (struct memoryblock *) malloc (len); if (newmem == NULL) return 1; @@ -136,15 +134,11 @@ ebl_strtabfree (struct Ebl_Strtab *st) static struct Ebl_Strent * newstring (struct Ebl_Strtab *st, const char *str, size_t len) { - struct Ebl_Strent *newstr; - size_t align; - int i; - /* Compute the amount of padding needed to make the structure aligned. */ - align = ((__alignof__ (struct Ebl_Strent) - - (((uintptr_t) st->backp) - & (__alignof__ (struct Ebl_Strent) - 1))) - & (__alignof__ (struct Ebl_Strent) - 1)); + size_t align = ((__alignof__ (struct Ebl_Strent) + - (((uintptr_t) st->backp) + & (__alignof__ (struct Ebl_Strent) - 1))) + & (__alignof__ (struct Ebl_Strent) - 1)); /* Make sure there is enough room in the memory block. */ if (st->left < align + sizeof (struct Ebl_Strent) + len) @@ -156,14 +150,14 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len) } /* Create the reserved string. */ - newstr = (struct Ebl_Strent *) (st->backp + align); + struct Ebl_Strent *newstr = (struct Ebl_Strent *) (st->backp + align); newstr->string = str; newstr->len = len; newstr->next = NULL; newstr->left = NULL; newstr->right = NULL; newstr->offset = 0; - for (i = len - 2; i >= 0; --i) + for (int i = len - 2; i >= 0; --i) newstr->reverse[i] = str[len - 2 - i]; newstr->reverse[len - 1] = '\0'; st->backp += align + sizeof (struct Ebl_Strent) + len; @@ -179,8 +173,6 @@ newstring (struct Ebl_Strtab *st, const char *str, size_t len) static struct Ebl_Strent ** searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) { - int cmpres; - /* More strings? */ if (*sep == NULL) { @@ -189,8 +181,8 @@ searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) } /* Compare the strings. */ - cmpres = memcmp ((*sep)->reverse, newstr->reverse, - MIN ((*sep)->len, newstr->len) - 1); + int cmpres = memcmp ((*sep)->reverse, newstr->reverse, + MIN ((*sep)->len, newstr->len) - 1); if (cmpres == 0) /* We found a matching string. */ return sep; @@ -205,9 +197,6 @@ searchstring (struct Ebl_Strent **sep, struct Ebl_Strent *newstr) struct Ebl_Strent * ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) { - struct Ebl_Strent *newstr; - struct Ebl_Strent **sep; - /* Compute the string length if the caller doesn't know it. */ if (len == 0) len = strlen (str) + 1; @@ -218,23 +207,22 @@ ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) return &st->null; /* Allocate memory for the new string and its associated information. */ - newstr = newstring (st, str, len); + struct Ebl_Strent *newstr = newstring (st, str, len); if (newstr == NULL) return NULL; /* Search in the array for the place to insert the string. If there is no string with matching prefix and no string with matching leading substring, create a new entry. */ - sep = searchstring (&st->root, newstr); + struct Ebl_Strent **sep = searchstring (&st->root, newstr); if (*sep != newstr) { /* This is not the same entry. This means we have a prefix match. */ if ((*sep)->len > newstr->len) { - struct Ebl_Strent *subs; - /* Check whether we already know this string. */ - for (subs = (*sep)->next; subs != NULL; subs = subs->next) + for (struct Ebl_Strent *subs = (*sep)->next; subs != NULL; + subs = subs->next) if (subs->len == newstr->len) { /* We have an exact match with a substring. Free the memory @@ -283,8 +271,6 @@ ebl_strtabadd (struct Ebl_Strtab *st, const char *str, size_t len) static void copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) { - struct Ebl_Strent *subs; - if (nodep->left != NULL) copystrings (nodep->left, freep, offsetp); @@ -293,7 +279,7 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) *freep = (char *) mempcpy (*freep, nodep->string, nodep->len); *offsetp += nodep->len; - for (subs = nodep->next; subs != NULL; subs = subs->next) + for (struct Ebl_Strent *subs = nodep->next; subs != NULL; subs = subs->next) { assert (subs->len < nodep->len); subs->offset = nodep->offset + nodep->len - subs->len; @@ -308,8 +294,6 @@ copystrings (struct Ebl_Strent *nodep, char **freep, size_t *offsetp) void ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data) { - size_t copylen; - char *endp; size_t nulllen = st->nullstr ? 1 : 0; /* Fill in the information. */ @@ -330,8 +314,8 @@ ebl_strtabfinalize (struct Ebl_Strtab *st, Elf_Data *data) /* Now run through the tree and add all the string while also updating the offset members of the elfstrent records. */ - endp = (char *) data->d_buf + nulllen; - copylen = nulllen; + char *endp = (char *) data->d_buf + nulllen; + size_t copylen = nulllen; copystrings (st->root, &endp, ©len); assert (copylen == st->total + nulllen); } diff --git a/elfutils/libebl/i386_corenote.c b/elfutils/libebl/i386_corenote.c index 482f81d7..c0f2bcce 100644 --- a/elfutils/libebl/i386_corenote.c +++ b/elfutils/libebl/i386_corenote.c @@ -1,5 +1,5 @@ /* i386 specific core note handling. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -71,7 +71,7 @@ struct elf_prpsinfo bool i386_core_note (name, type, descsz, desc) - const char *name; + const char *name __attribute__ ((unused)); uint32_t type; uint32_t descsz; const char *desc; diff --git a/elfutils/libebl/i386_destr.c b/elfutils/libebl/i386_destr.c index 23609496..50c0fd48 100644 --- a/elfutils/libebl/i386_destr.c +++ b/elfutils/libebl/i386_destr.c @@ -1,5 +1,5 @@ /* Destructor for i386 specific backend library. - Copyright (C) 2000, 2002 Red Hat, Inc. + Copyright (C) 2000, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void i386_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/i386_init.c b/elfutils/libebl/i386_init.c index b53c57da..007d0281 100644 --- a/elfutils/libebl/i386_init.c +++ b/elfutils/libebl/i386_init.c @@ -1,5 +1,5 @@ /* Initialization of i386 specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int i386_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { @@ -35,6 +35,7 @@ i386_init (elf, machine, eh, ehlen) eh->reloc_type_name = i386_reloc_type_name; eh->reloc_type_check = i386_reloc_type_check; eh->reloc_valid_use = i386_reloc_valid_use; + eh->reloc_simple_type = i386_reloc_simple_type; eh->gotpc_reloc_check = i386_gotpc_reloc_check; eh->core_note = i386_core_note; eh->destr = i386_destr; diff --git a/elfutils/libebl/i386_symbol.c b/elfutils/libebl/i386_symbol.c index fc70e506..8f32eb86 100644 --- a/elfutils/libebl/i386_symbol.c +++ b/elfutils/libebl/i386_symbol.c @@ -1,5 +1,5 @@ /* i386 specific symbolic name handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -79,7 +79,8 @@ static struct /* Determine relocation type string for x86. */ const char * -i386_reloc_type_name (int type, char *buf, size_t len) +i386_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < 0 || type >= R_386_NUM) return NULL; @@ -121,7 +122,24 @@ i386_reloc_valid_use (Elf *elf, int type) /* Return true if the symbol type is that referencing the GOT. */ bool -i386_gotpc_reloc_check (Elf *elf, int type) +i386_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), int type) { return type == R_386_GOTPC; } + +/* Check for the simple reloc types. */ +Elf_Type +i386_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type) +{ + switch (type) + { + case R_386_32: + return ELF_T_SWORD; + case R_386_16: + return ELF_T_HALF; + case R_386_8: + return ELF_T_BYTE; + default: + return ELF_T_NUM; + } +} diff --git a/elfutils/libebl/ia64_destr.c b/elfutils/libebl/ia64_destr.c index a48302c8..cb105f64 100644 --- a/elfutils/libebl/ia64_destr.c +++ b/elfutils/libebl/ia64_destr.c @@ -1,5 +1,5 @@ /* Destructor for IA-64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void ia64_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/ia64_init.c b/elfutils/libebl/ia64_init.c index 30925acb..6a6f129d 100644 --- a/elfutils/libebl/ia64_init.c +++ b/elfutils/libebl/ia64_init.c @@ -1,5 +1,5 @@ /* Initialization of IA-64 specific backend library. - Copyright (C) 2002, 2003 Red Hat, Inc. + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int ia64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/ia64_symbol.c b/elfutils/libebl/ia64_symbol.c index fe4c7b71..55f89baf 100644 --- a/elfutils/libebl/ia64_symbol.c +++ b/elfutils/libebl/ia64_symbol.c @@ -1,5 +1,5 @@ /* IA-64 specific symbolic name handling. - Copyright (C) 2002, 2003 Red Hat, Inc. + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -119,7 +119,8 @@ static const char *reloc_map_table[] = /* Determine relocation type string for IA-64. */ const char * -ia64_reloc_type_name (int type, char *buf, size_t len) +ia64_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < 0 || ((size_t) type @@ -142,7 +143,8 @@ ia64_reloc_type_check (int type) const char * -ia64_segment_type_name (int segment, char *buf, size_t len) +ia64_segment_type_name (int segment, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { switch (segment) { @@ -164,7 +166,8 @@ ia64_segment_type_name (int segment, char *buf, size_t len) const char * -ia64_dynamic_tag_name (int64_t tag, char *buf, size_t len) +ia64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { switch (tag) { diff --git a/elfutils/libebl/libebl.h b/elfutils/libebl/libebl.h index 392350ac..3c18d716 100644 --- a/elfutils/libebl/libebl.h +++ b/elfutils/libebl/libebl.h @@ -1,5 +1,5 @@ /* Interface for libebl. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -43,6 +43,9 @@ typedef struct ebl /* Check relocation type. */ bool (*reloc_type_check) (int); + /* Check if relocation type is for simple absolute relocations. */ + Elf_Type (*reloc_simple_type) (Elf *, int); + /* Check relocation type use. */ bool (*reloc_valid_use) (Elf *, int); @@ -136,6 +139,10 @@ extern bool ebl_reloc_type_check (Ebl *ebl, int reloc); /* Check relocation type use. */ extern bool ebl_reloc_valid_use (Ebl *ebl, int reloc); +/* Check if relocation type is for simple absolute relocations. + Return ELF_T_{BYTE,HALF,SWORD,SXWORD} for a simple type, else ELF_T_NUM. */ +extern Elf_Type ebl_reloc_simple_type (Ebl *ebl, int reloc); + /* Return true if the symbol type is that referencing the GOT. E.g., R_386_GOTPC. */ extern bool ebl_gotpc_reloc_check (Ebl *ebl, int reloc); diff --git a/elfutils/libebl/libebl_i386.h b/elfutils/libebl/libebl_i386.h index ed719660..166a6072 100644 --- a/elfutils/libebl/libebl_i386.h +++ b/elfutils/libebl/libebl_i386.h @@ -1,5 +1,5 @@ /* Interface for libebl_i386 module. - Copyright (C) 2000, 2001, 2002, 2003 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -33,6 +33,9 @@ extern bool i386_reloc_type_check (int type); /* Check relocation type use. */ extern bool i386_reloc_valid_use (Elf *elf, int type); +/* Check for the simple reloc types. */ +extern Elf_Type i386_reloc_simple_type (Elf *elf, int type); + /* Check relocation type use. */ extern bool i386_gotpc_reloc_check (Elf *elf, int type); diff --git a/elfutils/libebl/libebl_ppc.h b/elfutils/libebl/libebl_ppc.h index 880cd399..5370ed0f 100644 --- a/elfutils/libebl/libebl_ppc.h +++ b/elfutils/libebl/libebl_ppc.h @@ -1,5 +1,5 @@ /* Interface for libebl_PPC module. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -33,6 +33,9 @@ extern bool ppc_reloc_type_check (int type); /* Check relocation type use. */ extern bool ppc_reloc_valid_use (Elf *elf, int type); +/* Check for the simple reloc types. */ +extern Elf_Type ppc_reloc_simple_type (Elf *elf, int type); + /* Code note handling. */ extern bool ppc_core_note (const char *name, uint32_t type, uint32_t descsz, const char *desc); diff --git a/elfutils/libebl/libebl_ppc64.h b/elfutils/libebl/libebl_ppc64.h index 3ad3e8cf..41ca0229 100644 --- a/elfutils/libebl/libebl_ppc64.h +++ b/elfutils/libebl/libebl_ppc64.h @@ -1,5 +1,5 @@ /* Interface for libebl_PPC64 module. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -33,6 +33,9 @@ extern bool ppc64_reloc_type_check (int type); /* Check relocation type use. */ extern bool ppc64_reloc_valid_use (Elf *elf, int type); +/* Check for the simple reloc types. */ +extern Elf_Type ppc64_reloc_simple_type (Elf *elf, int type); + /* Code note handling. */ extern bool ppc64_core_note (const char *name, uint32_t type, uint32_t descsz, const char *desc); diff --git a/elfutils/libebl/libebl_x86_64.h b/elfutils/libebl/libebl_x86_64.h index b68124ab..a520c9cc 100644 --- a/elfutils/libebl/libebl_x86_64.h +++ b/elfutils/libebl/libebl_x86_64.h @@ -1,5 +1,5 @@ /* Interface for libebl_x86_64 module. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -33,6 +33,9 @@ extern bool x86_64_reloc_type_check (int type); /* Check relocation type use. */ extern bool x86_64_reloc_valid_use (Elf *elf, int type); +/* Check for the simple reloc types. */ +extern Elf_Type x86_64_reloc_simple_type (Elf *elf, int type); + /* Code note handling. */ extern bool x86_64_core_note (const char *name, uint32_t type, uint32_t descsz, const char *desc); diff --git a/elfutils/libebl/mips_destr.c b/elfutils/libebl/mips_destr.c index fa8f8d30..d5007e26 100644 --- a/elfutils/libebl/mips_destr.c +++ b/elfutils/libebl/mips_destr.c @@ -1,5 +1,5 @@ /* Destructor for MIPS specific backend library. - Copyright (C) 2000, 2002 Red Hat, Inc. + Copyright (C) 2000, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void mips_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/mips_init.c b/elfutils/libebl/mips_init.c index 7b51f405..1c107375 100644 --- a/elfutils/libebl/mips_init.c +++ b/elfutils/libebl/mips_init.c @@ -1,5 +1,5 @@ /* Initialization of MIPS specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int mips_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/mips_symbol.c b/elfutils/libebl/mips_symbol.c index cab03310..71ad927a 100644 --- a/elfutils/libebl/mips_symbol.c +++ b/elfutils/libebl/mips_symbol.c @@ -1,5 +1,5 @@ /* MIPS specific symbolic name handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -32,7 +32,8 @@ mips_backend_name (void) /* Determine relocation type string for MIPS. */ const char * -mips_reloc_type_name (int type, char *buf, size_t len) +mips_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { static const char *map_table[] = { @@ -81,7 +82,8 @@ mips_reloc_type_name (int type, char *buf, size_t len) const char * -mips_segment_type_name (int type, char *buf, size_t len) +mips_segment_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { static const struct { @@ -106,7 +108,8 @@ mips_segment_type_name (int type, char *buf, size_t len) const char * -mips_section_type_name (int type, char *buf, size_t len) +mips_section_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { static const struct { @@ -202,7 +205,8 @@ mips_machine_flag_name (Elf64_Word *flags) const char * -mips_dynamic_tag_name (int64_t tag, char *buf, size_t len) +mips_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { static const struct { diff --git a/elfutils/libebl/ppc64_destr.c b/elfutils/libebl/ppc64_destr.c index 9fd38021..8da6a8fd 100644 --- a/elfutils/libebl/ppc64_destr.c +++ b/elfutils/libebl/ppc64_destr.c @@ -1,5 +1,5 @@ /* Destructor for PPC64 specific backend library. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void ppc64_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/ppc64_init.c b/elfutils/libebl/ppc64_init.c index fec963b2..6cbe3a51 100644 --- a/elfutils/libebl/ppc64_init.c +++ b/elfutils/libebl/ppc64_init.c @@ -1,5 +1,5 @@ /* Initialization of PPC64 specific backend library. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int ppc64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { @@ -35,6 +35,7 @@ ppc64_init (elf, machine, eh, ehlen) eh->reloc_type_name = ppc64_reloc_type_name; eh->reloc_type_check = ppc64_reloc_type_check; eh->reloc_valid_use = ppc64_reloc_valid_use; + eh->reloc_simple_type = ppc64_reloc_simple_type; eh->dynamic_tag_name = ppc64_dynamic_tag_name; eh->destr = ppc64_destr; diff --git a/elfutils/libebl/ppc64_symbol.c b/elfutils/libebl/ppc64_symbol.c index 9ab53667..4914e523 100644 --- a/elfutils/libebl/ppc64_symbol.c +++ b/elfutils/libebl/ppc64_symbol.c @@ -1,5 +1,5 @@ /* PPC64 specific symbolic name handling. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -148,7 +148,8 @@ static struct /* Determine relocation type string for PPC. */ const char * -ppc64_reloc_type_name (int type, char *buf, size_t len) +ppc64_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < R_PPC64_NONE || type >= R_PPC64_NUM) return NULL; @@ -188,8 +189,29 @@ ppc64_reloc_valid_use (Elf *elf, int type) } +/* Check for the simple reloc types. */ +Elf_Type +ppc64_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type) +{ + switch (type) + { + case R_PPC64_ADDR64: + case R_PPC64_UADDR64: + return ELF_T_XWORD; + case R_PPC64_ADDR32: + case R_PPC64_UADDR32: + return ELF_T_WORD; + case R_PPC64_UADDR16: + return ELF_T_HALF; + default: + return ELF_T_NUM; + } +} + + const char * -ppc64_dynamic_tag_name (int64_t tag, char *buf, size_t len) +ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { switch (tag) { diff --git a/elfutils/libebl/ppc_destr.c b/elfutils/libebl/ppc_destr.c index 219de067..65bb81cc 100644 --- a/elfutils/libebl/ppc_destr.c +++ b/elfutils/libebl/ppc_destr.c @@ -1,5 +1,5 @@ /* Destructor for PPC specific backend library. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void ppc_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/ppc_init.c b/elfutils/libebl/ppc_init.c index 9b45bd73..c7866613 100644 --- a/elfutils/libebl/ppc_init.c +++ b/elfutils/libebl/ppc_init.c @@ -1,5 +1,5 @@ /* Initialization of PPC specific backend library. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int ppc_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { @@ -35,6 +35,7 @@ ppc_init (elf, machine, eh, ehlen) eh->reloc_type_name = ppc_reloc_type_name; eh->reloc_type_check = ppc_reloc_type_check; eh->reloc_valid_use = ppc_reloc_valid_use; + eh->reloc_simple_type = ppc_reloc_simple_type; eh->destr = ppc_destr; return 0; diff --git a/elfutils/libebl/ppc_symbol.c b/elfutils/libebl/ppc_symbol.c index 08a9fef7..cd75d93d 100644 --- a/elfutils/libebl/ppc_symbol.c +++ b/elfutils/libebl/ppc_symbol.c @@ -1,5 +1,5 @@ /* PPC specific symbolic name handling. - Copyright (C) 2004 Red Hat, Inc. + Copyright (C) 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2004. This program is Open Source software; you can redistribute it and/or @@ -109,7 +109,8 @@ static struct /* Determine relocation type string for PPC. */ const char * -ppc_reloc_type_name (int type, char *buf, size_t len) +ppc_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < 0 || type >= R_PPC_NUM) return NULL; @@ -147,3 +148,20 @@ ppc_reloc_valid_use (Elf *elf, int type) assert (reloc_map_table[type].appear == both); return true; } + + +/* Check for the simple reloc types. */ +Elf_Type +ppc_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type) +{ + switch (type) + { + case R_PPC_ADDR32: + case R_PPC_UADDR32: + return ELF_T_WORD; + case R_PPC_UADDR16: + return ELF_T_HALF; + default: + return ELF_T_NUM; + } +} diff --git a/elfutils/libebl/sh_destr.c b/elfutils/libebl/sh_destr.c index f6b03b3a..4f065343 100644 --- a/elfutils/libebl/sh_destr.c +++ b/elfutils/libebl/sh_destr.c @@ -1,5 +1,5 @@ /* Destructor for SH specific backend library. - Copyright (C) 2000. 2002 Red Hat, Inc. + Copyright (C) 2000. 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void sh_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/sh_init.c b/elfutils/libebl/sh_init.c index cc26640b..85f2592b 100644 --- a/elfutils/libebl/sh_init.c +++ b/elfutils/libebl/sh_init.c @@ -1,5 +1,5 @@ /* Initialization of SH specific backend library. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int sh_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/sh_symbol.c b/elfutils/libebl/sh_symbol.c index 6211ab51..e28741d2 100644 --- a/elfutils/libebl/sh_symbol.c +++ b/elfutils/libebl/sh_symbol.c @@ -1,5 +1,5 @@ /* SH specific relocation handling. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -32,7 +32,8 @@ sh_backend_name (void) /* Determine relocation type string for SH. */ const char * -sh_reloc_type_name (int type, char *buf, size_t len) +sh_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { static const char *map_table1[] = { diff --git a/elfutils/libebl/sparc_destr.c b/elfutils/libebl/sparc_destr.c index ced22917..819f3616 100644 --- a/elfutils/libebl/sparc_destr.c +++ b/elfutils/libebl/sparc_destr.c @@ -1,5 +1,5 @@ /* Destructor for SPARC specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -20,7 +20,7 @@ void sparc_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/sparc_init.c b/elfutils/libebl/sparc_init.c index 2bb1f790..d9e5a69f 100644 --- a/elfutils/libebl/sparc_init.c +++ b/elfutils/libebl/sparc_init.c @@ -1,5 +1,5 @@ /* Initialization of SPARC specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -20,8 +20,8 @@ int sparc_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { diff --git a/elfutils/libebl/sparc_symbol.c b/elfutils/libebl/sparc_symbol.c index eed31d11..dbb942b5 100644 --- a/elfutils/libebl/sparc_symbol.c +++ b/elfutils/libebl/sparc_symbol.c @@ -1,5 +1,5 @@ /* SPARC specific symbolic name handling. - Copyright (C) 2002, 2003 Red Hat, Inc. + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -117,7 +117,8 @@ static const char *reloc_map_table[] = /* Determine relocation type string for sparc. */ const char * -sparc_reloc_type_name (int type, char *buf, size_t len) +sparc_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { /* High 24 bits of r_type are used for second addend in R_SPARC_OLO10. */ if ((type & 0xff) == R_SPARC_OLO10) diff --git a/elfutils/libebl/x86_64_destr.c b/elfutils/libebl/x86_64_destr.c index 754ccc99..38058299 100644 --- a/elfutils/libebl/x86_64_destr.c +++ b/elfutils/libebl/x86_64_destr.c @@ -1,5 +1,5 @@ /* Destructor for x86_64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,7 +21,7 @@ void x86_64_destr (bh) - Ebl *bh; + Ebl *bh __attribute__ ((unused)); { /* Nothing to do so far. */ } diff --git a/elfutils/libebl/x86_64_init.c b/elfutils/libebl/x86_64_init.c index 5d922059..45a08774 100644 --- a/elfutils/libebl/x86_64_init.c +++ b/elfutils/libebl/x86_64_init.c @@ -1,5 +1,5 @@ /* Initialization of x86-64 specific backend library. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -21,8 +21,8 @@ int x86_64_init (elf, machine, eh, ehlen) - Elf *elf; - GElf_Half machine; + Elf *elf __attribute__ ((unused)); + GElf_Half machine __attribute__ ((unused)); Ebl *eh; size_t ehlen; { @@ -35,6 +35,7 @@ x86_64_init (elf, machine, eh, ehlen) eh->reloc_type_name = x86_64_reloc_type_name; eh->reloc_type_check = x86_64_reloc_type_check; eh->reloc_valid_use = x86_64_reloc_valid_use; + eh->reloc_simple_type = x86_64_reloc_simple_type; //eh->core_note = i386_core_note; eh->destr = x86_64_destr; diff --git a/elfutils/libebl/x86_64_symbol.c b/elfutils/libebl/x86_64_symbol.c index b0f53ea9..b8c13b1e 100644 --- a/elfutils/libebl/x86_64_symbol.c +++ b/elfutils/libebl/x86_64_symbol.c @@ -1,5 +1,5 @@ /* x86_64 specific symbolic name handling. - Copyright (C) 2002 Red Hat, Inc. + Copyright (C) 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is Open Source software; you can redistribute it and/or @@ -39,7 +39,7 @@ static struct } reloc_map_table[] = { [R_X86_64_NONE] = { "R_X86_64_NONE", both }, - [R_X86_64_64] = { "R_X86_64_64", rel }, + [R_X86_64_64] = { "R_X86_64_64", both }, [R_X86_64_PC32] = { "R_X86_64_PC32", rel }, [R_X86_64_GOT32] = { "R_X86_64_GOT32", rel }, [R_X86_64_PLT32] = { "R_X86_64_PLT32", rel }, @@ -48,7 +48,7 @@ static struct [R_X86_64_JUMP_SLOT] = { "R_X86_64_JUMP_SLOT", exec }, [R_X86_64_RELATIVE] = { "R_X86_64_RELATIVE", exec }, [R_X86_64_GOTPCREL] = { "R_X86_64_GOTPCREL", exec }, - [R_X86_64_32] = { "R_X86_64_32", rel }, + [R_X86_64_32] = { "R_X86_64_32", both }, [R_X86_64_32S] = { "R_X86_64_32S", rel }, [R_X86_64_16] = { "R_X86_64_16", rel }, [R_X86_64_PC16] = { "R_X86_64_PC16", rel }, @@ -67,7 +67,8 @@ static struct /* Determine relocation type string for x86-64. */ const char * -x86_64_reloc_type_name (int type, char *buf, size_t len) +x86_64_reloc_type_name (int type, char *buf __attribute__ ((unused)), + size_t len __attribute__ ((unused))) { if (type < 0 || type >= R_X86_64_NUM) return NULL; @@ -105,3 +106,24 @@ x86_64_reloc_valid_use (Elf *elf, int type) assert (reloc_map_table[type].appear == both); return true; } + +/* Check for the simple reloc types. */ +Elf_Type +x86_64_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type) +{ + switch (type) + { + case R_X86_64_64: + return ELF_T_XWORD; + case R_X86_64_32: + return ELF_T_WORD; + case R_X86_64_32S: + return ELF_T_SWORD; + case R_X86_64_16: + return ELF_T_HALF; + case R_X86_64_8: + return ELF_T_BYTE; + default: + return ELF_T_NUM; + } +} diff --git a/elfutils/libelf-po/ChangeLog b/elfutils/libelf-po/ChangeLog index 78eb2ff1..42f50a13 100644 --- a/elfutils/libelf-po/ChangeLog +++ b/elfutils/libelf-po/ChangeLog @@ -1,3 +1,7 @@ +2005-05-07 Ulrich Drepper <drepper@redhat.com> + + * Makefile.in.in (XGETTEXT_OPTIONS): Define. + 2004-01-18 Ulrich Drepper <drepper@redhat.com> * Makefile.in.in: Set PACKAGE to libelf. @@ -8,4 +12,4 @@ 2003-08-11 Ulrich Drepper <drepper@redhat.com> - * Moved to CVS archive. + * Moved to CVS archive. diff --git a/elfutils/libelf-po/Makefile.in.in b/elfutils/libelf-po/Makefile.in.in index 4a7a2688..aae32e79 100644 --- a/elfutils/libelf-po/Makefile.in.in +++ b/elfutils/libelf-po/Makefile.in.in @@ -33,6 +33,7 @@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ +XGETTEXT_OPTIONS = --flag=error:3:c-format MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit diff --git a/elfutils/libelf-po/POTFILES.in b/elfutils/libelf-po/POTFILES.in index b25620fb..51d28150 100644 --- a/elfutils/libelf-po/POTFILES.in +++ b/elfutils/libelf-po/POTFILES.in @@ -1,5 +1,5 @@ # List of files which containing translatable strings. -# Copyright (C) 2000 Red Hat, Inc. +# Copyright (C) 2000, 2005 Red Hat, Inc. # Library sources libelf/elf_error.c diff --git a/elfutils/libelf-po/libelf.pot b/elfutils/libelf-po/libelf.pot index dfcd7704..f0cd7572 100644 --- a/elfutils/libelf-po/libelf.pot +++ b/elfutils/libelf-po/libelf.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-09-25 12:42-0700\n" +"POT-Creation-Date: 2005-05-09 22:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/elfutils/libelf/ChangeLog b/elfutils/libelf/ChangeLog index a92c1915..6745d276 100644 --- a/elfutils/libelf/ChangeLog +++ b/elfutils/libelf/ChangeLog @@ -1,3 +1,58 @@ +2005-05-09 Ulrich Drepper <drepper@redhat.com> + + * elf.h: Update from glibc. + +2005-05-08 Roland McGrath <roland@redhat.com> + + * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. + * elf_update.c (write_file) [_MUDFLAP]: Likewise. + +2005-03-29 Ulrich Drepper <drepper@redhat.com> + + * elf32_checksum.c: Use INTUSE and INTDEF to avoid PLTs. + * elf_end.c: Likewise. + * elf_getdata.c: Likewise. + * gelf_getehdr.c: Likewise. + * nlist.c: Likewise. + * libelfP.h: Add declarations of internal functions. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * common.h (CONVERT): Make sure all values are unsigned. + (CONVERT_TO): Likewise. + + * Makefile.am (AM_CFLAGS): Add -Wformat=2. + Fix rule to build libelf.so. + +2005-02-06 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Cleanup AM_CFLAGS handling. Add -Wunused -Wextra. + Remove lint handling. + * elf32_getphdr.c: Minor cleanups. + * elf32_getshdr.c: Likewise. + * elf32_updatefile.c: Likewise. + * elf32_updatenull.c: Likewise. + * elf_begin.c: Likewise. + * elf_error.c: Likewise. + * elf_getarsym.c: Likewise. + * elf_getdata.c: Likewise. + * elf_update.c: Likewise. + * gelf_xlate.c: Likewise. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Check for text relocations in constructed DSO. + + * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -Werror -fpic -fmudflap. + +2005-02-04 Ulrich Drepper <drepper@redhat.com> + + * gelf_getehdr.c (gelf_getehdr): Slight optimization. + + * elf32_checksum.c (checksum): Do not look at NOBITS sections. + + * gelf.h: Add gelf_checksum prototype. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * elf32_checksum.c: Make compile with gcc 4.0. diff --git a/elfutils/libelf/Makefile.am b/elfutils/libelf/Makefile.am index 3481858e..cf581902 100644 --- a/elfutils/libelf/Makefile.am +++ b/elfutils/libelf/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 1996-2001, 2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 Red Hat, Inc. ## ## 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 @@ -17,20 +16,18 @@ ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -# XXX gcc has a bug in that it generates warnings for internal symbols. -# XXX Remove the conditional when gcc is fxied. if MUDFLAP -AM_CFLAGS = -Wall -Wshadow +AM_CFLAGS = -fpic -fmudflap else -AM_CFLAGS = -Wall -Werror -Wshadow +AM_CFLAGS = endif +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \ + $($(*F)_CFLAGS) INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) VERSION = 1 PACKAGE_VERSION = @PACKAGE_VERSION@ -LINT = splint - lib_LIBRARIES = libelf.a if !MUDFLAP noinst_LIBRARIES = libelf_pic.a @@ -92,7 +89,8 @@ libelf_so_SOURCES = libelf.so: libelf_pic.a libelf.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ - -Wl,--soname,$@.$(VERSION),-z-defs + -Wl,--soname,$@.$(VERSION),-z,-defs + if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) %.os: %.c %.o @@ -115,11 +113,6 @@ uninstall: uninstall-am rm -f $(DESTDIR)$(libdir)/libelf.so endif -.PSEUDO: lint -lint: - $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \ - $(addprefix $(srcdir)/,$(libelf_a_SOURCES)) - noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ version_xlate.h dl-hash.h EXTRA_DIST = libelf.map diff --git a/elfutils/libelf/Makefile.in b/elfutils/libelf/Makefile.in index eb76e52d..3b391784 100644 --- a/elfutils/libelf/Makefile.in +++ b/elfutils/libelf/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -48,8 +48,6 @@ DIST_COMMON = $(euinclude_HEADERS) $(include_HEADERS) \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -157,7 +155,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -166,25 +163,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -202,7 +193,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -250,13 +240,13 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -# XXX gcc has a bug in that it generates warnings for internal symbols. -# XXX Remove the conditional when gcc is fxied. -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \ +@MUDFLAP_FALSE@ -Wformat=2 -std=gnu99 $($(*F)_CFLAGS) +@MUDFLAP_TRUE@AM_CFLAGS = -fpic -fmudflap -Wall -Wshadow -Werror \ +@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \ +@MUDFLAP_TRUE@ $($(*F)_CFLAGS) INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) -LINT = splint lib_LIBRARIES = libelf.a @MUDFLAP_FALSE@noinst_LIBRARIES = libelf_pic.a include_HEADERS = libelf.h gelf.h nlist.h @@ -727,7 +717,8 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-includeHEADERS \ @MUDFLAP_FALSE@libelf.so: libelf_pic.a libelf.map @MUDFLAP_FALSE@ $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ @MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ -@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION),-z-defs +@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION),-z,-defs +@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION) @MUDFLAP_FALSE@%.os: %.c %.o @@ -748,11 +739,6 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-includeHEADERS \ @MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so @MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION) @MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libelf.so - -.PSEUDO: lint -lint: - $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \ - $(addprefix $(srcdir)/,$(libelf_a_SOURCES)) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/elfutils/libelf/common.h b/elfutils/libelf/common.h index 5b00cacb..ac1c61d6 100644 --- a/elfutils/libelf/common.h +++ b/elfutils/libelf/common.h @@ -1,5 +1,5 @@ /* Common definitions for handling files in memory or only on disk. - Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -120,7 +120,7 @@ libelf_release_all (Elf *elf) has to use itself. */ #define CONVERT(Var) \ (Var) = (sizeof (Var) == 1 \ - ? (Var) \ + ? (unsigned char) (Var) \ : (sizeof (Var) == 2 \ ? bswap_16 (Var) \ : (sizeof (Var) == 4 \ @@ -129,7 +129,7 @@ libelf_release_all (Elf *elf) #define CONVERT_TO(Dst, Var) \ (Dst) = (sizeof (Var) == 1 \ - ? (Var) \ + ? (unsigned char) (Var) \ : (sizeof (Var) == 2 \ ? bswap_16 (Var) \ : (sizeof (Var) == 4 \ diff --git a/elfutils/libelf/elf.h b/elfutils/libelf/elf.h index 444c6de3..8a9f7fd4 100644 --- a/elfutils/libelf/elf.h +++ b/elfutils/libelf/elf.h @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -963,6 +963,12 @@ typedef struct #define AT_SYSINFO 32 #define AT_SYSINFO_EHDR 33 +/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains + log2 of line size; mask those to get cache size. */ +#define AT_L1I_CACHESHAPE 34 +#define AT_L1D_CACHESHAPE 35 +#define AT_L2_CACHESHAPE 36 +#define AT_L3_CACHESHAPE 37 /* Note section contents. Each entry in the note section begins with a header of a fixed form. */ @@ -1485,8 +1491,21 @@ typedef struct #define R_MIPS_PJUMP 35 #define R_MIPS_RELGOT 36 #define R_MIPS_JALR 37 +#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ +#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ +#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ +#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ +#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ +#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ +#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ +#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ +#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ +#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ +#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ +#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ +#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ /* Keep this the last entry. */ -#define R_MIPS_NUM 38 +#define R_MIPS_NUM 51 /* Legal values for p_type field of Elf32_Phdr. */ @@ -2119,7 +2138,11 @@ typedef Elf32_Addr Elf32_Conflict; #define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base */ +/* Processor specific values for the Phdr p_type field. */ +#define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */ + /* ARM relocs. */ + #define R_ARM_NONE 0 /* No reloc */ #define R_ARM_PC24 1 /* PC relative 26 bit branch */ #define R_ARM_ABS32 2 /* Direct 32 bit */ @@ -2396,9 +2419,14 @@ typedef Elf32_Addr Elf32_Conflict; #define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ #define R_390_TLS_TPOFF 56 /* Negated offset in static TLS block. */ - +#define R_390_20 57 /* Direct 20 bit. */ +#define R_390_GOT20 58 /* 20 bit GOT offset. */ +#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ +#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS + block offset. */ /* Keep this the last entry. */ -#define R_390_NUM 57 +#define R_390_NUM 61 + /* CRIS relocations. */ #define R_CRIS_NONE 0 @@ -2424,6 +2452,7 @@ typedef Elf32_Addr Elf32_Conflict; #define R_CRIS_NUM 20 + /* AMD x86-64 relocations. */ #define R_X86_64_NONE 0 /* No reloc */ #define R_X86_64_64 1 /* Direct 64 bit */ @@ -2456,6 +2485,91 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_NUM 24 + +/* AM33 relocations. */ +#define R_MN10300_NONE 0 /* No reloc. */ +#define R_MN10300_32 1 /* Direct 32 bit. */ +#define R_MN10300_16 2 /* Direct 16 bit. */ +#define R_MN10300_8 3 /* Direct 8 bit. */ +#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ +#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ +#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ +#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ +#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ +#define R_MN10300_24 9 /* Direct 24 bit. */ +#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ +#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ +#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ +#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ +#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ +#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ +#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ +#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ +#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ +#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ +#define R_MN10300_COPY 20 /* Copy symbol at runtime. */ +#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ +#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ +#define R_MN10300_RELATIVE 23 /* Adjust by program base. */ + +#define R_MN10300_NUM 24 + + +/* M32R relocs. */ +#define R_M32R_NONE 0 /* No reloc. */ +#define R_M32R_16 1 /* Direct 16 bit. */ +#define R_M32R_32 2 /* Direct 32 bit. */ +#define R_M32R_24 3 /* Direct 24 bit. */ +#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ +#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ +#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ +#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ +#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ +#define R_M32R_LO16 9 /* Low 16 bit. */ +#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ +#define R_M32R_GNU_VTINHERIT 11 +#define R_M32R_GNU_VTENTRY 12 +/* M32R relocs use SHT_RELA. */ +#define R_M32R_16_RELA 33 /* Direct 16 bit. */ +#define R_M32R_32_RELA 34 /* Direct 32 bit. */ +#define R_M32R_24_RELA 35 /* Direct 24 bit. */ +#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ +#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ +#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ +#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ +#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ +#define R_M32R_LO16_RELA 41 /* Low 16 bit */ +#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ +#define R_M32R_RELA_GNU_VTINHERIT 43 +#define R_M32R_RELA_GNU_VTENTRY 44 + +#define R_M32R_GOT24 48 /* 24 bit GOT entry */ +#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ +#define R_M32R_COPY 50 /* Copy symbol at runtime */ +#define R_M32R_GLOB_DAT 51 /* Create GOT entry */ +#define R_M32R_JMP_SLOT 52 /* Create PLT entry */ +#define R_M32R_RELATIVE 53 /* Adjust by program base */ +#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ +#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ +#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned + low */ +#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed + low */ +#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ +#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to + GOT with unsigned low */ +#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to + GOT with signed low */ +#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to + GOT */ +#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT + with unsigned low */ +#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT + with signed low */ +#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ +#define R_M32R_NUM 256 /* Keep this the last entry. */ + + __END_DECLS #endif /* elf.h */ diff --git a/elfutils/libelf/elf32_checksum.c b/elfutils/libelf/elf32_checksum.c index 0a1479d5..580f27c3 100644 --- a/elfutils/libelf/elf32_checksum.c +++ b/elfutils/libelf/elf32_checksum.c @@ -1,5 +1,5 @@ /* Compute simple checksum from permanent parts of the ELF file. - Copyright (C) 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2002. This program is free software; you can redistribute it and/or modify @@ -89,11 +89,15 @@ elfw2(LIBELFBITS,checksum) (elf) } if (SECTION_STRIP_P (NULL, NULL, NULL, shdr, - elf_strptr (elf, shstrndx, shdr->sh_name), + INTUSE(elf_strptr) (elf, shstrndx, shdr->sh_name), true, false)) /* The section can be stripped. Don't use it. */ continue; + /* Do not look at NOBITS sections. */ + if (shdr->sh_type == SHT_NOBITS) + continue; + /* To compute the checksum we need to get to the data. For repeatable results we must use the external format. The data we get with 'elf'getdata' might be changed for endianess diff --git a/elfutils/libelf/elf32_getphdr.c b/elfutils/libelf/elf32_getphdr.c index 9a7b883c..25693687 100644 --- a/elfutils/libelf/elf32_getphdr.c +++ b/elfutils/libelf/elf32_getphdr.c @@ -1,5 +1,5 @@ /* Get ELF program header table. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -67,18 +67,16 @@ elfw2(LIBELFBITS,getphdr) (elf) { /* Read the section header table. */ ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; - size_t phnum; - size_t size; /* If no program header exists return NULL. */ - phnum = ehdr->e_phnum; + size_t phnum = ehdr->e_phnum; if (phnum == 0) { __libelf_seterrno (ELF_E_NO_PHDR); goto out; } - size = phnum * sizeof (ElfW2(LIBELFBITS,Phdr)); + size_t size = phnum * sizeof (ElfW2(LIBELFBITS,Phdr)); if (elf->map_address != NULL) { @@ -92,7 +90,6 @@ elfw2(LIBELFBITS,getphdr) (elf) ((char *) elf->map_address + elf->start_offset + ehdr->e_phoff); else { - size_t cnt; ElfW2(LIBELFBITS,Phdr) *notcvt; ElfW2(LIBELFBITS,Phdr) *phdr; @@ -124,7 +121,7 @@ elfw2(LIBELFBITS,getphdr) (elf) size); } - for (cnt = 0; cnt < phnum; ++cnt) + for (size_t cnt = 0; cnt < phnum; ++cnt) { CONVERT_TO (phdr[cnt].p_type, notcvt[cnt].p_type); CONVERT_TO (phdr[cnt].p_offset, notcvt[cnt].p_offset); @@ -166,11 +163,10 @@ elfw2(LIBELFBITS,getphdr) (elf) of the host convert the data now. */ if (ehdr->e_ident[EI_DATA] != MY_ELFDATA) { - ElfW2(LIBELFBITS,Phdr) *phdr; - size_t cnt; + ElfW2(LIBELFBITS,Phdr) *phdr + = elf->state.ELFW(elf,LIBELFBITS).phdr; - phdr = elf->state.ELFW(elf,LIBELFBITS).phdr; - for (cnt = 0; cnt < phnum; ++cnt) + for (size_t cnt = 0; cnt < phnum; ++cnt) { CONVERT (phdr[cnt].p_type); CONVERT (phdr[cnt].p_offset); diff --git a/elfutils/libelf/elf32_getshdr.c b/elfutils/libelf/elf32_getshdr.c index 1caf206c..1e26e854 100644 --- a/elfutils/libelf/elf32_getshdr.c +++ b/elfutils/libelf/elf32_getshdr.c @@ -1,5 +1,5 @@ /* Return section header. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -57,10 +57,6 @@ elfw2(LIBELFBITS,getshdr) (scn) /* Read the section header table. */ Elf *elf = scn->elf; ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; - size_t shnum; - ElfW2(LIBELFBITS,Shdr) *shdr; - size_t size; - size_t cnt; rwlock_wrlock (elf->lock); @@ -69,13 +65,14 @@ elfw2(LIBELFBITS,getshdr) (scn) if (result != NULL) goto out; + size_t shnum; if (INTUSE (elf_getshnum) (elf, &shnum) != 0) goto out; - size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); + size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); /* Allocate memory for the program headers. We know the number of entries from the ELF header. */ - shdr = elf->state.ELFW(elf,LIBELFBITS).shdr = + ElfW2(LIBELFBITS,Shdr) *shdr = elf->state.ELFW(elf,LIBELFBITS).shdr = (ElfW2(LIBELFBITS,Shdr) *) malloc (size); if (elf->state.ELFW(elf,LIBELFBITS).shdr == NULL) { @@ -111,7 +108,7 @@ elfw2(LIBELFBITS,getshdr) (scn) size); } - for (cnt = 0; cnt < shnum; ++cnt) + for (size_t cnt = 0; cnt < shnum; ++cnt) { CONVERT_TO (shdr[cnt].sh_name, notcvt[cnt].sh_name); CONVERT_TO (shdr[cnt].sh_type, notcvt[cnt].sh_type); @@ -140,7 +137,7 @@ elfw2(LIBELFBITS,getshdr) (scn) /* If the byte order of the file is not the same as the one of the host convert the data now. */ if (ehdr->e_ident[EI_DATA] != MY_ELFDATA) - for (cnt = 0; cnt < shnum; ++cnt) + for (size_t cnt = 0; cnt < shnum; ++cnt) { CONVERT (shdr[cnt].sh_name); CONVERT (shdr[cnt].sh_type); @@ -169,7 +166,7 @@ elfw2(LIBELFBITS,getshdr) (scn) } /* Set the pointers in the `scn's. */ - for (cnt = 0; cnt < shnum; ++cnt) + for (size_t cnt = 0; cnt < shnum; ++cnt) elf->state.ELFW(elf,LIBELFBITS).scns.data[cnt].shdr.ELFW(e,LIBELFBITS) = &elf->state.ELFW(elf,LIBELFBITS).shdr[cnt]; diff --git a/elfutils/libelf/elf32_updatefile.c b/elfutils/libelf/elf32_updatefile.c index 1a628811..14893def 100644 --- a/elfutils/libelf/elf32_updatefile.c +++ b/elfutils/libelf/elf32_updatefile.c @@ -1,5 +1,5 @@ /* Write changed data structures. - Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is free software; you can redistribute it and/or modify @@ -67,12 +67,8 @@ sort_sections (Elf_Scn **scns, Elf_ScnList *list) { Elf_Scn **scnp = scns; do - { - size_t cnt; - - for (cnt = 0; cnt < list->cnt; ++cnt) - *scnp++ = &list->data[cnt]; - } + for (size_t cnt = 0; cnt < list->cnt; ++cnt) + *scnp++ = &list->data[cnt]; while ((list = list->next) != NULL); qsort (scns, scnp - scns, sizeof (*scns), compare_sections); @@ -174,7 +170,6 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) char *shdr_start = ((char *) elf->map_address + elf->start_offset + ehdr->e_shoff); char *shdr_end = shdr_start + ehdr->e_shnum * ehdr->e_shentsize; - size_t cnt; #if EV_NUM != 2 xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]; @@ -190,7 +185,7 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) /* Iterate over all the section in the order in which they appear in the output file. */ - for (cnt = 0; cnt < shnum; ++cnt) + for (size_t cnt = 0; cnt < shnum; ++cnt) { Elf_Scn *scn = scns[cnt]; ElfW2(LIBELFBITS,Shdr) *shdr; @@ -352,12 +347,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum) { char fillbuf[FILLBUFSIZE]; size_t filled = 0; - ElfW2(LIBELFBITS,Ehdr) *ehdr; xfct_t fctp; - off_t last_offset; /* We need the ELF header several times. */ - ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; + ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; /* Write out the ELF header. */ if ((elf->state.ELFW(elf,LIBELFBITS).ehdr_flags | elf->flags) & ELF_F_DIRTY) @@ -465,6 +458,7 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum) /* From now on we have to keep track of the last position to eventually fill the gaps with the prescribed fill byte. */ + off_t last_offset; if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL) last_offset = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1); else @@ -474,14 +468,7 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum) /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) { - off_t shdr_offset; - Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; - ElfW2(LIBELFBITS,Shdr) *shdr_data; - Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *)); - int shdr_flags; - size_t cnt; - - shdr_offset = elf->start_offset + ehdr->e_shoff; + off_t shdr_offset = elf->start_offset + ehdr->e_shoff; #if EV_NUM != 2 xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]; #else @@ -489,27 +476,27 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum) # define shdr_fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR] #endif + ElfW2(LIBELFBITS,Shdr) *shdr_data; if (change_bo || elf->state.ELFW(elf,LIBELFBITS).shdr == NULL) shdr_data = (ElfW2(LIBELFBITS,Shdr) *) alloca (shnum * sizeof (ElfW2(LIBELFBITS,Shdr))); else shdr_data = elf->state.ELFW(elf,LIBELFBITS).shdr; - shdr_flags = elf->flags; + int shdr_flags = elf->flags; /* Get all sections into the array and sort them. */ + Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; + Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *)); sort_sections (scns, list); - for (cnt = 0; cnt < shnum; ++cnt) + for (size_t cnt = 0; cnt < shnum; ++cnt) { Elf_Scn *scn = scns[cnt]; - ElfW2(LIBELFBITS,Shdr) *shdr; - off_t scn_start; - Elf_Data_List *dl; - shdr = scn->shdr.ELFW(e,LIBELFBITS); + ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS); - scn_start = elf->start_offset + shdr->sh_offset; - dl = &scn->data_list; + off_t scn_start = elf->start_offset + shdr->sh_offset; + Elf_Data_List *dl = &scn->data_list; if (shdr->sh_type != SHT_NOBITS && scn->data_list_rear != NULL && scn->index != 0) diff --git a/elfutils/libelf/elf32_updatenull.c b/elfutils/libelf/elf32_updatenull.c index 9b8cb7b5..3bac9c11 100644 --- a/elfutils/libelf/elf32_updatenull.c +++ b/elfutils/libelf/elf32_updatenull.c @@ -1,5 +1,5 @@ /* Update data structures for changes. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is free software; you can redistribute it and/or modify @@ -105,14 +105,13 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf, int *change_bop, size_t shnum) ElfW2(LIBELFBITS,Ehdr) *ehdr = INTUSE(elfw2(LIBELFBITS,getehdr)) (elf); int changed = 0; int ehdr_flags = 0; - off_t size; /* Set the default values. */ if (ELFW(default_ehdr,LIBELFBITS) (elf, ehdr, shnum, change_bop) != 0) return -1; /* At least the ELF header is there. */ - size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1); + off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1); /* Set the program header position. */ if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL) @@ -166,19 +165,15 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf, int *change_bop, size_t shnum) do { - size_t cnt; - - for (cnt = first == true; cnt < list->cnt; ++cnt) + for (size_t cnt = first == true; cnt < list->cnt; ++cnt) { Elf_Scn *scn = &list->data[cnt]; ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS); off_t offset = 0; - ElfW2(LIBELFBITS,Word) sh_entsize; - ElfW2(LIBELFBITS,Word) sh_align; assert (shdr != NULL); - sh_entsize = shdr->sh_entsize; - sh_align = shdr->sh_addralign ?: 1; + ElfW2(LIBELFBITS,Word) sh_entsize = shdr->sh_entsize; + ElfW2(LIBELFBITS,Word) sh_align = shdr->sh_addralign ?: 1; /* Set the sh_entsize value if we can reliably detect it. */ switch (shdr->sh_type) diff --git a/elfutils/libelf/elf_begin.c b/elfutils/libelf/elf_begin.c index 63fe013e..404cbe83 100644 --- a/elfutils/libelf/elf_begin.c +++ b/elfutils/libelf/elf_begin.c @@ -1,5 +1,5 @@ /* Create descriptor for processing file. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -239,7 +239,6 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, /* This pointer might not be directly usable if the alignment is not sufficient for the architecture. */ Elf32_Ehdr *ehdr = (Elf32_Ehdr *) ((char *) map_address + offset); - size_t cnt; assert ((unsigned int) scncnt == scncnt); elf->state.elf32.scns.cnt = elf->state.elf32.scns.max = scncnt; @@ -266,7 +265,7 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, = (Elf32_Phdr *) ((char *) map_address + offset + elf->state.elf32.ehdr->e_phoff); - for (cnt = 0; cnt < scncnt; ++cnt) + for (size_t cnt = 0; cnt < scncnt; ++cnt) { elf->state.elf32.scns.data[cnt].index = cnt; elf->state.elf32.scns.data[cnt].elf = elf; @@ -309,7 +308,7 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, elf->state.elf32.ehdr = &elf->state.elf32.ehdr_mem; - for (cnt = 0; cnt < scncnt; ++cnt) + for (size_t cnt = 0; cnt < scncnt; ++cnt) { elf->state.elf32.scns.data[cnt].index = cnt; elf->state.elf32.scns.data[cnt].elf = elf; @@ -325,7 +324,6 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, /* This pointer might not be directly usable if the alignment is not sufficient for the architecture. */ Elf64_Ehdr *ehdr = (Elf64_Ehdr *) ((char *) map_address + offset); - size_t cnt; assert ((unsigned int) scncnt == scncnt); elf->state.elf64.scns.cnt = elf->state.elf64.scns.max = scncnt; @@ -352,7 +350,7 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, = (Elf64_Phdr *) ((char *) map_address + offset + elf->state.elf64.ehdr->e_phoff); - for (cnt = 0; cnt < scncnt; ++cnt) + for (size_t cnt = 0; cnt < scncnt; ++cnt) { elf->state.elf64.scns.data[cnt].index = cnt; elf->state.elf64.scns.data[cnt].elf = elf; @@ -395,7 +393,7 @@ file_read_elf (int fildes, void *map_address, off_t offset, size_t maxsize, elf->state.elf64.ehdr = &elf->state.elf64.ehdr_mem; - for (cnt = 0; cnt < scncnt; ++cnt) + for (size_t cnt = 0; cnt < scncnt; ++cnt) { elf->state.elf64.scns.data[cnt].index = cnt; elf->state.elf64.scns.data[cnt].elf = elf; @@ -506,6 +504,11 @@ read_file (int fildes, off_t offset, size_t maxsize, || cmd == ELF_C_WRITE_MMAP || cmd == ELF_C_READ_MMAP_PRIVATE); +#if _MUDFLAP + /* Mudflap doesn't grok that our mmap'd data is ok. */ + use_mmap = 0; +#endif + if (use_mmap) { if (parent == NULL) diff --git a/elfutils/libelf/elf_end.c b/elfutils/libelf/elf_end.c index 086ff633..33626f07 100644 --- a/elfutils/libelf/elf_end.c +++ b/elfutils/libelf/elf_end.c @@ -1,5 +1,5 @@ /* Free resources associated with Elf descriptor. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -197,5 +197,7 @@ elf_end (elf) /* Finally the descriptor itself. */ free (elf); - return parent != NULL && parent->ref_count == 0 ? elf_end (parent) : 0; + return (parent != NULL && parent->ref_count == 0 + ? INTUSE(elf_end) (parent) : 0); } +INTDEF(elf_end) diff --git a/elfutils/libelf/elf_error.c b/elfutils/libelf/elf_error.c index 93b7b3ee..168ce113 100644 --- a/elfutils/libelf/elf_error.c +++ b/elfutils/libelf/elf_error.c @@ -1,5 +1,5 @@ /* Error handling in libelf. - Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ elf_errmsg (error) #ifndef USE_TLS /* Free the thread specific data, this is done if a thread terminates. */ static void -free_key_mem (void *mem) +free_key_mem (void *mem __attribute__ ((unused))) { setspecific (key, NULL); } diff --git a/elfutils/libelf/elf_getarsym.c b/elfutils/libelf/elf_getarsym.c index d2fe75ab..1dafa9ac 100644 --- a/elfutils/libelf/elf_getarsym.c +++ b/elfutils/libelf/elf_getarsym.c @@ -1,5 +1,5 @@ /* Return symbol table of archive. - Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -36,8 +36,6 @@ elf_getarsym (elf, ptr) Elf *elf; size_t *ptr; { - Elf_Arsym *result; - if (elf->kind != ELF_K_AR) { /* This is no archive. */ @@ -57,23 +55,16 @@ elf_getarsym (elf, ptr) return NULL; } - result = elf->state.ar.ar_sym; + Elf_Arsym *result = elf->state.ar.ar_sym; if (result == NULL) { /* We have not yet read the index. */ - struct ar_hdr *index_hdr; - uint32_t n; - size_t index_size; - char tmpbuf[17]; - size_t ar_sym_len; - Elf_Arsym *arsym; - size_t cnt; - rwlock_wrlock (elf->lock); /* In case we find no index remember this for the next call. */ elf->state.ar.ar_sym = (Elf_Arsym *) -1l; + struct ar_hdr *index_hdr; if (elf->map_address == NULL) { /* We must read index from the file. */ @@ -126,6 +117,7 @@ elf_getarsym (elf, ptr) /* We have an archive. The first word in there is the number of entries in the table. */ + uint32_t n; if (elf->map_address == NULL) { if (pread (elf->fildes, &n, sizeof (n), @@ -146,9 +138,10 @@ elf_getarsym (elf, ptr) /* Now we can perform some first tests on whether all the data needed for the index is available. */ + char tmpbuf[17]; memcpy (tmpbuf, index_hdr->ar_size, 10); tmpbuf[10] = '\0'; - index_size = atol (tmpbuf); + size_t index_size = atol (tmpbuf); if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size || n * sizeof (uint32_t) > index_size) @@ -160,7 +153,7 @@ elf_getarsym (elf, ptr) } /* Now we can allocate the arrays needed to store the index. */ - ar_sym_len = (n + 1) * sizeof (Elf_Arsym); + size_t ar_sym_len = (n + 1) * sizeof (Elf_Arsym); elf->state.ar.ar_sym = (Elf_Arsym *) malloc (ar_sym_len); if (elf->state.ar.ar_sym != NULL) { @@ -169,14 +162,11 @@ elf_getarsym (elf, ptr) if (elf->map_address == NULL) { - char *new_str; - Elf_Arsym *newp; - file_data = (uint32_t *) alloca (n * sizeof (uint32_t)); ar_sym_len += index_size - n * sizeof (uint32_t); - newp = (Elf_Arsym *) realloc (elf->state.ar.ar_sym, - ar_sym_len); + Elf_Arsym *newp = (Elf_Arsym *) realloc (elf->state.ar.ar_sym, + ar_sym_len); if (newp == NULL) { free (elf->state.ar.ar_sym); @@ -186,7 +176,7 @@ elf_getarsym (elf, ptr) } elf->state.ar.ar_sym = newp; - new_str = (char *) (elf->state.ar.ar_sym + n + 1); + char *new_str = (char *) (elf->state.ar.ar_sym + n + 1); /* Now read the data from the file. */ if ((size_t) pread (elf->fildes, file_data, @@ -218,8 +208,8 @@ elf_getarsym (elf, ptr) } /* Now we can build the data structure. */ - arsym = elf->state.ar.ar_sym; - for (cnt = 0; cnt < n; ++cnt) + Elf_Arsym *arsym = elf->state.ar.ar_sym; + for (size_t cnt = 0; cnt < n; ++cnt) { arsym[cnt].as_name = str_data; if (__BYTE_ORDER == __LITTLE_ENDIAN) diff --git a/elfutils/libelf/elf_getdata.c b/elfutils/libelf/elf_getdata.c index 2d5f27af..3150649c 100644 --- a/elfutils/libelf/elf_getdata.c +++ b/elfutils/libelf/elf_getdata.c @@ -1,5 +1,5 @@ /* Return the next data element from the section after possibly converting it. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -109,15 +109,15 @@ static const struct /* Convert the data in the current section. */ static void -convert_data (Elf_Scn *scn, int version, int eclass, int data, - size_t size, size_t type) +convert_data (Elf_Scn *scn, int version __attribute__ ((unused)), int eclass, + int data, size_t size, size_t type) { #if ALLOW_ALIGNED /* No need to compute the alignment requirement of the host. */ const size_t align = 1; #else # if EV_NUM != 2 - size_t align = shtype_map[__libelf_version - 1][eclass - 1][type].align; + size_t align = shtype_map[version - 1][eclass - 1][type].align; # else size_t align = shtype_map[0][eclass - 1][type].align; # endif @@ -223,7 +223,7 @@ __libelf_set_rawdata (Elf_Scn *scn) { GElf_Ehdr ehdr_mem; - entsize = SH_ENTSIZE_HASH (gelf_getehdr (elf, &ehdr_mem)); + entsize = SH_ENTSIZE_HASH (INTUSE(gelf_getehdr) (elf, &ehdr_mem)); } else { @@ -298,8 +298,9 @@ __libelf_set_rawdata (Elf_Scn *scn) { GElf_Ehdr ehdr_mem; - scn->rawdata.d.d_type = (SH_ENTSIZE_HASH (gelf_getehdr (elf, &ehdr_mem)) - == 4 ? ELF_T_WORD : ELF_T_XWORD); + scn->rawdata.d.d_type + = (SH_ENTSIZE_HASH (INTUSE(gelf_getehdr) (elf, &ehdr_mem)) + == 4 ? ELF_T_WORD : ELF_T_XWORD); } else { diff --git a/elfutils/libelf/elf_update.c b/elfutils/libelf/elf_update.c index ece22251..f7c638d3 100644 --- a/elfutils/libelf/elf_update.c +++ b/elfutils/libelf/elf_update.c @@ -1,5 +1,5 @@ /* Update data structures for changes and write them out. - Copyright (C) 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. This program is free software; you can redistribute it and/or modify @@ -37,7 +37,8 @@ write_file (Elf *elf, off_t size, int change_bo, size_t shnum) prevent programs to use the data of the file in generating the new file. We truncate the file later in this case. */ if (elf->parent == NULL - && (elf->maximum_size == ~((size_t) 0) || size > elf->maximum_size) + && (elf->maximum_size == ~((size_t) 0) + || (size_t) size > elf->maximum_size) && unlikely (ftruncate (elf->fildes, size) != 0)) { __libelf_seterrno (ELF_E_WRITE_ERROR); @@ -47,10 +48,14 @@ write_file (Elf *elf, off_t size, int change_bo, size_t shnum) /* Try to map the file if this isn't done yet. */ if (elf->map_address == NULL && elf->cmd == ELF_C_WRITE_MMAP) { +#if _MUDFLAP + /* Mudflap doesn't grok that our mmap'd data is ok. */ +#else elf->map_address = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, elf->fildes, 0); if (unlikely (elf->map_address == MAP_FAILED)) elf->map_address = NULL; +#endif } if (elf->map_address != NULL) @@ -75,7 +80,7 @@ write_file (Elf *elf, off_t size, int change_bo, size_t shnum) if (size != -1 && elf->parent == NULL && elf->maximum_size != ~((size_t) 0) - && size < elf->maximum_size + && (size_t) size < elf->maximum_size && unlikely (ftruncate (elf->fildes, size) != 0)) { __libelf_seterrno (ELF_E_WRITE_ERROR); diff --git a/elfutils/libelf/gelf.h b/elfutils/libelf/gelf.h index 9d9b3239..299d6c83 100644 --- a/elfutils/libelf/gelf.h +++ b/elfutils/libelf/gelf.h @@ -1,5 +1,5 @@ /* This file defines generic ELF types, structures, and macros. - Copyright (C) 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. 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 @@ -297,6 +297,10 @@ extern char *gelf_rawchunk (Elf *__elf, GElf_Off __offset, GElf_Word __size); /* Release uninterpreted chunk of the file contents. */ extern void gelf_freechunk (Elf *__elf, char *__ptr); + +/* Compute simple checksum from permanent parts of the ELF file. */ +extern long int gelf_checksum (Elf *__elf); + #ifdef __cplusplus } #endif diff --git a/elfutils/libelf/gelf_getehdr.c b/elfutils/libelf/gelf_getehdr.c index 6b926442..5c323dc5 100644 --- a/elfutils/libelf/gelf_getehdr.c +++ b/elfutils/libelf/gelf_getehdr.c @@ -1,5 +1,5 @@ /* Get ELF header. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -20,6 +20,8 @@ #endif #include <gelf.h> +#include <stddef.h> +#include <stdlib.h> #include <string.h> #include "libelfP.h" @@ -43,46 +45,44 @@ gelf_getehdr (elf, dest) rwlock_rdlock (elf->lock); - if (elf->class == ELFCLASS32) + /* The following is an optimization: the ehdr element is at the same + position in both the elf32 and elf64 structure. */ + if (offsetof (struct Elf, state.elf32.ehdr) + != offsetof (struct Elf, state.elf64.ehdr)) + abort (); + /* Just pick one of the values. */ + if (unlikely (elf->state.elf64.ehdr == NULL)) + /* Maybe no ELF header was created yet. */ + __libelf_seterrno (ELF_E_WRONG_ORDER_EHDR); + else if (elf->class == ELFCLASS32) { Elf32_Ehdr *ehdr = elf->state.elf32.ehdr; - /* Maybe no ELF header was created yet. */ - if (ehdr == NULL) - __libelf_seterrno (ELF_E_WRONG_ORDER_EHDR); - else - { - /* Convert the 32-bit struct to an 64-bit one. */ - memcpy (dest->e_ident, ehdr->e_ident, EI_NIDENT); + /* Convert the 32-bit struct to an 64-bit one. */ + memcpy (dest->e_ident, ehdr->e_ident, EI_NIDENT); #define COPY(name) \ - dest->name = ehdr->name - COPY (e_type); - COPY (e_machine); - COPY (e_version); - COPY (e_entry); - COPY (e_phoff); - COPY (e_shoff); - COPY (e_flags); - COPY (e_ehsize); - COPY (e_phentsize); - COPY (e_phnum); - COPY (e_shentsize); - COPY (e_shnum); - COPY (e_shstrndx); - - result = dest; - } + dest->name = ehdr->name + COPY (e_type); + COPY (e_machine); + COPY (e_version); + COPY (e_entry); + COPY (e_phoff); + COPY (e_shoff); + COPY (e_flags); + COPY (e_ehsize); + COPY (e_phentsize); + COPY (e_phnum); + COPY (e_shentsize); + COPY (e_shnum); + COPY (e_shstrndx); + + result = dest; } else - { - /* Maybe no ELF header was created yet. */ - if (elf->state.elf64.ehdr == NULL) - __libelf_seterrno (ELF_E_WRONG_ORDER_EHDR); - else - result = memcpy (dest, elf->state.elf64.ehdr, sizeof (*dest)); - } + result = memcpy (dest, elf->state.elf64.ehdr, sizeof (*dest)); rwlock_unlock (elf->lock); return result; } +INTDEF(gelf_getehdr) diff --git a/elfutils/libelf/gelf_xlate.c b/elfutils/libelf/gelf_xlate.c index baa83632..bbb133a3 100644 --- a/elfutils/libelf/gelf_xlate.c +++ b/elfutils/libelf/gelf_xlate.c @@ -1,5 +1,5 @@ /* Transformation functions for ELF data types. - Copyright (C) 1998, 1999, 2000, 2002, 2004 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -36,7 +36,8 @@ ? (void) (*((char *) (dest)) = *((char *) (src))) \ : Elf32_cvt_Byte (dest, src, n)) static void -(elf_cvt_Byte) (void *dest, const void *src, size_t n, int encode) +(elf_cvt_Byte) (void *dest, const void *src, size_t n, + int encode __attribute__ ((unused))) { memmove (dest, src, n); } @@ -67,7 +68,8 @@ static void #define INLINE2(Bytes, FName, TName) \ INLINE3 (Bytes, FName, TName) #define INLINE3(Bytes, FName, TName) \ - static void FName (void *dest, const void *ptr, size_t len, int encode) \ + static void FName (void *dest, const void *ptr, size_t len, \ + int encode __attribute__ ((unused))) \ { \ size_t n = len / sizeof (TName); \ if (dest < ptr) \ @@ -105,11 +107,11 @@ static void #define START(Bits, Name, EName) \ static void \ ElfW2 (Bits, cvt_##Name) (void *dest, const void *src, size_t len, \ - int encode) \ + int encode __attribute__ ((unused))) \ { ElfW2(Bits, Name) *tdest = (ElfW2(Bits, Name) *) dest; \ ElfW2(Bits, Name) *tsrc = (ElfW2(Bits, Name) *) src; \ - size_t n = len / sizeof (ElfW2(Bits, Name)); \ - for (; n > 0; ++tdest, ++tsrc, --n) { + size_t n; \ + for (n = len / sizeof (ElfW2(Bits, Name)); n > 0; ++tdest, ++tsrc, --n) { #define END(Bits, Name) } } #define TYPE_EXTRA(Code) #define TYPE_XLATE(Code) Code diff --git a/elfutils/libelf/libelfP.h b/elfutils/libelf/libelfP.h index fd39a38f..100f349a 100644 --- a/elfutils/libelf/libelfP.h +++ b/elfutils/libelf/libelfP.h @@ -1,5 +1,5 @@ /* Internal interfaces for libelf. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Red Hat, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -440,6 +440,7 @@ extern int __elf64_updatefile (Elf *elf, int change_bo, size_t shnum) /* Alias for exported functions to avoid PLT entries. */ +extern int __elf_end_internal (Elf *__elf); extern Elf *__elf_begin_internal (int __fildes, Elf_Cmd __cmd, Elf *__ref) attribute_hidden; extern Elf32_Ehdr *__elf32_getehdr_internal (Elf *__elf) attribute_hidden; @@ -492,6 +493,7 @@ extern long int __elf32_checksum_internal (Elf *__elf) attribute_hidden; extern long int __elf64_checksum_internal (Elf *__elf) attribute_hidden; +extern GElf_Ehdr *__gelf_getehdr_internal (Elf *__elf, GElf_Ehdr *__dest); extern size_t __gelf_fsize_internal (Elf *__elf, Elf_Type __type, size_t __count, unsigned int __version) attribute_hidden; diff --git a/elfutils/libelf/nlist.c b/elfutils/libelf/nlist.c index cc42a31e..b9ff2130 100644 --- a/elfutils/libelf/nlist.c +++ b/elfutils/libelf/nlist.c @@ -1,5 +1,5 @@ /* Extract symbol list from binary. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is free software; you can redistribute it and/or modify @@ -195,7 +195,7 @@ nlist (const char *filename, struct nlist *nl) nlist_fshash_fini (table); /* We do not need the ELF descriptor anymore. */ - (void) elf_end (elf); + (void) INTUSE(elf_end) (elf); return 0; @@ -204,7 +204,7 @@ nlist (const char *filename, struct nlist *nl) fail_close: /* We do not need the ELF descriptor anymore. */ - (void) elf_end (elf); + (void) INTUSE(elf_end) (elf); fail: /* We have to set all entries to zero. */ diff --git a/elfutils/m4/ChangeLog b/elfutils/m4/ChangeLog index 53721633..112c9c7b 100644 --- a/elfutils/m4/ChangeLog +++ b/elfutils/m4/ChangeLog @@ -1,15 +1,20 @@ -2002-03-22 gettextize <bug-gnu-gettext@gnu.org> +2005-02-15 Ulrich Drepper <drepper@redhat.com> - * codeset.m4: Upgrade to gettext-0.11. - * gettext.m4: Upgrade to gettext-0.11. - * glibc21.m4: Upgrade to gettext-0.11. - * iconv.m4: Upgrade to gettext-0.11. - * isc-posix.m4: Upgrade to gettext-0.11. - * lcmessage.m4: Upgrade to gettext-0.11. - * lib-ld.m4: Upgrade to gettext-0.11. - * lib-link.m4: Upgrade to gettext-0.11. - * lib-prefix.m4: Upgrade to gettext-0.11. - * progtest.m4: Upgrade to gettext-0.11. + * Makefile.am (EXTRA_DIST): Remove glibc21.m4, intdiv0.m4, + inttypes.m4, inttypes_h.m4, inttypes-pri.m4, isc-posix.m4, + lib-ld.m4, lib-link.m4, lib-prefix.m4, stdint_h.m4, uintmax_t.m4, + and ulonglong.m4. + * glibc21.m4: Removed. + * inttypes_h.m4: Removed. + * inttypes.m4: Removed. + * inttypes-pri.m4: Removed. + * isc-posix.m4: Removed. + * lib-ld.m4: Removed. + * lib-link.m4: Removed. + * lib-prefix.m4: Removed. + * stdint_h.m4: Removed. + * uintmax_t.m4: Removed. + * ulonglong.m4: Removed. 2002-03-22 gettextize <bug-gnu-gettext@gnu.org> @@ -24,4 +29,3 @@ * lib-prefix.m4: Upgrade to gettext-0.11. * progtest.m4: Upgrade to gettext-0.11. * Makefile.am (EXTRA_DIST): Add the new files. - diff --git a/elfutils/m4/Makefile.am b/elfutils/m4/Makefile.am index 9e20ae15..c77e3fbd 100644 --- a/elfutils/m4/Makefile.am +++ b/elfutils/m4/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*- -## Configure input file for elfutils. ## -## Copyright (C) 2000, 2001, 2002, 2004 Red Hat, Inc. +## Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. ## ## 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 @@ -18,7 +17,4 @@ ## ##m4-files-begin -EXTRA_DIST = isc-posix.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 \ - lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 \ - progtest.m4 iconv.m4 intdiv0.m4 inttypes-pri.m4 inttypes.m4 \ - uintmax_t.m4 inttypes_h.m4 stdint_h.m4 ulonglong.m4 +EXTRA_DIST = codeset.m4 gettext.m4 iconv.m4 lcmessage.m4 progtest.m4 diff --git a/elfutils/m4/Makefile.in b/elfutils/m4/Makefile.in index 1712984c..836a1a7b 100644 --- a/elfutils/m4/Makefile.in +++ b/elfutils/m4/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -39,8 +39,6 @@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -61,7 +59,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -70,25 +67,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -106,7 +97,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -154,11 +144,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -EXTRA_DIST = isc-posix.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 \ - lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 \ - progtest.m4 iconv.m4 intdiv0.m4 inttypes-pri.m4 inttypes.m4 \ - uintmax_t.m4 inttypes_h.m4 stdint_h.m4 ulonglong.m4 - +EXTRA_DIST = codeset.m4 gettext.m4 iconv.m4 lcmessage.m4 progtest.m4 all: all-am .SUFFIXES: diff --git a/elfutils/m4/glibc21.m4 b/elfutils/m4/glibc21.m4 deleted file mode 100644 index 9c9f3db3..00000000 --- a/elfutils/m4/glibc21.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# Test for the GNU C Library, version 2.1 or newer. -# From Bruno Haible. - -AC_DEFUN([jm_GLIBC21], - [ - AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, - ac_cv_gnu_library_2_1, - [AC_EGREP_CPP([Lucky GNU user], - [ -#include <features.h> -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif - ], - ac_cv_gnu_library_2_1=yes, - ac_cv_gnu_library_2_1=no) - ] - ) - AC_SUBST(GLIBC21) - GLIBC21="$ac_cv_gnu_library_2_1" - ] -) diff --git a/elfutils/m4/intdiv0.m4 b/elfutils/m4/intdiv0.m4 deleted file mode 100644 index 55dddcf1..00000000 --- a/elfutils/m4/intdiv0.m4 +++ /dev/null @@ -1,72 +0,0 @@ -# intdiv0.m4 serial 1 (gettext-0.11.3) -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -AC_DEFUN([gt_INTDIV0], -[ - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_CANONICAL_HOST])dnl - - AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], - gt_cv_int_divbyzero_sigfpe, - [ - AC_TRY_RUN([ -#include <stdlib.h> -#include <signal.h> - -static void -#ifdef __cplusplus -sigfpe_handler (int sig) -#else -sigfpe_handler (sig) int sig; -#endif -{ - /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ - exit (sig != SIGFPE); -} - -int x = 1; -int y = 0; -int z; -int nan; - -int main () -{ - signal (SIGFPE, sigfpe_handler); -/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ -#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) - signal (SIGTRAP, sigfpe_handler); -#endif -/* Linux/SPARC yields signal SIGILL. */ -#if defined (__sparc__) && defined (__linux__) - signal (SIGILL, sigfpe_handler); -#endif - - z = x / y; - nan = y / y; - exit (1); -} -], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, - [ - # Guess based on the CPU. - case "$host_cpu" in - alpha* | i[34567]86 | m68k | s390*) - gt_cv_int_divbyzero_sigfpe="guessing yes";; - *) - gt_cv_int_divbyzero_sigfpe="guessing no";; - esac - ]) - ]) - case "$gt_cv_int_divbyzero_sigfpe" in - *yes) value=1;; - *) value=0;; - esac - AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, - [Define if integer division by zero raises signal SIGFPE.]) -]) diff --git a/elfutils/m4/inttypes-pri.m4 b/elfutils/m4/inttypes-pri.m4 deleted file mode 100644 index fd007c31..00000000 --- a/elfutils/m4/inttypes-pri.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# inttypes-pri.m4 serial 1 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -AC_DEFUN([gt_INTTYPES_PRI], -[ - AC_REQUIRE([gt_HEADER_INTTYPES_H]) - if test $gt_cv_header_inttypes_h = yes; then - AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], - gt_cv_inttypes_pri_broken, - [ - AC_TRY_COMPILE([#include <inttypes.h> -#ifdef PRId32 -char *p = PRId32; -#endif -], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) - ]) - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, - [Define if <inttypes.h> exists and defines unusable PRI* macros.]) - fi -]) diff --git a/elfutils/m4/inttypes.m4 b/elfutils/m4/inttypes.m4 deleted file mode 100644 index ab370ffe..00000000 --- a/elfutils/m4/inttypes.m4 +++ /dev/null @@ -1,27 +0,0 @@ -# inttypes.m4 serial 1 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with -# <sys/types.h>. - -AC_DEFUN([gt_HEADER_INTTYPES_H], -[ - AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, - [ - AC_TRY_COMPILE( - [#include <sys/types.h> -#include <inttypes.h>], - [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) - ]) - if test $gt_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, - [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.]) - fi -]) diff --git a/elfutils/m4/inttypes_h.m4 b/elfutils/m4/inttypes_h.m4 deleted file mode 100644 index 400a1118..00000000 --- a/elfutils/m4/inttypes_h.m4 +++ /dev/null @@ -1,28 +0,0 @@ -# inttypes_h.m4 serial 4 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, -# doesn't clash with <sys/types.h>, and declares uintmax_t. - -AC_DEFUN([jm_AC_HEADER_INTTYPES_H], -[ - AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, - [AC_TRY_COMPILE( - [#include <sys/types.h> -#include <inttypes.h>], - [uintmax_t i = (uintmax_t) -1;], - jm_ac_cv_header_inttypes_h=yes, - jm_ac_cv_header_inttypes_h=no)]) - if test $jm_ac_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, -[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, - and declares uintmax_t. ]) - fi -]) diff --git a/elfutils/m4/isc-posix.m4 b/elfutils/m4/isc-posix.m4 deleted file mode 100644 index 1319dd1c..00000000 --- a/elfutils/m4/isc-posix.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) diff --git a/elfutils/m4/lib-ld.m4 b/elfutils/m4/lib-ld.m4 deleted file mode 100644 index ddb57323..00000000 --- a/elfutils/m4/lib-ld.m4 +++ /dev/null @@ -1,97 +0,0 @@ -# lib-ld.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - acl_cv_prog_gnu_ld=yes -else - acl_cv_prog_gnu_ld=no -fi]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) diff --git a/elfutils/m4/lib-link.m4 b/elfutils/m4/lib-link.m4 deleted file mode 100644 index a16aa446..00000000 --- a/elfutils/m4/lib-link.m4 +++ /dev/null @@ -1,521 +0,0 @@ -# lib-link.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L, -dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. -AC_DEFUN([AC_LIB_RPATH], -[ - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" - sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) diff --git a/elfutils/m4/lib-prefix.m4 b/elfutils/m4/lib-prefix.m4 deleted file mode 100644 index b8b79ab9..00000000 --- a/elfutils/m4/lib-prefix.m4 +++ /dev/null @@ -1,148 +0,0 @@ -# lib-prefix.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) diff --git a/elfutils/m4/stdint_h.m4 b/elfutils/m4/stdint_h.m4 deleted file mode 100644 index 4b5a4ac6..00000000 --- a/elfutils/m4/stdint_h.m4 +++ /dev/null @@ -1,28 +0,0 @@ -# stdint_h.m4 serial 2 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, -# doesn't clash with <sys/types.h>, and declares uintmax_t. - -AC_DEFUN([jm_AC_HEADER_STDINT_H], -[ - AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, - [AC_TRY_COMPILE( - [#include <sys/types.h> -#include <stdint.h>], - [uintmax_t i = (uintmax_t) -1;], - jm_ac_cv_header_stdint_h=yes, - jm_ac_cv_header_stdint_h=no)]) - if test $jm_ac_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, -[Define if <stdint.h> exists, doesn't clash with <sys/types.h>, - and declares uintmax_t. ]) - fi -]) diff --git a/elfutils/m4/uintmax_t.m4 b/elfutils/m4/uintmax_t.m4 deleted file mode 100644 index ec3a8b92..00000000 --- a/elfutils/m4/uintmax_t.m4 +++ /dev/null @@ -1,29 +0,0 @@ -# uintmax_t.m4 serial 6 (gettext-0.11) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -AC_PREREQ(2.13) - -# Define uintmax_t to `unsigned long' or `unsigned long long' -# if <inttypes.h> does not exist. - -AC_DEFUN([jm_AC_TYPE_UINTMAX_T], -[ - AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) - AC_REQUIRE([jm_AC_HEADER_STDINT_H]) - if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then - AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) - test $ac_cv_type_unsigned_long_long = yes \ - && ac_type='unsigned long long' \ - || ac_type='unsigned long' - AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, - [Define to unsigned long or unsigned long long - if <inttypes.h> and <stdint.h> don't define.]) - fi -]) diff --git a/elfutils/m4/ulonglong.m4 b/elfutils/m4/ulonglong.m4 deleted file mode 100644 index c375e474..00000000 --- a/elfutils/m4/ulonglong.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) -dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], -[ - AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, - [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], - [unsigned long long ullmax = (unsigned long long) -1; - return ull << i | ull >> i | ullmax / ull | ullmax % ull;], - ac_cv_type_unsigned_long_long=yes, - ac_cv_type_unsigned_long_long=no)]) - if test $ac_cv_type_unsigned_long_long = yes; then - AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, - [Define if you have the unsigned long long type.]) - fi -]) diff --git a/elfutils/po/ChangeLog b/elfutils/po/ChangeLog index 179bb950..fc65e99a 100644 --- a/elfutils/po/ChangeLog +++ b/elfutils/po/ChangeLog @@ -1,7 +1,15 @@ +2005-05-07 Ulrich Drepper <drepper@redhat.com> + + * Makefile.in.in (XGETTEXT_OPTIONS): Define. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * POTFILES.in: Remove unnecessary entries. + 2004-01-18 Ulrich Drepper <drepper@redhat.com> * POTFILES.in: Add files from libdw, libebl, and libasm. 2003-08-11 Ulrich Drepper <drepper@redhat.com> - * Moved to CVS archive. + * Moved to CVS archive. diff --git a/elfutils/po/Makefile.in.in b/elfutils/po/Makefile.in.in index d1e93381..dbd78851 100644 --- a/elfutils/po/Makefile.in.in +++ b/elfutils/po/Makefile.in.in @@ -33,6 +33,7 @@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ +XGETTEXT_OPTIONS = --flag=error:3:c-format MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit diff --git a/elfutils/po/POTFILES.in b/elfutils/po/POTFILES.in index aa813125..dffb85e3 100644 --- a/elfutils/po/POTFILES.in +++ b/elfutils/po/POTFILES.in @@ -1,11 +1,15 @@ # List of files which containing translatable strings. -# Copyright (C) 2000 Red Hat, Inc. +# Copyright (C) 2000, 2005 Red Hat, Inc. # Files from the compatibility library lib/xmalloc.c lib/xstrdup.c lib/xstrndup.c +# Library sources +libasm/asm_error.c +libdw/dwarf_error.c + # Program sources src/nm.c src/readelf.c @@ -15,28 +19,5 @@ src/ld.c src/ldgeneric.c src/ldscript.y src/elflint.c -libasm/asm_begin.c -libasm/asm_abort.c -libasm/asm_end.c -libasm/asm_error.c -libasm/asm_getelf.c -libdw/dwarf_error.c -# List of files which containing translatable strings. -# Copyright (C) 2000 Red Hat, Inc. - -# Library sources -libebl/eblclosebackend.c -libebl/eblopenbackend.c -libebl/eblstrtab.c -libebl/i386_destr.c -libebl/i386_init.c -libebl/i386_symbol.c -libebl/mips_destr.c -libebl/mips_init.c -libebl/mips_symbol.c -libebl/sh_destr.c -libebl/sh_init.c -libebl/sh_symbol.c -libebl/sparc_destr.c -libebl/sparc_init.c -libebl/sparc_symbol.c +src/addr2line.c +src/findtextrel.c diff --git a/elfutils/po/elfutils.pot b/elfutils/po/elfutils.pot index 4fe08eba..c8b01fca 100644 --- a/elfutils/po/elfutils.pot +++ b/elfutils/po/elfutils.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-09-25 12:42-0700\n" +"POT-Creation-Date: 2005-05-09 22:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -21,103 +21,267 @@ msgstr "" msgid "memory exhausted" msgstr "" -#: src/nm.c:59 src/readelf.c:51 src/strip.c:57 +#: libasm/asm_error.c:108 libdw/dwarf_error.c:74 +msgid "no error" +msgstr "" + +#: libasm/asm_error.c:109 libdw/dwarf_error.c:83 +msgid "out of memory" +msgstr "" + +#: libasm/asm_error.c:110 src/ldgeneric.c:2474 +msgid "cannot create output file" +msgstr "" + +#: libasm/asm_error.c:111 +msgid "invalid parameter" +msgstr "" + +#: libasm/asm_error.c:112 +msgid "cannot change mode of output file" +msgstr "" + +#: libasm/asm_error.c:113 src/ldgeneric.c:6246 +msgid "cannot rename output file" +msgstr "" + +#: libasm/asm_error.c:114 +msgid "duplicate symbol" +msgstr "" + +#: libasm/asm_error.c:115 +msgid "invalid section type for operation" +msgstr "" + +#: libasm/asm_error.c:149 +msgid "Unknown error" +msgstr "" + +#: libdw/dwarf_error.c:75 +msgid "unknown error" +msgstr "" + +#: libdw/dwarf_error.c:76 +msgid "invalid access" +msgstr "" + +#: libdw/dwarf_error.c:77 +msgid "no regular file" +msgstr "" + +#: libdw/dwarf_error.c:78 +msgid "I/O error" +msgstr "" + +#: libdw/dwarf_error.c:79 +msgid "invalid ELF file" +msgstr "" + +#: libdw/dwarf_error.c:80 +msgid "no DWARF information" +msgstr "" + +#: libdw/dwarf_error.c:81 +msgid "no ELF file" +msgstr "" + +#: libdw/dwarf_error.c:82 +msgid "cannot get ELF header" +msgstr "" + +#: libdw/dwarf_error.c:84 +msgid "not implemented" +msgstr "" + +#: libdw/dwarf_error.c:85 +msgid "invalid command" +msgstr "" + +#: libdw/dwarf_error.c:86 +msgid "invalid version" +msgstr "" + +#: libdw/dwarf_error.c:87 +msgid "invalid file" +msgstr "" + +#: libdw/dwarf_error.c:88 +msgid "no entries found" +msgstr "" + +#: libdw/dwarf_error.c:89 +msgid "invalid DWARF" +msgstr "" + +#: libdw/dwarf_error.c:90 +msgid "no string data" +msgstr "" + +#: libdw/dwarf_error.c:91 +msgid "no address value" +msgstr "" + +#: libdw/dwarf_error.c:92 +msgid "no constant value" +msgstr "" + +#: libdw/dwarf_error.c:93 +msgid "no reference value" +msgstr "" + +#: libdw/dwarf_error.c:94 +msgid "invalid reference value" +msgstr "" + +#: libdw/dwarf_error.c:95 +msgid ".debug_line section missing" +msgstr "" + +#: libdw/dwarf_error.c:96 +msgid "invalid .debug_line section" +msgstr "" + +#: libdw/dwarf_error.c:97 +msgid "debug information too big" +msgstr "" + +#: libdw/dwarf_error.c:98 +msgid "invalid DWARF version" +msgstr "" + +#: libdw/dwarf_error.c:99 +msgid "invalid directory index" +msgstr "" + +#: libdw/dwarf_error.c:100 +msgid "address out of range" +msgstr "" + +#: libdw/dwarf_error.c:101 +msgid "no location list value" +msgstr "" + +#: libdw/dwarf_error.c:102 +msgid "no block data" +msgstr "" + +#: libdw/dwarf_error.c:103 +msgid "invalid line index" +msgstr "" + +#: libdw/dwarf_error.c:104 +msgid "invalid address range index" +msgstr "" + +#: libdw/dwarf_error.c:105 +msgid "no matching address range" +msgstr "" + +#: libdw/dwarf_error.c:106 +msgid "no flag value" +msgstr "" + +#: libdw/dwarf_error.c:107 +msgid "invalid offset" +msgstr "" + +#: src/nm.c:62 src/readelf.c:54 src/strip.c:60 msgid "Output selection:" msgstr "" -#: src/nm.c:60 +#: src/nm.c:63 msgid "Display debugger-only symbols" msgstr "" -#: src/nm.c:61 +#: src/nm.c:64 msgid "Display only defined symbols" msgstr "" -#: src/nm.c:64 +#: src/nm.c:67 msgid "Display dynamic symbols instead of normal symbols" msgstr "" -#: src/nm.c:65 +#: src/nm.c:68 msgid "Display only external symbols" msgstr "" -#: src/nm.c:66 +#: src/nm.c:69 msgid "Display only undefined symbols" msgstr "" -#: src/nm.c:68 +#: src/nm.c:71 msgid "Include index for symbols from archive members" msgstr "" -#: src/nm.c:70 src/size.c:51 +#: src/nm.c:73 src/size.c:54 msgid "Output format:" msgstr "" -#: src/nm.c:72 +#: src/nm.c:75 msgid "Print name of the input file before every symbol" msgstr "" -#: src/nm.c:75 +#: src/nm.c:78 msgid "" "Use the output format FORMAT. FORMAT can be `bsd', `sysv' or `posix'. The " "default is `sysv'" msgstr "" -#: src/nm.c:77 +#: src/nm.c:80 msgid "Same as --format=bsd" msgstr "" -#: src/nm.c:78 +#: src/nm.c:81 msgid "Same as --format=posix" msgstr "" -#: src/nm.c:79 src/size.c:55 +#: src/nm.c:82 src/size.c:60 msgid "Use RADIX for printing symbol values" msgstr "" -#: src/nm.c:80 +#: src/nm.c:83 msgid "Mark weak symbols" msgstr "" -#: src/nm.c:81 +#: src/nm.c:84 msgid "Print size of defined symbols" msgstr "" -#: src/nm.c:83 src/size.c:61 src/strip.c:61 +#: src/nm.c:86 src/size.c:68 src/strip.c:65 msgid "Output options:" msgstr "" -#: src/nm.c:84 +#: src/nm.c:87 msgid "Sort symbols numerically by address" msgstr "" -#: src/nm.c:86 +#: src/nm.c:89 msgid "Do not sort the symbols" msgstr "" -#: src/nm.c:87 +#: src/nm.c:90 msgid "Reverse the sense of the sort" msgstr "" -#: src/nm.c:88 +#: src/nm.c:91 src/addr2line.c:59 src/findtextrel.c:61 msgid "Miscellaneous:" msgstr "" -#: src/nm.c:93 +#: src/nm.c:96 msgid "List symbols from FILEs (a.out by default)." msgstr "" -#: src/nm.c:96 src/size.c:72 src/strip.c:76 +#: src/nm.c:99 src/size.c:80 src/strip.c:80 src/findtextrel.c:70 msgid "[FILE...]" msgstr "" -#: src/nm.c:124 src/size.c:100 src/strip.c:103 +#: src/nm.c:124 src/size.c:105 src/strip.c:104 #, c-format msgid "%s: INTERNAL ERROR %d (%s-%s): %s" msgstr "" -#: src/nm.c:241 src/readelf.c:376 src/size.c:202 src/strip.c:182 src/ld.c:871 -#: src/elflint.c:241 +#: src/nm.c:241 src/readelf.c:351 src/size.c:207 src/strip.c:187 src/ld.c:857 +#: src/elflint.c:220 src/addr2line.c:216 src/findtextrel.c:156 #, c-format msgid "" "Copyright (C) %s Red Hat, Inc.\n" @@ -125,66 +289,66 @@ msgid "" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" msgstr "" -#: src/nm.c:246 src/readelf.c:381 src/size.c:207 src/strip.c:187 src/ld.c:876 -#: src/elflint.c:246 +#: src/nm.c:246 src/readelf.c:356 src/size.c:212 src/strip.c:192 src/ld.c:862 +#: src/elflint.c:225 src/addr2line.c:221 src/findtextrel.c:161 #, c-format msgid "Written by %s.\n" msgstr "" -#: src/nm.c:351 src/readelf.c:359 src/size.c:285 src/strip.c:237 src/ld.c:490 -#: src/elflint.c:224 +#: src/nm.c:351 src/strip.c:402 src/strip.c:437 src/addr2line.c:128 +#: src/findtextrel.c:215 #, c-format -msgid "Please report bugs to %s.\n" +msgid "cannot open '%s'" msgstr "" -#: src/nm.c:388 src/nm.c:400 src/size.c:324 +#: src/nm.c:368 src/nm.c:380 src/size.c:309 #, c-format -msgid "while close `%s'" +msgid "while close '%s'" msgstr "" -#: src/nm.c:410 src/strip.c:322 +#: src/nm.c:390 src/strip.c:326 #, c-format msgid "%s: File format not recognized" msgstr "" -#: src/nm.c:450 +#: src/nm.c:430 msgid "" "\n" "Archive index:" msgstr "" -#: src/nm.c:459 +#: src/nm.c:439 #, c-format msgid "invalid offset %zu for symbol %s" msgstr "" -#: src/nm.c:464 +#: src/nm.c:444 #, c-format msgid "%s in %s\n" msgstr "" -#: src/nm.c:472 +#: src/nm.c:452 msgid "cannot reset archive offset to beginning" msgstr "" -#: src/nm.c:496 +#: src/nm.c:476 #, c-format msgid "%s%s%s: file format not recognized" msgstr "" -#: src/nm.c:714 +#: src/nm.c:695 msgid "cannot create search tree" msgstr "" -#: src/nm.c:742 src/nm.c:988 src/readelf.c:691 src/readelf.c:834 -#: src/readelf.c:947 src/readelf.c:1131 src/readelf.c:1350 src/readelf.c:1509 -#: src/readelf.c:1682 src/readelf.c:1941 src/readelf.c:2018 src/readelf.c:2106 -#: src/readelf.c:2387 src/readelf.c:2513 src/readelf.c:4392 src/size.c:429 -#: src/size.c:504 src/strip.c:468 +#: src/nm.c:723 src/nm.c:968 src/readelf.c:666 src/readelf.c:809 +#: src/readelf.c:962 src/readelf.c:1146 src/readelf.c:1365 src/readelf.c:1524 +#: src/readelf.c:1697 src/readelf.c:1956 src/readelf.c:2033 src/readelf.c:2121 +#: src/readelf.c:2402 src/readelf.c:2528 src/readelf.c:4636 src/size.c:414 +#: src/size.c:489 src/strip.c:451 msgid "cannot get section header string table index" msgstr "" -#: src/nm.c:762 +#: src/nm.c:743 #, c-format msgid "" "\n" @@ -193,7 +357,7 @@ msgid "" "\n" msgstr "" -#: src/nm.c:764 +#: src/nm.c:745 #, c-format msgid "" "\n" @@ -202,373 +366,381 @@ msgid "" "\n" msgstr "" -#: src/nm.c:767 +#: src/nm.c:748 #, c-format msgid "" "%*s%-*s %-*s Class Type %-*s %*s Section\n" "\n" msgstr "" -#: src/nm.c:998 +#: src/nm.c:978 #, c-format msgid "%s: entry size in section `%s' is not what we expect" msgstr "" -#: src/nm.c:1002 +#: src/nm.c:982 #, c-format msgid "%s: size of section `%s' is not multiple of entry size" msgstr "" -#: src/nm.c:1235 +#: src/nm.c:1215 #, c-format msgid "%s%s%s%s: Invalid operation" msgstr "" -#: src/nm.c:1292 +#: src/nm.c:1272 #, c-format msgid "%s%s%s: no symbols" msgstr "" -#: src/readelf.c:52 +#: src/readelf.c:55 msgid "Equivalent to: -h -l" msgstr "" -#: src/readelf.c:53 +#: src/readelf.c:56 msgid "Display the dynamic segment" msgstr "" -#: src/readelf.c:54 +#: src/readelf.c:57 msgid "Display the ELF file header" msgstr "" -#: src/readelf.c:56 +#: src/readelf.c:59 msgid "Display histogram of bucket list lengths" msgstr "" -#: src/readelf.c:57 +#: src/readelf.c:60 msgid "Display the program headers" msgstr "" -#: src/readelf.c:58 +#: src/readelf.c:61 msgid "Display relocations" msgstr "" -#: src/readelf.c:59 +#: src/readelf.c:62 msgid "Display the sections' header" msgstr "" -#: src/readelf.c:60 +#: src/readelf.c:63 msgid "Display the symbol table" msgstr "" -#: src/readelf.c:61 +#: src/readelf.c:64 msgid "Display versioning information" msgstr "" -#: src/readelf.c:63 +#: src/readelf.c:66 msgid "" "Display DWARF section content. SECTION can be one of abbrev, aranges, " "frame, info, loc, line, pubnames, str, or macinfo." msgstr "" -#: src/readelf.c:65 +#: src/readelf.c:68 msgid "Display the core notes" msgstr "" -#: src/readelf.c:67 +#: src/readelf.c:70 msgid "Display architecture specific information (if any)" msgstr "" -#: src/readelf.c:69 +#: src/readelf.c:72 msgid "Output control:" msgstr "" -#: src/readelf.c:75 +#: src/readelf.c:78 msgid "Print information from ELF file in human-readable form." msgstr "" -#: src/readelf.c:79 src/elflint.c:66 +#: src/readelf.c:82 src/elflint.c:69 msgid "FILE..." msgstr "" -#: src/readelf.c:222 src/elflint.c:149 +#: src/readelf.c:200 src/elflint.c:139 msgid "cannot open input file" msgstr "" -#: src/readelf.c:229 src/elflint.c:156 +#: src/readelf.c:207 src/elflint.c:146 #, c-format msgid "cannot generate Elf descriptor: %s\n" msgstr "" -#: src/readelf.c:237 +#: src/readelf.c:215 #, c-format msgid "error while closing Elf descriptor: %s" msgstr "" -#: src/readelf.c:336 +#: src/readelf.c:318 #, c-format msgid "Unknown DWARF debug section `%s'.\n" msgstr "" -#: src/readelf.c:436 src/elflint.c:304 +#: src/readelf.c:327 src/elflint.c:203 +msgid "Missing file name.\n" +msgstr "" + +#: src/readelf.c:332 +msgid "No operation specified.\n" +msgstr "" + +#: src/readelf.c:411 src/elflint.c:283 #, c-format msgid " error while freeing sub-ELF descriptor: %s\n" msgstr "" -#: src/readelf.c:444 +#: src/readelf.c:419 msgid "cannot stat input file" msgstr "" -#: src/readelf.c:446 +#: src/readelf.c:421 msgid "input file is empty" msgstr "" -#: src/readelf.c:449 src/elflint.c:312 +#: src/readelf.c:424 src/elflint.c:291 msgid "Not an ELF file - it has the wrong magic bytes at the start" msgstr "" -#: src/readelf.c:476 +#: src/readelf.c:451 #, c-format msgid "cannot read ELF header: %s" msgstr "" -#: src/readelf.c:483 +#: src/readelf.c:458 msgid "cannot create EBL handle" msgstr "" -#: src/readelf.c:490 src/strip.c:530 src/ldgeneric.c:592 src/ldgeneric.c:1026 +#: src/readelf.c:465 src/strip.c:513 src/ldgeneric.c:592 src/ldgeneric.c:1026 #, c-format msgid "cannot determine number of sections: %s" msgstr "" -#: src/readelf.c:532 +#: src/readelf.c:507 msgid "NONE (None)" msgstr "" -#: src/readelf.c:533 +#: src/readelf.c:508 msgid "REL (Relocatable file)" msgstr "" -#: src/readelf.c:534 +#: src/readelf.c:509 msgid "EXEC (Executable file)" msgstr "" -#: src/readelf.c:535 +#: src/readelf.c:510 msgid "DYN (Shared object file)" msgstr "" -#: src/readelf.c:536 +#: src/readelf.c:511 msgid "CORE (Core file)" msgstr "" -#: src/readelf.c:541 +#: src/readelf.c:516 #, c-format msgid "OS Specific: (%x)\n" msgstr "" -#: src/readelf.c:543 +#: src/readelf.c:518 #, c-format msgid "Processor Specific: (%x)\n" msgstr "" -#: src/readelf.c:556 +#: src/readelf.c:531 msgid "" "ELF Header:\n" " Magic: " msgstr "" -#: src/readelf.c:560 +#: src/readelf.c:535 #, c-format msgid "" "\n" " Class: %s\n" msgstr "" -#: src/readelf.c:565 +#: src/readelf.c:540 #, c-format msgid " Data: %s\n" msgstr "" -#: src/readelf.c:571 +#: src/readelf.c:546 #, c-format msgid " Version: %hhd %s\n" msgstr "" -#: src/readelf.c:573 src/readelf.c:589 +#: src/readelf.c:548 src/readelf.c:564 msgid "(current)" msgstr "" -#: src/readelf.c:576 +#: src/readelf.c:551 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: src/readelf.c:579 +#: src/readelf.c:554 #, c-format msgid " ABI Version: %hhd\n" msgstr "" -#: src/readelf.c:582 +#: src/readelf.c:557 msgid " Type: " msgstr "" -#: src/readelf.c:585 +#: src/readelf.c:560 #, c-format msgid " Machine: %s\n" msgstr "" -#: src/readelf.c:587 +#: src/readelf.c:562 #, c-format msgid " Version: %d %s\n" msgstr "" -#: src/readelf.c:591 +#: src/readelf.c:566 #, c-format msgid " Entry point address: %#<PRIx64>\n" msgstr "" -#: src/readelf.c:594 +#: src/readelf.c:569 #, c-format msgid " Start of program headers: %<PRId64> %s\n" msgstr "" -#: src/readelf.c:595 src/readelf.c:598 +#: src/readelf.c:570 src/readelf.c:573 msgid "(bytes into file)" msgstr "" -#: src/readelf.c:597 +#: src/readelf.c:572 #, c-format msgid " Start of section headers: %<PRId64> %s\n" msgstr "" -#: src/readelf.c:600 +#: src/readelf.c:575 #, c-format msgid " Flags: %s\n" msgstr "" -#: src/readelf.c:603 +#: src/readelf.c:578 #, c-format msgid " Size of this header: %<PRId16> %s\n" msgstr "" -#: src/readelf.c:604 src/readelf.c:607 src/readelf.c:613 +#: src/readelf.c:579 src/readelf.c:582 src/readelf.c:588 msgid "(bytes)" msgstr "" -#: src/readelf.c:606 +#: src/readelf.c:581 #, c-format msgid " Size of program header entries: %<PRId16> %s\n" msgstr "" -#: src/readelf.c:609 +#: src/readelf.c:584 #, c-format msgid " Number of program headers entries: %<PRId16>\n" msgstr "" -#: src/readelf.c:612 +#: src/readelf.c:587 #, c-format msgid " Size of section header entries: %<PRId16> %s\n" msgstr "" -#: src/readelf.c:615 +#: src/readelf.c:590 #, c-format msgid " Number of section headers entries: %<PRId16>" msgstr "" -#: src/readelf.c:624 +#: src/readelf.c:599 #, c-format msgid " (%<PRIu32> in [0].sh_size)" msgstr "" -#: src/readelf.c:627 src/readelf.c:643 +#: src/readelf.c:602 src/readelf.c:618 msgid " ([0] not available)" msgstr "" -#: src/readelf.c:639 +#: src/readelf.c:614 #, c-format msgid " (%<PRIu32> in [0].sh_link)" msgstr "" -#: src/readelf.c:647 +#: src/readelf.c:622 #, c-format msgid "" " Section header string table index: XINDEX%s\n" "\n" msgstr "" -#: src/readelf.c:651 +#: src/readelf.c:626 #, c-format msgid "" " Section header string table index: %<PRId16>\n" "\n" msgstr "" -#: src/readelf.c:683 +#: src/readelf.c:658 #, c-format msgid "" "There are %d section headers, starting at offset %#<PRIx64>:\n" "\n" msgstr "" -#: src/readelf.c:693 +#: src/readelf.c:668 msgid "Section Headers:" msgstr "" -#: src/readelf.c:696 +#: src/readelf.c:671 msgid "" "[Nr] Name Type Addr Off Size ES Flags Lk " "Inf Al" msgstr "" -#: src/readelf.c:698 +#: src/readelf.c:673 msgid "" "[Nr] Name Type Addr Off Size ES " "Flags Lk Inf Al" msgstr "" -#: src/readelf.c:710 src/readelf.c:862 +#: src/readelf.c:685 src/readelf.c:838 #, c-format msgid "cannot get section: %s" msgstr "" -#: src/readelf.c:716 src/readelf.c:869 +#: src/readelf.c:691 src/readelf.c:845 #, c-format msgid "cannot get section header: %s" msgstr "" -#: src/readelf.c:775 +#: src/readelf.c:750 msgid "Program Headers:" msgstr "" -#: src/readelf.c:777 +#: src/readelf.c:752 msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align" msgstr "" -#: src/readelf.c:780 +#: src/readelf.c:755 msgid "" " Type Offset VirtAddr PhysAddr FileSiz " "MemSiz Flg Align" msgstr "" -#: src/readelf.c:820 +#: src/readelf.c:795 #, c-format msgid "\t[Requesting program interpreter: %s]\n" msgstr "" -#: src/readelf.c:836 +#: src/readelf.c:811 msgid "" "\n" " Section to Segment mapping:\n" " Segment Sections..." msgstr "" -#: src/readelf.c:849 +#: src/readelf.c:824 #, c-format msgid "cannot get program header: %s" msgstr "" -#: src/readelf.c:952 +#: src/readelf.c:967 #, c-format msgid "" "\n" @@ -579,7 +751,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:957 +#: src/readelf.c:972 #, c-format msgid "" "\n" @@ -590,20 +762,20 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:965 +#: src/readelf.c:980 msgid "<INVALID SYMBOL>" msgstr "" -#: src/readelf.c:977 +#: src/readelf.c:992 #, c-format msgid " [%2u] <INVALID SECTION>\n" msgstr "" -#: src/readelf.c:982 +#: src/readelf.c:997 msgid "<INVALID SECTION>" msgstr "" -#: src/readelf.c:1133 +#: src/readelf.c:1148 #, c-format msgid "" "\n" @@ -616,43 +788,43 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1145 +#: src/readelf.c:1160 msgid " Type Value\n" msgstr "" -#: src/readelf.c:1171 +#: src/readelf.c:1186 #, c-format msgid "Shared library: [%s]\n" msgstr "" -#: src/readelf.c:1176 +#: src/readelf.c:1191 #, c-format msgid "Library soname: [%s]\n" msgstr "" -#: src/readelf.c:1181 +#: src/readelf.c:1196 #, c-format msgid "Library rpath: [%s]\n" msgstr "" -#: src/readelf.c:1186 +#: src/readelf.c:1201 #, c-format msgid "Library runpath: [%s]\n" msgstr "" -#: src/readelf.c:1206 +#: src/readelf.c:1221 #, c-format msgid "%<PRId64> (bytes)\n" msgstr "" -#: src/readelf.c:1325 src/readelf.c:1482 +#: src/readelf.c:1340 src/readelf.c:1497 #, c-format msgid "" "\n" "Invalid symbol table at offset %#0<PRIx64>\n" msgstr "" -#: src/readelf.c:1353 +#: src/readelf.c:1368 #, c-format msgid "" "\n" @@ -665,7 +837,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1368 +#: src/readelf.c:1383 #, c-format msgid "" "\n" @@ -676,28 +848,28 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1378 +#: src/readelf.c:1393 msgid " Offset Type Value Name\n" msgstr "" -#: src/readelf.c:1380 +#: src/readelf.c:1395 msgid " Offset Type Value Name\n" msgstr "" -#: src/readelf.c:1407 src/readelf.c:1418 src/readelf.c:1436 src/readelf.c:1448 -#: src/readelf.c:1551 src/readelf.c:1563 src/readelf.c:1582 src/readelf.c:1595 +#: src/readelf.c:1422 src/readelf.c:1433 src/readelf.c:1451 src/readelf.c:1463 +#: src/readelf.c:1566 src/readelf.c:1578 src/readelf.c:1597 src/readelf.c:1610 msgid "<INVALID RELOC>" msgstr "" -#: src/readelf.c:1408 src/readelf.c:1552 +#: src/readelf.c:1423 src/readelf.c:1567 msgid "INVALID SYMBOL" msgstr "" -#: src/readelf.c:1437 src/readelf.c:1583 +#: src/readelf.c:1452 src/readelf.c:1598 msgid "INVALID SECTION" msgstr "" -#: src/readelf.c:1511 +#: src/readelf.c:1526 #, c-format msgid "" "\n" @@ -710,15 +882,15 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1523 +#: src/readelf.c:1538 msgid " Offset Type Value Addend Name\n" msgstr "" -#: src/readelf.c:1525 +#: src/readelf.c:1540 msgid " Offset Type Value Addend Name\n" msgstr "" -#: src/readelf.c:1688 +#: src/readelf.c:1703 #, c-format msgid "" "\n" @@ -729,39 +901,39 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1693 +#: src/readelf.c:1708 #, c-format msgid " %lu local symbol String table: [%2u] '%s'\n" msgid_plural " %lu local symbols String table: [%2u] '%s'\n" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1703 +#: src/readelf.c:1718 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: src/readelf.c:1705 +#: src/readelf.c:1720 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: src/readelf.c:1725 +#: src/readelf.c:1740 #, c-format msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s" msgstr "" -#: src/readelf.c:1815 +#: src/readelf.c:1830 msgid "bad dynamic symbol" msgstr "" -#: src/readelf.c:1898 +#: src/readelf.c:1913 msgid "none" msgstr "" -#: src/readelf.c:1915 +#: src/readelf.c:1930 msgid "| <unknown>" msgstr "" -#: src/readelf.c:1943 +#: src/readelf.c:1958 #, c-format msgid "" "\n" @@ -774,17 +946,17 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:1970 +#: src/readelf.c:1985 #, c-format msgid " %#06x: Version: %hu File: %s Cnt: %hu\n" msgstr "" -#: src/readelf.c:1985 +#: src/readelf.c:2000 #, c-format msgid " %#06x: Name: %s Flags: %s Version: %hu\n" msgstr "" -#: src/readelf.c:2020 +#: src/readelf.c:2035 #, c-format msgid "" "\n" @@ -797,17 +969,17 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:2055 +#: src/readelf.c:2070 #, c-format msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n" msgstr "" -#: src/readelf.c:2070 +#: src/readelf.c:2085 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: src/readelf.c:2319 +#: src/readelf.c:2334 #, c-format msgid "" "\n" @@ -820,20 +992,20 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:2351 +#: src/readelf.c:2366 msgid " 0 *local* " msgstr "" -#: src/readelf.c:2356 +#: src/readelf.c:2371 msgid " 1 *global* " msgstr "" -#: src/readelf.c:2412 +#: src/readelf.c:2427 #, c-format msgid "cannot get data for section %d: %s" msgstr "" -#: src/readelf.c:2422 +#: src/readelf.c:2437 #, c-format msgid "" "\n" @@ -848,29 +1020,29 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:2467 +#: src/readelf.c:2482 #, c-format msgid " Length Number % of total Coverage" msgstr "" -#: src/readelf.c:2468 +#: src/readelf.c:2483 #, c-format msgid " 0 %6<PRIu32> %5.1f%%\n" msgstr "" -#: src/readelf.c:2474 +#: src/readelf.c:2489 #, c-format msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n" msgstr "" -#: src/readelf.c:2488 +#: src/readelf.c:2503 #, c-format msgid "" " Average number of tests: successful lookup: %f\n" " unsuccessful lookup: %f\n" msgstr "" -#: src/readelf.c:2523 +#: src/readelf.c:2538 #, c-format msgid "" "\n" @@ -881,38 +1053,38 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:2537 +#: src/readelf.c:2552 msgid "" " Library Time Stamp Checksum Version " "Flags" msgstr "" -#: src/readelf.c:2648 +#: src/readelf.c:2663 #, c-format msgid "unknown tag %hx" msgstr "" -#: src/readelf.c:2650 +#: src/readelf.c:2665 #, c-format msgid "unknown user tag %hx" msgstr "" -#: src/readelf.c:2833 +#: src/readelf.c:2848 #, c-format msgid "unknown attribute %hx" msgstr "" -#: src/readelf.c:2836 +#: src/readelf.c:2851 #, c-format msgid "unknown user attribute %hx" msgstr "" -#: src/readelf.c:2882 +#: src/readelf.c:2897 #, c-format msgid "unknown form %<PRIx64>" msgstr "" -#: src/readelf.c:3255 +#: src/readelf.c:3446 #, c-format msgid "" "\n" @@ -920,30 +1092,30 @@ msgid "" " [ Code]\n" msgstr "" -#: src/readelf.c:3267 +#: src/readelf.c:3460 #, c-format msgid " *** error while reading abbreviation: %s\n" msgstr "" -#: src/readelf.c:3281 +#: src/readelf.c:3474 #, c-format msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n" msgstr "" -#: src/readelf.c:3284 +#: src/readelf.c:3477 msgid "yes" msgstr "" -#: src/readelf.c:3284 +#: src/readelf.c:3477 msgid "no" msgstr "" -#: src/readelf.c:3316 +#: src/readelf.c:3511 #, c-format msgid "cannot get .debug_aranges content: %s" msgstr "" -#: src/readelf.c:3321 +#: src/readelf.c:3516 #, c-format msgid "" "\n" @@ -954,33 +1126,33 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:3351 +#: src/readelf.c:3546 #, c-format msgid " [%*zu] ???\n" msgstr "" -#: src/readelf.c:3353 +#: src/readelf.c:3548 #, c-format msgid "" " [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n" msgstr "" -#: src/readelf.c:3387 +#: src/readelf.c:3585 #, c-format msgid "cannot get attribute code: %s" msgstr "" -#: src/readelf.c:3395 +#: src/readelf.c:3593 #, c-format msgid "cannot get attribute form: %s" msgstr "" -#: src/readelf.c:3407 +#: src/readelf.c:3605 #, c-format msgid "cannot get attribute value: %s" msgstr "" -#: src/readelf.c:3506 +#: src/readelf.c:3741 #, c-format msgid "" "\n" @@ -988,7 +1160,7 @@ msgid "" " [Offset]\n" msgstr "" -#: src/readelf.c:3531 +#: src/readelf.c:3766 #, c-format msgid "" " Compilation unit at offset %<PRIu64>:\n" @@ -996,49 +1168,49 @@ msgid "" "<PRIu8>, Offset size: %<PRIu8>\n" msgstr "" -#: src/readelf.c:3548 +#: src/readelf.c:3783 #, c-format msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s" msgstr "" -#: src/readelf.c:3559 +#: src/readelf.c:3794 #, c-format msgid "cannot get DIE offset: %s" msgstr "" -#: src/readelf.c:3567 +#: src/readelf.c:3802 #, c-format msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s" msgstr "" -#: src/readelf.c:3680 +#: src/readelf.c:3915 #, c-format msgid "cannot get next DIE: %s\n" msgstr "" -#: src/readelf.c:3687 +#: src/readelf.c:3922 #, c-format msgid "cannot get next DIE: %s" msgstr "" -#: src/readelf.c:3709 src/readelf.c:4120 src/readelf.c:4155 src/readelf.c:4324 +#: src/readelf.c:3944 src/readelf.c:4358 src/readelf.c:4394 src/readelf.c:4566 #, c-format msgid "" "\n" "DWARF section '%s' at offset %#<PRIx64>:\n" msgstr "" -#: src/readelf.c:3721 +#: src/readelf.c:3956 #, c-format msgid "cannot get line data section data: %s" msgstr "" -#: src/readelf.c:3741 +#: src/readelf.c:3976 #, c-format msgid "invalid data in section [%zu] '%s'" msgstr "" -#: src/readelf.c:3784 +#: src/readelf.c:4019 #, c-format msgid "" "\n" @@ -1054,134 +1226,134 @@ msgid "" "Opcodes:\n" msgstr "" -#: src/readelf.c:3810 +#: src/readelf.c:4045 #, c-format msgid " [%*<PRIuFAST8>] %hhu argument\n" msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:3818 +#: src/readelf.c:4053 msgid "" "\n" "Directory table:" msgstr "" -#: src/readelf.c:3834 +#: src/readelf.c:4069 msgid "" "\n" "File name table:\n" " Entry Dir Time Size Name" msgstr "" -#: src/readelf.c:3863 +#: src/readelf.c:4098 msgid "" "\n" "Line number statements:" msgstr "" -#: src/readelf.c:3923 +#: src/readelf.c:4158 #, c-format msgid " special opcode %u: address+%u = %#<PRIx64>, line%+d = %zu\n" msgstr "" -#: src/readelf.c:3943 +#: src/readelf.c:4178 #, c-format msgid " extended opcode %u: " msgstr "" -#: src/readelf.c:3948 +#: src/readelf.c:4183 msgid "end of sequence" msgstr "" -#: src/readelf.c:3961 +#: src/readelf.c:4196 #, c-format msgid "set address to %#<PRIx64>\n" msgstr "" -#: src/readelf.c:3981 +#: src/readelf.c:4216 #, c-format msgid "define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n" msgstr "" -#: src/readelf.c:3990 +#: src/readelf.c:4225 msgid "unknown opcode" msgstr "" -#: src/readelf.c:4002 +#: src/readelf.c:4237 msgid " copy" msgstr "" -#: src/readelf.c:4010 +#: src/readelf.c:4245 #, c-format msgid " advance address by %u to %#<PRIx64>\n" msgstr "" -#: src/readelf.c:4020 +#: src/readelf.c:4255 #, c-format msgid " advance line by constant %d to %<PRId64>\n" msgstr "" -#: src/readelf.c:4028 +#: src/readelf.c:4263 #, c-format msgid " set file to %<PRIu64>\n" msgstr "" -#: src/readelf.c:4038 +#: src/readelf.c:4273 #, c-format msgid " set column to %<PRIu64>\n" msgstr "" -#: src/readelf.c:4045 +#: src/readelf.c:4280 #, c-format msgid " set '%s' to %<PRIuFAST8>\n" msgstr "" -#: src/readelf.c:4051 +#: src/readelf.c:4286 msgid " set basic block flag" msgstr "" -#: src/readelf.c:4059 +#: src/readelf.c:4294 #, c-format msgid " advance address by constant %u to %#<PRIx64>\n" msgstr "" -#: src/readelf.c:4072 +#: src/readelf.c:4307 #, c-format msgid " advance address by fixed value %u to %#<PRIx64>\n" msgstr "" -#: src/readelf.c:4079 +#: src/readelf.c:4314 msgid " set prologue end flag" msgstr "" -#: src/readelf.c:4084 +#: src/readelf.c:4319 msgid " set epilogue begin flag" msgstr "" -#: src/readelf.c:4093 +#: src/readelf.c:4328 #, c-format msgid " unknown opcode with %<PRIu8> parameter:" msgid_plural " unknown opcode with %<PRIu8> parameters:" msgstr[0] "" msgstr[1] "" -#: src/readelf.c:4165 +#: src/readelf.c:4404 #, c-format msgid "cannot get macro information section data: %s" msgstr "" -#: src/readelf.c:4244 +#: src/readelf.c:4483 #, c-format msgid "%*s*** non-terminated string at end of section" msgstr "" -#: src/readelf.c:4311 +#: src/readelf.c:4551 #, c-format msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n" msgstr "" -#: src/readelf.c:4346 +#: src/readelf.c:4590 #, c-format msgid "" "\n" @@ -1189,513 +1361,534 @@ msgid "" " %*s String\n" msgstr "" -#: src/readelf.c:4359 +#: src/readelf.c:4603 #, c-format msgid " *** error while reading strings: %s\n" msgstr "" -#: src/readelf.c:4384 +#: src/readelf.c:4628 #, c-format msgid "cannot get debug context descriptor: %s" msgstr "" -#: src/readelf.c:4461 +#: src/readelf.c:4705 #, c-format msgid "" "\n" "Note segment of %<PRId64> bytes at offset %#0<PRIx64>:\n" msgstr "" -#: src/readelf.c:4468 +#: src/readelf.c:4712 #, c-format msgid "cannot get content of note section: %s" msgstr "" -#: src/readelf.c:4471 +#: src/readelf.c:4715 msgid " Owner Data size Type\n" msgstr "" -#: src/readelf.c:4510 +#: src/readelf.c:4754 #, c-format msgid " %-13.*s %9<PRId32> %s\n" msgstr "" -#: src/size.c:52 +#: src/size.c:56 msgid "" "Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default " "is `bsd'" msgstr "" -#: src/size.c:53 +#: src/size.c:58 msgid "Same as `--format=sysv'" msgstr "" -#: src/size.c:54 +#: src/size.c:59 msgid "Same as `--format=bsd'" msgstr "" -#: src/size.c:56 +#: src/size.c:62 msgid "Same as `--radix=10'" msgstr "" -#: src/size.c:57 +#: src/size.c:63 msgid "Same as `--radix=8'" msgstr "" -#: src/size.c:58 +#: src/size.c:64 msgid "Same as `--radix=16'" msgstr "" -#: src/size.c:59 +#: src/size.c:66 msgid "Similar to `--format=sysv' output but in one line" msgstr "" -#: src/size.c:62 +#: src/size.c:70 msgid "Print size and permission flags for loadable segments" msgstr "" -#: src/size.c:63 +#: src/size.c:71 msgid "Display the total sizes (bsd only)" msgstr "" -#: src/size.c:68 +#: src/size.c:76 msgid "List section sizes of FILEs (a.out by default)." msgstr "" -#: src/size.c:251 +#: src/size.c:257 #, c-format msgid "Invalid format: %s" msgstr "" -#: src/size.c:262 +#: src/size.c:268 #, c-format msgid "Invalid radix: %s" msgstr "" -#: src/size.c:336 +#: src/size.c:293 +#, c-format +msgid "cannot open '%s" +msgstr "" + +#: src/size.c:321 #, c-format msgid "%s: file format not recognized" msgstr "" -#: src/size.c:407 src/strip.c:1766 +#: src/size.c:392 #, c-format msgid "while closing `%s'" msgstr "" -#: src/size.c:447 src/size.c:589 +#: src/size.c:433 src/size.c:574 #, c-format msgid " (ex %s)" msgstr "" -#: src/size.c:614 +#: src/size.c:599 msgid "(TOTALS)\n" msgstr "" -#: src/strip.c:58 +#: src/strip.c:61 msgid "Place stripped output into FILE" msgstr "" -#: src/strip.c:59 +#: src/strip.c:62 msgid "Extract the removed sections into FILE" msgstr "" -#: src/strip.c:62 +#: src/strip.c:63 +msgid "Embed name FILE instead of -f argument" +msgstr "" + +#: src/strip.c:66 msgid "Remove all debugging symbols" msgstr "" -#: src/strip.c:64 +#: src/strip.c:68 msgid "Copy modified/access timestamps to the output" msgstr "" -#: src/strip.c:66 +#: src/strip.c:70 msgid "Remove .comment section" msgstr "" -#: src/strip.c:68 +#: src/strip.c:72 msgid "Relax a few rules to handle slightly broken ELF files" msgstr "" -#: src/strip.c:73 +#: src/strip.c:77 msgid "Discard symbols from object files." msgstr "" -#: src/strip.c:164 +#: src/strip.c:169 msgid "Only one input file allowed together with '-o' and '-f'" msgstr "" -#: src/strip.c:262 src/strip.c:286 +#: src/strip.c:206 +msgid "-f option specified twice" +msgstr "" + +#: src/strip.c:215 +msgid "-F option specified twice" +msgstr "" + +#: src/strip.c:224 +msgid "-o option specified twice" +msgstr "" + +#: src/strip.c:266 src/strip.c:290 #, c-format msgid "cannot stat input file \"%s\"" msgstr "" -#: src/strip.c:276 +#: src/strip.c:280 #, c-format msgid "while opening \"%s\"" msgstr "" -#: src/strip.c:313 +#: src/strip.c:317 #, c-format msgid "%s: cannot use -o when stripping archive" msgstr "" -#: src/strip.c:419 src/strip.c:454 -#, c-format -msgid "cannot open `%s'" -msgstr "" - -#: src/strip.c:434 +#: src/strip.c:417 msgid "cannot open EBL backend" msgstr "" -#: src/strip.c:482 src/strip.c:508 +#: src/strip.c:465 src/strip.c:491 #, c-format -msgid "cannot create new file `%s': %s" +msgid "cannot create new file '%s': %s" msgstr "" -#: src/strip.c:569 +#: src/strip.c:552 #, c-format -msgid "illformed file `%s'" +msgid "illformed file '%s'" msgstr "" -#: src/strip.c:835 src/strip.c:944 +#: src/strip.c:818 src/strip.c:895 #, c-format msgid "while generating output file: %s" msgstr "" -#: src/strip.c:884 src/strip.c:1622 +#: src/strip.c:868 src/strip.c:1602 #, c-format msgid "%s: error while creating ELF header: %s" msgstr "" -#: src/strip.c:893 src/strip.c:1644 +#: src/strip.c:882 #, c-format -msgid "while writing `%s': %s" +msgid "while preparing output for '%s'" msgstr "" -#: src/strip.c:904 +#: src/strip.c:936 src/strip.c:992 #, c-format -msgid "while creating '%s'" +msgid "while create section header section: %s" msgstr "" -#: src/strip.c:916 -msgid "while computing checksum for debug information" +#: src/strip.c:942 +#, c-format +msgid "cannot allocate section data: %s" msgstr "" -#: src/strip.c:931 +#: src/strip.c:1001 #, c-format -msgid "while preparing output for `%s'" +msgid "while create section header string table: %s" msgstr "" -#: src/strip.c:985 src/strip.c:1042 +#: src/strip.c:1527 src/strip.c:1624 #, c-format -msgid "while create section header section: %s" +msgid "while writing '%s': %s" msgstr "" -#: src/strip.c:991 +#: src/strip.c:1538 #, c-format -msgid "cannot allocate section data: %s" +msgid "while creating '%s'" msgstr "" -#: src/strip.c:1051 -#, c-format -msgid "while create section header string table: %s" +#: src/strip.c:1550 +msgid "while computing checksum for debug information" msgstr "" -#: src/strip.c:1630 +#: src/strip.c:1610 #, c-format msgid "%s: error while reading the file: %s" msgstr "" -#: src/strip.c:1672 src/strip.c:1679 +#: src/strip.c:1652 src/strip.c:1659 #, c-format -msgid "error while finishing `%s': %s" +msgid "error while finishing '%s': %s" msgstr "" -#: src/strip.c:1702 src/strip.c:1759 +#: src/strip.c:1682 src/strip.c:1739 #, c-format -msgid "cannot set access and modification date of \"%s\"" +msgid "cannot set access and modification date of '%s'" msgstr "" -#: src/ld.c:71 +#: src/strip.c:1746 +#, c-format +msgid "while closing '%s'" +msgstr "" + +#: src/ld.c:74 msgid "Include whole archives in the output from now on." msgstr "" -#: src/ld.c:73 +#: src/ld.c:76 msgid "Stop including the whole arhives in the output." msgstr "" -#: src/ld.c:75 src/ld.c:116 src/ld.c:124 +#: src/ld.c:78 src/ld.c:120 src/ld.c:128 msgid "FILE" msgstr "" -#: src/ld.c:75 +#: src/ld.c:78 msgid "Place output in FILE." msgstr "" -#: src/ld.c:77 +#: src/ld.c:80 msgid "LEVEL" msgstr "" -#: src/ld.c:78 +#: src/ld.c:81 msgid "Set optimization level to LEVEL." msgstr "" -#: src/ld.c:80 +#: src/ld.c:83 msgid "Verbose messages." msgstr "" -#: src/ld.c:81 +#: src/ld.c:84 msgid "Trace file opens." msgstr "" -#: src/ld.c:83 +#: src/ld.c:86 msgid "Trade speed for less memory usage" msgstr "" -#: src/ld.c:87 +#: src/ld.c:90 msgid "Object is marked to not use default search path at runtime." msgstr "" -#: src/ld.c:89 +#: src/ld.c:92 msgid "Same as --whole-archive." msgstr "" -#: src/ld.c:90 +#: src/ld.c:93 msgid "" "Default rules of extracting from archive; weak references are not enough." msgstr "" -#: src/ld.c:93 +#: src/ld.c:97 msgid "Weak references cause extraction from archive." msgstr "" -#: src/ld.c:95 +#: src/ld.c:99 msgid "Allow multiple definitions; first is used." msgstr "" -#: src/ld.c:97 +#: src/ld.c:101 msgid "Disallow/allow undefined symbols in DSOs." msgstr "" -#: src/ld.c:100 +#: src/ld.c:104 msgid "Object requires immediate handling of $ORIGIN." msgstr "" -#: src/ld.c:102 +#: src/ld.c:106 msgid "Relocation will not be processed lazily." msgstr "" -#: src/ld.c:104 +#: src/ld.c:108 msgid "Object cannot be unloaded at runtime." msgstr "" -#: src/ld.c:106 +#: src/ld.c:110 msgid "Mark object to be initialized first." msgstr "" -#: src/ld.c:108 +#: src/ld.c:112 msgid "Enable/disable lazy-loading flag for following dependencies." msgstr "" -#: src/ld.c:110 +#: src/ld.c:114 msgid "Mark object as not loadable with 'dlopen'." msgstr "" -#: src/ld.c:112 +#: src/ld.c:116 msgid "Ignore/record dependencies on unused DSOs." msgstr "" -#: src/ld.c:114 +#: src/ld.c:118 msgid "Generated DSO will be a system library." msgstr "" -#: src/ld.c:118 +#: src/ld.c:122 msgid "Start a group." msgstr "" -#: src/ld.c:119 +#: src/ld.c:123 msgid "End a group." msgstr "" -#: src/ld.c:121 +#: src/ld.c:125 msgid "PATH" msgstr "" -#: src/ld.c:122 +#: src/ld.c:126 msgid "Add PATH to list of directories files are searched in." msgstr "" -#: src/ld.c:124 +#: src/ld.c:128 msgid "Use linker script in FILE." msgstr "" -#: src/ld.c:126 +#: src/ld.c:130 msgid "ADDRESS" msgstr "" -#: src/ld.c:126 +#: src/ld.c:130 msgid "Set entry point address." msgstr "" -#: src/ld.c:130 +#: src/ld.c:134 msgid "Do not link against shared libraries." msgstr "" -#: src/ld.c:133 +#: src/ld.c:137 msgid "Prefer linking against shared libraries." msgstr "" -#: src/ld.c:135 +#: src/ld.c:139 msgid "Export all dynamic symbols." msgstr "" -#: src/ld.c:137 +#: src/ld.c:141 msgid "Strip all symbols." msgstr "" -#: src/ld.c:138 +#: src/ld.c:142 msgid "Strip debugging symbols." msgstr "" -#: src/ld.c:141 +#: src/ld.c:145 msgid "Assume pagesize for the target system to be SIZE." msgstr "" -#: src/ld.c:146 +#: src/ld.c:150 msgid "Set runtime DSO search path." msgstr "" -#: src/ld.c:148 +#: src/ld.c:153 msgid "Set link time DSO search path." msgstr "" -#: src/ld.c:150 +#: src/ld.c:155 msgid "Ignore LD_LIBRARY_PATH environment variable." msgstr "" -#: src/ld.c:153 +#: src/ld.c:159 msgid "Read version information from FILE." msgstr "" -#: src/ld.c:155 +#: src/ld.c:161 msgid "Set emulation to NAME." msgstr "" -#: src/ld.c:157 +#: src/ld.c:163 msgid "Generate dynamic shared object." msgstr "" -#: src/ld.c:158 +#: src/ld.c:164 msgid "Generate relocatable object." msgstr "" -#: src/ld.c:162 +#: src/ld.c:168 msgid "Causes symbol not assigned to a version be reduced to local." msgstr "" -#: src/ld.c:164 +#: src/ld.c:170 msgid "Remove unused sections." msgstr "" -#: src/ld.c:166 +#: src/ld.c:173 msgid "Don't remove unused sections." msgstr "" -#: src/ld.c:168 +#: src/ld.c:175 msgid "Set soname of shared object." msgstr "" -#: src/ld.c:169 +#: src/ld.c:176 msgid "Set the dynamic linker name." msgstr "" -#: src/ld.c:173 +#: src/ld.c:180 msgid "Add/suppress addition indentifying link-editor to .comment section" msgstr "" -#: src/ld.c:177 +#: src/ld.c:185 msgid "Select to get parser debug information" msgstr "" -#: src/ld.c:184 +#: src/ld.c:192 msgid "Combine object and archive files." msgstr "" -#: src/ld.c:187 +#: src/ld.c:195 msgid "[FILE]..." msgstr "" -#: src/ld.c:319 +#: src/ld.c:324 msgid "At least one input file needed" msgstr "" -#: src/ld.c:330 +#: src/ld.c:335 msgid "error while preparing linking" msgstr "" -#: src/ld.c:337 +#: src/ld.c:342 #, c-format msgid "cannot open linker script \"%s\"" msgstr "" -#: src/ld.c:378 +#: src/ld.c:383 msgid "-( without matching -)" msgstr "" -#: src/ld.c:523 src/ld.c:561 +#: src/ld.c:508 src/ld.c:546 msgid "only one option of -G and -r is allowed" msgstr "" -#: src/ld.c:545 +#: src/ld.c:530 msgid "more than one '-m' parameter" msgstr "" -#: src/ld.c:555 src/ld.c:925 +#: src/ld.c:540 src/ld.c:911 #, c-format msgid "unknown option `-%c %s'" msgstr "" -#: src/ld.c:597 +#: src/ld.c:582 #, c-format msgid "invalid page size value \"%s\": ignored" msgstr "" -#: src/ld.c:706 +#: src/ld.c:692 msgid "More than one output file name given." msgstr "" -#: src/ld.c:723 +#: src/ld.c:709 #, c-format msgid "Invalid optimization level `%s'" msgstr "" -#: src/ld.c:764 +#: src/ld.c:750 msgid "nested -( -) groups are not allowed" msgstr "" -#: src/ld.c:783 +#: src/ld.c:769 msgid "-) without matching -(" msgstr "" -#: src/ld.c:954 +#: src/ld.c:940 #, c-format msgid "unknown option '-%c %s'" msgstr "" -#: src/ld.c:1058 +#: src/ld.c:1044 msgid "could not find input file to determine output file format" msgstr "" -#: src/ld.c:1060 +#: src/ld.c:1046 msgid "try again with an appropriate '-m' parameter" msgstr "" -#: src/ld.c:1352 +#: src/ld.c:1338 #, c-format msgid "cannot read version script \"%s\"" msgstr "" -#: src/ld.c:1418 src/ld.c:1457 +#: src/ld.c:1404 src/ld.c:1443 #, c-format msgid "duplicate definition of '%s' in linker script" msgstr "" @@ -1831,10 +2024,6 @@ msgstr "" msgid "undefined symbol `%s' in %s" msgstr "" -#: src/ldgeneric.c:2474 libasm/asm_error.c:110 -msgid "cannot create output file" -msgstr "" - #: src/ldgeneric.c:2489 #, c-format msgid "cannot create ELF descriptor for output file: %s" @@ -1849,8 +2038,6 @@ msgstr "" #: src/ldgeneric.c:3799 src/ldgeneric.c:3837 src/ldgeneric.c:3869 #: src/ldgeneric.c:4086 src/ldgeneric.c:4141 src/ldgeneric.c:4388 #: src/ldgeneric.c:4444 src/ldgeneric.c:4886 src/ldgeneric.c:4898 -#: libasm/asm_end.c:97 libasm/asm_end.c:135 libasm/asm_end.c:151 -#: libasm/asm_end.c:279 #, c-format msgid "cannot create section for output file: %s" msgstr "" @@ -1959,10 +2146,6 @@ msgstr "" msgid "cannot stat output file" msgstr "" -#: src/ldgeneric.c:6246 libasm/asm_error.c:113 -msgid "cannot rename output file" -msgstr "" - #: src/ldgeneric.c:6256 msgid "WARNING: temporary output file overwritten before linking finished" msgstr "" @@ -1973,323 +2156,327 @@ msgstr "" msgid "no machine specific '%s' implementation" msgstr "" -#: src/ldscript.y:162 +#: src/ldscript.y:164 msgid "mode for segment invalid\n" msgstr "" -#: src/ldscript.y:430 +#: src/ldscript.y:447 #, c-format msgid "while reading version script '%s': %s at line %d" msgstr "" -#: src/ldscript.y:431 +#: src/ldscript.y:448 #, c-format msgid "while reading linker script '%s': %s at line %d" msgstr "" -#: src/ldscript.y:695 +#: src/ldscript.y:726 #, c-format msgid "symbol '%s' in declared both local and global for unnamed version" msgstr "" -#: src/ldscript.y:697 +#: src/ldscript.y:728 #, c-format msgid "symbol '%s' in declared both local and global for version '%s'" msgstr "" -#: src/ldscript.y:717 src/ldscript.y:724 +#: src/ldscript.y:748 src/ldscript.y:755 msgid "default visibility set as local and global" msgstr "" -#: src/elflint.c:53 +#: src/elflint.c:55 msgid "Be extremely strict, flag level 2 features." msgstr "" -#: src/elflint.c:54 +#: src/elflint.c:56 msgid "Do not print anything if successful" msgstr "" -#: src/elflint.c:56 +#: src/elflint.c:57 +msgid "Binary is a separate debuginfo file" +msgstr "" + +#: src/elflint.c:59 msgid "" "Binary has been created with GNU ld and is therefore known to be broken in " "certain ways" msgstr "" -#: src/elflint.c:62 +#: src/elflint.c:65 msgid "Pedantic checking of ELF files compliance with gABI/psABI spec." msgstr "" -#: src/elflint.c:175 +#: src/elflint.c:165 #, c-format msgid "error while closing Elf descriptor: %s\n" msgstr "" -#: src/elflint.c:179 +#: src/elflint.c:169 msgid "No errors" msgstr "" -#: src/elflint.c:371 +#: src/elflint.c:350 #, c-format msgid "e_ident[%d] == %d is no known class\n" msgstr "" -#: src/elflint.c:376 +#: src/elflint.c:355 #, c-format msgid "e_ident[%d] == %d is no known data encoding\n" msgstr "" -#: src/elflint.c:380 +#: src/elflint.c:359 #, c-format msgid "unknown ELF header version number e_ident[%d] == %d\n" msgstr "" -#: src/elflint.c:385 +#: src/elflint.c:364 #, c-format msgid "unsupported OS ABI e_ident[%d] == \"%s\"\n" msgstr "" -#: src/elflint.c:391 +#: src/elflint.c:370 #, c-format msgid "unsupport ABI version e_ident[%d] == %d\n" msgstr "" -#: src/elflint.c:396 +#: src/elflint.c:375 #, c-format msgid "e_ident[%zu] is not zero\n" msgstr "" -#: src/elflint.c:401 +#: src/elflint.c:380 #, c-format msgid "unknown object file type %d\n" msgstr "" -#: src/elflint.c:408 +#: src/elflint.c:387 #, c-format msgid "unknown machine type %d\n" msgstr "" -#: src/elflint.c:412 +#: src/elflint.c:391 msgid "unknown object file version\n" msgstr "" -#: src/elflint.c:418 +#: src/elflint.c:397 msgid "invalid program header offset\n" msgstr "" -#: src/elflint.c:420 +#: src/elflint.c:399 msgid "executables and DSOs cannot have zero program header offset\n" msgstr "" -#: src/elflint.c:424 +#: src/elflint.c:403 msgid "invalid number of program header entries\n" msgstr "" -#: src/elflint.c:432 +#: src/elflint.c:411 msgid "invalid section header table offset\n" msgstr "" -#: src/elflint.c:435 +#: src/elflint.c:414 msgid "section header table must be present\n" msgstr "" -#: src/elflint.c:451 +#: src/elflint.c:430 msgid "invalid number of section header table entries\n" msgstr "" -#: src/elflint.c:470 src/elflint.c:476 +#: src/elflint.c:449 src/elflint.c:455 msgid "invalid section header index\n" msgstr "" -#: src/elflint.c:481 +#: src/elflint.c:460 #, c-format msgid "invalid machine flags: %s\n" msgstr "" -#: src/elflint.c:488 src/elflint.c:505 +#: src/elflint.c:467 src/elflint.c:484 #, c-format msgid "invalid ELF header size: %hd\n" msgstr "" -#: src/elflint.c:491 src/elflint.c:508 +#: src/elflint.c:470 src/elflint.c:487 #, c-format msgid "invalid program header size: %hd\n" msgstr "" -#: src/elflint.c:494 src/elflint.c:511 +#: src/elflint.c:473 src/elflint.c:490 msgid "invalid program header position or size\n" msgstr "" -#: src/elflint.c:497 src/elflint.c:514 +#: src/elflint.c:476 src/elflint.c:493 #, c-format msgid "invalid section header size: %hd\n" msgstr "" -#: src/elflint.c:500 src/elflint.c:517 +#: src/elflint.c:479 src/elflint.c:496 msgid "invalid section header position or size\n" msgstr "" -#: src/elflint.c:566 +#: src/elflint.c:545 #, c-format msgid "" "section [%2d] '%s': section with SHF_GROUP flag set not part of a section " "group\n" msgstr "" -#: src/elflint.c:570 +#: src/elflint.c:549 #, c-format msgid "" "section [%2d] '%s': section group [%2zu] '%s' does not preceed group member\n" msgstr "" -#: src/elflint.c:595 src/elflint.c:1015 src/elflint.c:1150 src/elflint.c:1337 -#: src/elflint.c:1584 +#: src/elflint.c:574 src/elflint.c:1010 src/elflint.c:1145 src/elflint.c:1332 +#: src/elflint.c:1579 #, c-format msgid "section [%2d] '%s': cannot get section data\n" msgstr "" -#: src/elflint.c:601 src/elflint.c:1344 +#: src/elflint.c:580 src/elflint.c:1339 #, c-format msgid "" "section [%2d] '%s': referenced as string table for section [%2d] '%s' but " "type is not SHT_STRTAB\n" msgstr "" -#: src/elflint.c:633 +#: src/elflint.c:612 #, c-format msgid "section [%2zu] '%s': entry size is does not match ElfXX_Sym\n" msgstr "" -#: src/elflint.c:642 +#: src/elflint.c:621 #, c-format msgid "section [%2d] '%s': cannot get symbol %d: %s\n" msgstr "" -#: src/elflint.c:647 src/elflint.c:650 src/elflint.c:653 src/elflint.c:656 -#: src/elflint.c:659 src/elflint.c:662 +#: src/elflint.c:626 src/elflint.c:629 src/elflint.c:632 src/elflint.c:635 +#: src/elflint.c:638 src/elflint.c:641 #, c-format msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n" msgstr "" -#: src/elflint.c:665 +#: src/elflint.c:644 #, c-format msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n" msgstr "" -#: src/elflint.c:675 +#: src/elflint.c:654 #, c-format msgid "section [%2d] '%s': cannot get symbol %zu: %s\n" msgstr "" -#: src/elflint.c:682 +#: src/elflint.c:661 #, c-format msgid "section [%2d] '%s': symbol %zu: invalid name value\n" msgstr "" -#: src/elflint.c:695 +#: src/elflint.c:674 #, c-format msgid "" "section [%2d] '%s': symbol %zu: too large section index but no extended " "section index section\n" msgstr "" -#: src/elflint.c:701 +#: src/elflint.c:680 #, c-format msgid "" "section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in " "st_shndx (%<PRIu32>)\n" msgstr "" -#: src/elflint.c:713 +#: src/elflint.c:692 #, c-format msgid "section [%2d] '%s': symbol %zu: invalid section index\n" msgstr "" -#: src/elflint.c:720 +#: src/elflint.c:699 #, c-format msgid "section [%2d] '%s': symbol %zu: unknown type\n" msgstr "" -#: src/elflint.c:724 +#: src/elflint.c:703 #, c-format msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n" msgstr "" -#: src/elflint.c:732 +#: src/elflint.c:711 #, c-format msgid "" "section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n" msgstr "" -#: src/elflint.c:736 +#: src/elflint.c:715 #, c-format msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n" msgstr "" -#: src/elflint.c:740 +#: src/elflint.c:719 #, c-format msgid "" "section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n" msgstr "" -#: src/elflint.c:755 +#: src/elflint.c:734 #, c-format msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n" msgstr "" -#: src/elflint.c:760 src/elflint.c:784 src/elflint.c:827 +#: src/elflint.c:739 src/elflint.c:763 src/elflint.c:806 #, c-format msgid "" "section [%2d] '%s': symbol %zu does not fit completely in referenced section " "[%2d] '%s'\n" msgstr "" -#: src/elflint.c:768 +#: src/elflint.c:747 #, c-format msgid "" "section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have " "SHF_TLS flag set\n" msgstr "" -#: src/elflint.c:778 src/elflint.c:820 +#: src/elflint.c:757 src/elflint.c:799 #, c-format msgid "" "section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section " "[%2d] '%s'\n" msgstr "" -#: src/elflint.c:805 +#: src/elflint.c:784 #, c-format msgid "" "section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n" msgstr "" -#: src/elflint.c:813 +#: src/elflint.c:792 #, c-format msgid "" "section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] '%" "s'\n" msgstr "" -#: src/elflint.c:840 +#: src/elflint.c:819 #, c-format msgid "" "section [%2d] '%s': symbol %zu: local symbol outside range described in " "sh_info\n" msgstr "" -#: src/elflint.c:847 +#: src/elflint.c:826 #, c-format msgid "" "section [%2d] '%s': symbol %zu: non-local symbol outside range described in " "sh_info\n" msgstr "" -#: src/elflint.c:854 +#: src/elflint.c:833 #, c-format msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n" msgstr "" -#: src/elflint.c:883 +#: src/elflint.c:884 #, c-format msgid "" "section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not " @@ -2303,769 +2490,738 @@ msgid "" "match .got section size %<PRIu64>\n" msgstr "" -#: src/elflint.c:901 +#: src/elflint.c:896 #, c-format msgid "" "section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got " "section\n" msgstr "" -#: src/elflint.c:920 +#: src/elflint.c:915 #, c-format msgid "" "section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic " "segment address %#<PRIx64>\n" msgstr "" -#: src/elflint.c:927 +#: src/elflint.c:922 #, c-format msgid "" "section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic " "segment size %<PRIu64>\n" msgstr "" -#: src/elflint.c:980 +#: src/elflint.c:975 #, c-format msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n" msgstr "" -#: src/elflint.c:1022 src/elflint.c:1157 +#: src/elflint.c:1017 src/elflint.c:1152 #, c-format msgid "section [%2d] '%s': invalid destination section index\n" msgstr "" -#: src/elflint.c:1035 src/elflint.c:1170 +#: src/elflint.c:1030 src/elflint.c:1165 #, c-format msgid "section [%2d] '%s': invalid destination section type\n" msgstr "" -#: src/elflint.c:1043 src/elflint.c:1178 +#: src/elflint.c:1038 src/elflint.c:1173 #, c-format msgid "section [%2d] '%s': sh_info should be zero\n" msgstr "" -#: src/elflint.c:1050 src/elflint.c:1185 +#: src/elflint.c:1045 src/elflint.c:1180 #, c-format msgid "section [%2d] '%s': no relocations for merge-able sections possible\n" msgstr "" -#: src/elflint.c:1057 +#: src/elflint.c:1052 #, c-format msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n" msgstr "" -#: src/elflint.c:1074 src/elflint.c:1209 +#: src/elflint.c:1069 src/elflint.c:1204 #, c-format msgid "section [%2d] '%s': cannot get relocation %zu: %s\n" msgstr "" -#: src/elflint.c:1081 src/elflint.c:1216 +#: src/elflint.c:1076 src/elflint.c:1211 #, c-format msgid "section [%2d] '%s': relocation %zu: invalid type\n" msgstr "" -#: src/elflint.c:1084 src/elflint.c:1219 +#: src/elflint.c:1079 src/elflint.c:1214 #, c-format msgid "" "section [%2d] '%s': relocation %zu: relocation type invalid for the file " "type\n" msgstr "" -#: src/elflint.c:1092 src/elflint.c:1227 +#: src/elflint.c:1087 src/elflint.c:1222 #, c-format msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n" msgstr "" -#: src/elflint.c:1107 src/elflint.c:1242 +#: src/elflint.c:1102 src/elflint.c:1237 #, c-format msgid "" "section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can " "be used with %s\n" msgstr "" -#: src/elflint.c:1122 src/elflint.c:1258 +#: src/elflint.c:1117 src/elflint.c:1253 #, c-format msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n" msgstr "" -#: src/elflint.c:1192 +#: src/elflint.c:1187 #, c-format msgid "section [%2d] '%s': section entry size does not match ElfXX_Rel\n" msgstr "" -#: src/elflint.c:1328 +#: src/elflint.c:1323 msgid "more than one dynamic section present\n" msgstr "" -#: src/elflint.c:1350 +#: src/elflint.c:1345 #, c-format msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n" msgstr "" -#: src/elflint.c:1355 src/elflint.c:1517 +#: src/elflint.c:1350 src/elflint.c:1512 #, c-format msgid "section [%2d] '%s': sh_info not zero\n" msgstr "" -#: src/elflint.c:1367 +#: src/elflint.c:1362 #, c-format msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n" msgstr "" -#: src/elflint.c:1375 +#: src/elflint.c:1370 #, c-format msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n" msgstr "" -#: src/elflint.c:1382 +#: src/elflint.c:1377 #, c-format msgid "section [%2d] '%s': entry %zu: unknown tag\n" msgstr "" -#: src/elflint.c:1393 +#: src/elflint.c:1388 #, c-format msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n" msgstr "" -#: src/elflint.c:1403 +#: src/elflint.c:1398 #, c-format msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n" msgstr "" -#: src/elflint.c:1415 +#: src/elflint.c:1410 #, c-format msgid "" "section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n" msgstr "" -#: src/elflint.c:1440 +#: src/elflint.c:1435 #, c-format msgid "section [%2d] '%s': contains %s entry but not %s\n" msgstr "" -#: src/elflint.c:1452 +#: src/elflint.c:1447 #, c-format msgid "section [%2d] '%s': mandatory tag %s not present\n" msgstr "" -#: src/elflint.c:1462 src/elflint.c:1469 +#: src/elflint.c:1457 src/elflint.c:1464 #, c-format msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n" msgstr "" -#: src/elflint.c:1497 +#: src/elflint.c:1492 #, c-format msgid "" "section [%2d] '%s': extended section index section not for symbol table\n" msgstr "" -#: src/elflint.c:1502 +#: src/elflint.c:1497 msgid "cannot get data for symbol section\n" msgstr "" -#: src/elflint.c:1505 src/elflint.c:1596 +#: src/elflint.c:1500 src/elflint.c:1591 #, c-format msgid "section [%2d] '%s': entry size does not match Elf32_Word\n" msgstr "" -#: src/elflint.c:1512 +#: src/elflint.c:1507 #, c-format msgid "section [%2d] '%s': extended index table too small for symbol table\n" msgstr "" -#: src/elflint.c:1529 +#: src/elflint.c:1524 #, c-format msgid "" "section [%2d] '%s': extended section index in section [%2zu] '%s' refers to " "same symbol table\n" msgstr "" -#: src/elflint.c:1540 +#: src/elflint.c:1535 msgid "symbol 0 should have zero extended section index\n" msgstr "" -#: src/elflint.c:1552 +#: src/elflint.c:1547 #, c-format msgid "cannot get data for symbol %zu\n" msgstr "" -#: src/elflint.c:1557 +#: src/elflint.c:1552 #, c-format msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n" msgstr "" -#: src/elflint.c:1591 +#: src/elflint.c:1586 #, c-format msgid "section [%2d] '%s': hash table not for dynamic symbol table\n" msgstr "" -#: src/elflint.c:1601 +#: src/elflint.c:1596 #, c-format msgid "section [%2d] '%s': not marked to be allocated\n" msgstr "" -#: src/elflint.c:1606 +#: src/elflint.c:1601 #, c-format msgid "" "section [%2d] '%s': hash table has not even room for nbucket and nchain\n" msgstr "" -#: src/elflint.c:1616 +#: src/elflint.c:1611 #, c-format msgid "" "section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n" msgstr "" -#: src/elflint.c:1627 +#: src/elflint.c:1622 #, c-format msgid "section [%2d] '%s': chain array not large enough\n" msgstr "" -#: src/elflint.c:1632 +#: src/elflint.c:1627 #, c-format msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n" msgstr "" -#: src/elflint.c:1638 +#: src/elflint.c:1633 #, c-format msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n" msgstr "" -#: src/elflint.c:1650 +#: src/elflint.c:1645 #, c-format msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n" msgstr "" -#: src/elflint.c:1670 +#: src/elflint.c:1665 #, c-format msgid "" "section [%2d] '%s': section groups only allowed in relocatable object files\n" msgstr "" -#: src/elflint.c:1681 +#: src/elflint.c:1676 #, c-format msgid "section [%2d] '%s': cannot get symbol table: %s\n" msgstr "" -#: src/elflint.c:1686 +#: src/elflint.c:1681 #, c-format msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n" msgstr "" -#: src/elflint.c:1692 +#: src/elflint.c:1687 #, c-format msgid "section [%2d] '%s': invalid symbol index in sh_info\n" msgstr "" -#: src/elflint.c:1697 +#: src/elflint.c:1692 #, c-format msgid "section [%2d] '%s': sh_flags not zero\n" msgstr "" -#: src/elflint.c:1702 +#: src/elflint.c:1697 #, c-format msgid "section [%2d] '%s': sh_flags not set correctly\n" msgstr "" -#: src/elflint.c:1708 +#: src/elflint.c:1703 #, c-format msgid "section [%2d] '%s': cannot get data: %s\n" msgstr "" -#: src/elflint.c:1717 +#: src/elflint.c:1712 #, c-format msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n" msgstr "" -#: src/elflint.c:1722 +#: src/elflint.c:1717 #, c-format msgid "section [%2d] '%s': section group without flags word\n" msgstr "" -#: src/elflint.c:1728 +#: src/elflint.c:1723 #, c-format msgid "section [%2d] '%s': section group without member\n" msgstr "" -#: src/elflint.c:1732 +#: src/elflint.c:1727 #, c-format msgid "section [%2d] '%s': section group with only one member\n" msgstr "" -#: src/elflint.c:1743 +#: src/elflint.c:1738 #, c-format msgid "section [%2d] '%s': unknown section group flags\n" msgstr "" -#: src/elflint.c:1755 +#: src/elflint.c:1750 #, c-format msgid "section [%2d] '%s': section index %Zu out of range\n" msgstr "" -#: src/elflint.c:1766 +#: src/elflint.c:1761 #, c-format msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n" msgstr "" -#: src/elflint.c:1773 +#: src/elflint.c:1768 #, c-format msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n" msgstr "" -#: src/elflint.c:1779 +#: src/elflint.c:1774 #, c-format msgid "" "section [%2d] '%s': element %Zu references section [%2d] '%s' without " "SHF_GROUP flag set\n" msgstr "" -#: src/elflint.c:1786 +#: src/elflint.c:1781 #, c-format msgid "section [%2d] '%s' is contained in more than one section group\n" msgstr "" -#: src/elflint.c:1911 +#: src/elflint.c:1906 #, c-format msgid "" "section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no " "dynamic symbol table\n" msgstr "" -#: src/elflint.c:1920 +#: src/elflint.c:1915 #, c-format msgid "" "section [%2d] '%s' has different number of entries than symbol table [%2d] '%" "s'\n" msgstr "" -#: src/elflint.c:1952 +#: src/elflint.c:1947 msgid "cannot get section header of zeroth section\n" msgstr "" -#: src/elflint.c:1956 +#: src/elflint.c:1951 msgid "zeroth section has nonzero name\n" msgstr "" -#: src/elflint.c:1958 +#: src/elflint.c:1953 msgid "zeroth section has nonzero type\n" msgstr "" -#: src/elflint.c:1960 +#: src/elflint.c:1955 msgid "zeroth section has nonzero flags\n" msgstr "" -#: src/elflint.c:1962 +#: src/elflint.c:1957 msgid "zeroth section has nonzero address\n" msgstr "" -#: src/elflint.c:1964 +#: src/elflint.c:1959 msgid "zeroth section has nonzero offset\n" msgstr "" -#: src/elflint.c:1966 +#: src/elflint.c:1961 msgid "zeroth section has nonzero info field\n" msgstr "" -#: src/elflint.c:1968 +#: src/elflint.c:1963 msgid "zeroth section has nonzero align value\n" msgstr "" -#: src/elflint.c:1970 +#: src/elflint.c:1965 msgid "zeroth section has nonzero entry size value\n" msgstr "" -#: src/elflint.c:1973 +#: src/elflint.c:1968 msgid "" "zeroth section has nonzero size value while ELF header has nonzero shnum " "value\n" msgstr "" -#: src/elflint.c:1977 +#: src/elflint.c:1972 msgid "" "zeroth section has nonzero link value while ELF header does not signal " "overflow in shstrndx\n" msgstr "" -#: src/elflint.c:1989 +#: src/elflint.c:1984 #, c-format msgid "cannot get section header for section [%2zu] '%s': %s\n" msgstr "" -#: src/elflint.c:1998 +#: src/elflint.c:1993 #, c-format msgid "section [%2zu]: invalid name\n" msgstr "" -#: src/elflint.c:2013 +#: src/elflint.c:2009 #, c-format msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n" msgstr "" -#: src/elflint.c:2027 +#: src/elflint.c:2023 #, c-format msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n" msgstr "" -#: src/elflint.c:2044 +#: src/elflint.c:2040 #, c-format msgid "" "section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n" msgstr "" -#: src/elflint.c:2062 +#: src/elflint.c:2058 #, c-format msgid "section [%2zu] '%s' present in object file\n" msgstr "" -#: src/elflint.c:2068 src/elflint.c:2100 +#: src/elflint.c:2064 src/elflint.c:2096 #, c-format msgid "" "section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n" msgstr "" -#: src/elflint.c:2073 src/elflint.c:2105 +#: src/elflint.c:2069 src/elflint.c:2101 #, c-format msgid "" "section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable " "segments\n" msgstr "" -#: src/elflint.c:2081 +#: src/elflint.c:2077 #, c-format msgid "" "section [%2zu] '%s' is extension section index table in non-object file\n" msgstr "" -#: src/elflint.c:2116 +#: src/elflint.c:2112 #, c-format msgid "section [%2zu] '%s': size not multiple of entry size\n" msgstr "" -#: src/elflint.c:2121 +#: src/elflint.c:2117 msgid "cannot get section header\n" msgstr "" -#: src/elflint.c:2129 +#: src/elflint.c:2125 #, c-format msgid "unsupported section type %d\n" msgstr "" -#: src/elflint.c:2135 +#: src/elflint.c:2131 #, c-format msgid "section [%2zu] '%s' contain unknown flag(s) %d\n" msgstr "" -#: src/elflint.c:2142 +#: src/elflint.c:2138 #, c-format msgid "section [%2zu] '%s': thread-local data sections address not zero\n" msgstr "" -#: src/elflint.c:2150 +#: src/elflint.c:2146 #, c-format msgid "section [%2zu] '%s': invalid section reference in link value\n" msgstr "" -#: src/elflint.c:2155 +#: src/elflint.c:2151 #, c-format msgid "section [%2zu] '%s': invalid section reference in info value\n" msgstr "" -#: src/elflint.c:2162 +#: src/elflint.c:2158 #, c-format msgid "section [%2zu] '%s': strings flag set without merge flag\n" msgstr "" -#: src/elflint.c:2167 +#: src/elflint.c:2163 #, c-format msgid "section [%2zu] '%s': merge flag set but entry size is zero\n" msgstr "" -#: src/elflint.c:2194 +#: src/elflint.c:2190 #, c-format msgid "" "section [%2zu] '%s' not fully contained in segment of program header entry %" "d\n" msgstr "" -#: src/elflint.c:2201 +#: src/elflint.c:2198 #, c-format msgid "" "section [%2zu] '%s' has type NOBITS but is read from the file in segment of " "program header entry %d\n" msgstr "" -#: src/elflint.c:2208 +#: src/elflint.c:2205 #, c-format msgid "" "section [%2zu] '%s' has not type NOBITS but is not read from the file in " "segment of program header entry %d\n" msgstr "" -#: src/elflint.c:2217 +#: src/elflint.c:2214 #, c-format msgid "" "section [%2zu] '%s': alloc flag set but section not in any loaded segment\n" msgstr "" -#: src/elflint.c:2223 +#: src/elflint.c:2220 #, c-format msgid "" "section [%2zu] '%s': ELF header says this is the section header string table " "but type is not SHT_TYPE\n" msgstr "" -#: src/elflint.c:2273 +#: src/elflint.c:2270 msgid "INTERP program header entry but no .interp section\n" msgstr "" -#: src/elflint.c:2284 +#: src/elflint.c:2281 #, c-format msgid "phdr[%d]: no note entries defined for the type of file\n" msgstr "" -#: src/elflint.c:2367 +#: src/elflint.c:2368 #, c-format msgid "phdr[%d]: note entries probably in form of a 32-bit ELF file\n" msgstr "" -#: src/elflint.c:2370 +#: src/elflint.c:2371 #, c-format msgid "phdr[%d]: extra %zu bytes after last note\n" msgstr "" -#: src/elflint.c:2399 +#: src/elflint.c:2400 #, c-format msgid "phdr[%d]: unknown core file note type %<PRIu64> at offset %<PRIu64>\n" msgstr "" -#: src/elflint.c:2407 +#: src/elflint.c:2408 #, c-format msgid "phdr[%d]: unknown object file note type %<PRIu64> at offset %<PRIu64>\n" msgstr "" -#: src/elflint.c:2429 +#: src/elflint.c:2430 msgid "" "only executables, shared objects, and core files can have program headers\n" msgstr "" -#: src/elflint.c:2444 +#: src/elflint.c:2445 #, c-format msgid "cannot get program header entry %d: %s\n" msgstr "" -#: src/elflint.c:2451 +#: src/elflint.c:2452 #, c-format msgid "program header entry %d: unknown program header entry type\n" msgstr "" -#: src/elflint.c:2462 +#: src/elflint.c:2463 msgid "more than one INTERP entry in program header\n" msgstr "" -#: src/elflint.c:2470 +#: src/elflint.c:2471 msgid "more than one TLS entry in program header\n" msgstr "" -#: src/elflint.c:2476 +#: src/elflint.c:2477 msgid "static executable cannot have dynamic sections\n" msgstr "" -#: src/elflint.c:2480 +#: src/elflint.c:2481 msgid "more than one GNU_RELRO entry in program header\n" msgstr "" -#: src/elflint.c:2501 +#: src/elflint.c:2502 msgid "loadable segment GNU_RELRO applies to is not writable\n" msgstr "" -#: src/elflint.c:2504 +#: src/elflint.c:2505 msgid "loadable segment GNU_RELRO applies to is executable\n" msgstr "" -#: src/elflint.c:2511 +#: src/elflint.c:2512 msgid "GNU_RELRO segment not contained in a loaded segment\n" msgstr "" -#: src/elflint.c:2517 +#: src/elflint.c:2518 #, c-format msgid "program header entry %d: file size greater than memory size\n" msgstr "" -#: src/elflint.c:2524 +#: src/elflint.c:2525 #, c-format msgid "program header entry %d: alignment not a power of 2\n" msgstr "" -#: src/elflint.c:2527 +#: src/elflint.c:2528 #, c-format msgid "" "program header entry %d: file offset and virtual address not module of " "alignment\n" msgstr "" -#: src/elflint.c:2557 +#: src/elflint.c:2558 #, c-format msgid "cannot read ELF header: %s\n" msgstr "" -#: libasm/asm_end.c:215 -#, c-format -msgid "cannot create extended section index table: %s" -msgstr "" - -#: libasm/asm_end.c:316 -#, c-format -msgid "cannot create section group for output file: %s" -msgstr "" - -#: libasm/asm_error.c:108 libdw/dwarf_error.c:74 -msgid "no error" -msgstr "" - -#: libasm/asm_error.c:109 libdw/dwarf_error.c:83 -msgid "out of memory" -msgstr "" - -#: libasm/asm_error.c:111 -msgid "invalid parameter" -msgstr "" - -#: libasm/asm_error.c:112 -msgid "cannot change mode of output file" -msgstr "" - -#: libasm/asm_error.c:114 -msgid "duplicate symbol" -msgstr "" - -#: libasm/asm_error.c:115 -msgid "invalid section type for operation" +#: src/addr2line.c:52 src/findtextrel.c:56 +msgid "Input Selection:" msgstr "" -#: libasm/asm_error.c:149 -msgid "Unknown error" +#: src/addr2line.c:53 +msgid "Find addresses in FILE" msgstr "" -#: libdw/dwarf_error.c:75 -msgid "unknown error" +#: src/addr2line.c:55 +msgid "Output Selection:" msgstr "" -#: libdw/dwarf_error.c:76 -msgid "invalid access" +#: src/addr2line.c:56 +msgid "Show only base names of source files" msgstr "" -#: libdw/dwarf_error.c:77 -msgid "no regular file" +#: src/addr2line.c:57 +msgid "Additional show function names" msgstr "" -#: libdw/dwarf_error.c:78 -msgid "I/O error" -msgstr "" - -#: libdw/dwarf_error.c:79 -msgid "invalid ELF file" -msgstr "" - -#: libdw/dwarf_error.c:80 -msgid "no DWARF information" -msgstr "" - -#: libdw/dwarf_error.c:81 -msgid "no ELF file" -msgstr "" - -#: libdw/dwarf_error.c:82 -msgid "cannot get ELF header" -msgstr "" - -#: libdw/dwarf_error.c:84 -msgid "not implemented" -msgstr "" - -#: libdw/dwarf_error.c:85 -msgid "invalid command" +#: src/addr2line.c:68 +msgid "" +"Locate source files and line information for ADDRs (in a.out by default)." msgstr "" -#: libdw/dwarf_error.c:86 -msgid "invalid version" +#: src/addr2line.c:72 +msgid "[ADDR...]" msgstr "" -#: libdw/dwarf_error.c:87 -msgid "invalid file" +#: src/addr2line.c:135 +#, c-format +msgid "cannot create ELF descriptor: %s" msgstr "" -#: libdw/dwarf_error.c:88 -msgid "no entries found" +#: src/findtextrel.c:57 +msgid "Prepend PATH to all file names" msgstr "" -#: libdw/dwarf_error.c:89 -msgid "invalid DWARF" +#: src/findtextrel.c:59 +msgid "Use PATH as root of debuginfo hierarchy" msgstr "" -#: libdw/dwarf_error.c:90 -msgid "no string data" +#: src/findtextrel.c:66 +msgid "Locate source of text relocations in FILEs (a.out by default)." msgstr "" -#: libdw/dwarf_error.c:91 -msgid "no address value" +#: src/findtextrel.c:222 +#, c-format +msgid "cannot create ELF descriptor for '%s': %s" msgstr "" -#: libdw/dwarf_error.c:92 -msgid "no constant value" +#: src/findtextrel.c:232 +#, c-format +msgid "cannot get ELF header '%s': %s" msgstr "" -#: libdw/dwarf_error.c:93 -msgid "no reference value" +#: src/findtextrel.c:243 +#, c-format +msgid "'%s' is not a DSO or PIE" msgstr "" -#: libdw/dwarf_error.c:94 -msgid "invalid reference value" +#: src/findtextrel.c:260 +#, c-format +msgid "getting get section header of section %zu: %s" msgstr "" -#: libdw/dwarf_error.c:95 -msgid ".debug_line section missing" +#: src/findtextrel.c:278 +#, c-format +msgid "cannot read dynamic section: %s" msgstr "" -#: libdw/dwarf_error.c:96 -msgid "invalid .debug_line section" +#: src/findtextrel.c:293 +#, c-format +msgid "no text relocations reported in '%s'" msgstr "" -#: libdw/dwarf_error.c:97 -msgid "debug information too big" +#: src/findtextrel.c:305 +msgid "while reading ELF file" msgstr "" -#: libdw/dwarf_error.c:98 -msgid "invalid DWARF version" +#: src/findtextrel.c:314 src/findtextrel.c:331 +#, c-format +msgid "cannot get program header index at offset %d: %s" msgstr "" -#: libdw/dwarf_error.c:99 -msgid "invalid directory index" +#: src/findtextrel.c:383 +#, c-format +msgid "cannot get section header of section %Zu: %s" msgstr "" -#: libdw/dwarf_error.c:100 -msgid "address out of range" +#: src/findtextrel.c:395 +#, c-format +msgid "cannot get symbol table section %zu in '%s': %s" msgstr "" -#: libdw/dwarf_error.c:101 -msgid "no location list value" +#: src/findtextrel.c:415 src/findtextrel.c:438 +#, c-format +msgid "cannot get relocation at index %d in section %zu in '%s': %s" msgstr "" -#: libdw/dwarf_error.c:102 -msgid "no block data" +#: src/findtextrel.c:503 +#, c-format +msgid "%s not compiled with -fpic/-fPIC\n" msgstr "" -#: libdw/dwarf_error.c:103 -msgid "invalid line index" +#: src/findtextrel.c:556 +#, c-format +msgid "" +"the file containing the function '%s' is not compiled with -fpic/-fPIC\n" msgstr "" -#: libdw/dwarf_error.c:104 -msgid "invalid address range index" +#: src/findtextrel.c:563 src/findtextrel.c:583 +#, c-format +msgid "" +"the file containing the function '%s' might not be compiled with -fpic/-" +"fPIC\n" msgstr "" -#: libdw/dwarf_error.c:105 -msgid "no matching address range" +#: src/findtextrel.c:571 +#, c-format +msgid "" +"either the file containing the function '%s' or the file containing the " +"function '%s' is not compiled with -fpic/-fPIC\n" msgstr "" -#: libdw/dwarf_error.c:106 -msgid "no flag value" +#: src/findtextrel.c:591 +#, c-format +msgid "" +"a relocation modifies memory at offset %llu in a write-protected segment\n" msgstr "" diff --git a/elfutils/splint.rc b/elfutils/splint.rc deleted file mode 100644 index e0461c41..00000000 --- a/elfutils/splint.rc +++ /dev/null @@ -1 +0,0 @@ -+posixlib diff --git a/elfutils/src/ChangeLog b/elfutils/src/ChangeLog index e5b44049..b55e43b6 100644 --- a/elfutils/src/ChangeLog +++ b/elfutils/src/ChangeLog @@ -1,3 +1,149 @@ +2005-05-08 Roland McGrath <roland@redhat.com> + + * strip.c (handle_elf): Don't translate hash and versym data formats, + elf_getdata already did it for us. + +2005-05-07 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am (findtextrel_LDADD): Add $(libmudflap). + (addr2line_LDADD): Likewise. + +2005-05-03 Roland McGrath <roland@redhat.com> + + * strip.c (handle_elf): Apply symbol table fixups to discarded + relocation sections when they are being saved in the debug file. + + * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom + and gelf_xlatetof, not the native byte order. + + * strip.c (parse_opt): Give error if -f or -o is repeated. + (main): Exit if argp_parse returns nonzero. + + * strip.c (debug_fname_embed): New variable. + (options, parse_opt): New option -F to set it. + +2005-05-07 Ulrich Drepper <drepper@redhat.com> + + * readelf.c (parse_opt): Make any_control_option variable + local. Simplify some tests. + +2005-05-03 Roland McGrath <roland@redhat.com> + + * strip.c (crc32_file): Function removed (now in ../lib). + +2005-05-03 Roland McGrath <roland@redhat.com> + + * elflint.c (is_debuginfo): New variable. + (options, parse_opt): New option --debuginfo/-d to set it. + (check_sections): If is_debuginfo, don't complain about SHT_NOBITS. + (check_note): If is_debuginfo, don't try to get note contents. + +2005-04-24 Ulrich Drepper <drepper@redhat.com> + + * readelf.c (print_debug_abbrev_section): Don't print error when end of + section reached. + +2005-04-14 Ulrich Drepper <drepper@redhat.com> + + * readelf.c (dwarf_encoding_string): New function. + (dwarf_inline_string): New function. + (dwarf_access_string): New function. + (dwarf_visibility_string): New function. + (dwarf_virtuality_string): New function. + (dwarf_identifier_case_string): New function. + (dwarf_calling_convention_string): New function. + (dwarf_ordering_string): New function. + (dwarf_discr_list_string): New function. + (attr_callback): Decode man more attribute values. + +2005-04-01 Ulrich Drepper <drepper@redhat.com> + + * addr2line.c: Finish implementation of -f option. + +2005-03-29 Ulrich Drepper <drepper@redhat.com> + + * addr2line.c: New file. + * Makefile.am (bin_PROGRAMS): Add addr2line. + Define addr2line_LDADD. + + * findtextrel.c: Use new dwarf_addrdie function. + + * findtextrel.c: Fix usage message and re-add accidentally removed + line. + +2005-03-28 Ulrich Drepper <drepper@redhat.com> + + * findtextrel.c: New file. + * Makefile: Add rules to build findtextrel. + +2005-02-15 Ulrich Drepper <drepper@redhat.com> + + * ldlex.l: Provide ECHO definition to avoid warning. + + * elflint.c (check_program_header): Fix typo in RELRO test. + + * Makefile.am (AM_CFLAGS): Add more warning options. + * elflint.c: Fix warnings introduced by the new warning options. + * i386_ld.c: Likewise. + * ld.c: Likewise. + * ld.h: Likewise. + * ldgeneric.c: Likewise. + * nm.c: Likewise. + * readelf.c: Likewise. + * sectionhash.c: Likewise. + * size.c: Likewise. + * string.c: Likewise. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am: Check for text relocations in constructed DSOs. + + * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps + with -lmudflap. + + * ldscript.y: Add as_needed handling. + * ldlex.l: Recognize AS_NEEDED token. + * ld.h (struct filename_list): Add as_needed flag. + +2005-02-04 Ulrich Drepper <drepper@redhat.com> + + * elflint.c (check_symtab): Correctly determine size of GOT section. + +2005-01-19 Ulrich Drepper <drepper@redhat.com> + + * ld.c: Remove unnecessary more_help function. Print bug report + address using argp. + * strip.c: Likewise. + * size.c: Likewise. + * nm.c: Likewise. + * readelf.c: Likewise. + * elflint.c: Likewise. + + * elflint.c (main): Don't check for parameter problems here. + (parse_opt): Do it here, where we get informed about some of them + anyway. + + * readelf.c (main): Don't check for parameter problems here. + (parse_opt): Do it here, where we get informed about some of them + anyway. + +2005-01-11 Ulrich Drepper <drepper@redhat.com> + + * strip.c: Update copyright year. + * readelf.c: Likewise. + * size.c: Likewise. + * nm.c: Likewise. + * ld.c: Likewise. + * elflint.c: Likewise. + + * elflint.c (check_symtab): Don't warn about wrong size for + _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld. + +2004-10-05 Ulrich Drepper <drepper@redhat.com> + + * readelf.c (print_phdr): In section mapping, also indicate + sections in read-only segments. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * readelf.c: Make compile with gcc 4.0. diff --git a/elfutils/src/Makefile.am b/elfutils/src/Makefile.am index 7b957eb5..26b978cd 100644 --- a/elfutils/src/Makefile.am +++ b/elfutils/src/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 1996-2002, 2003, 2004, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -16,14 +15,17 @@ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \ -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\" if MUDFLAP -AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ - $(native_ld_cflags) +AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \ + $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \ + $(if $($(*F)_no_Wformat),,-Wformat=2) else -AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ - $(if $($(*F)_no_Werror),,-Werror) $(native_ld_cflags) +AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \ + $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wformat),,-Wformat=2) endif if MUDFLAP -AM_LDFLAGS = -fmudflap +libmudflap = -lmudflap endif INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl -I$(srcdir)/../lib -I$(srcdir)/../libdw -I.. @@ -36,7 +38,7 @@ AM_LFLAGS = -Pld -olex.yy.c native_ld = @native_ld@ base_cpu = @base_cpu@ -bin_PROGRAMS = readelf nm size strip ld elflint +bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line ld_dsos = libld_elf_i386_pic.a @@ -48,6 +50,8 @@ noinst_LIBRARIES = libld_elf.a $(ld_dsos) noinst_PROGRAMS = $(ld_dsos:_pic.a=.so) endif +textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi + ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \ versionhash.c @@ -68,16 +72,23 @@ endif libebl = ../libebl/libebl.a libeu = ../lib/libeu.a -readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl -nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl -size_LDADD = $(libelf) $(libeu) -strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl -ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl +nm_no_Wformat = yes +size_no_Wformat = yes +# XXX While the file is not finished, don't warn about this +ldgeneric_no_Wunused = yes + +readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +size_LDADD = $(libelf) $(libeu) $(libmudflap) +strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl if NATIVE_LD ld_LDADD += libld_elf.a endif ld_LDFLAGS = -rdynamic -elflint_LDADD = $(libebl) $(libelf) $(libeu) -ldl +elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap) +addr2line_LDADD = $(libdw) $(libelf) $(libmudflap) ldlex.o: ldscript.c ldlex_no_Werror = yes @@ -94,6 +105,7 @@ libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ $(libelf) $(libeu) \ -Wl,--version-script,$(srcdir)/libld_elf_i386.map + $(textrel_check) %.os: %.c %.o diff --git a/elfutils/src/Makefile.in b/elfutils/src/Makefile.in index 0eb72237..d2114978 100644 --- a/elfutils/src/Makefile.in +++ b/elfutils/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,7 +16,7 @@ -SOURCES = $(libld_elf_a_SOURCES) $(libld_elf_i386_pic_a_SOURCES) elflint.c $(ld_SOURCES) $(libld_elf_i386_so_SOURCES) nm.c readelf.c size.c strip.c +SOURCES = $(libld_elf_a_SOURCES) $(libld_elf_i386_pic_a_SOURCES) addr2line.c elflint.c findtextrel.c $(ld_SOURCES) $(libld_elf_i386_so_SOURCES) nm.c readelf.c size.c strip.c srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -41,7 +41,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \ - strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) + strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \ + findtextrel$(EXEEXT) addr2line$(EXEEXT) @NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) @NATIVE_LD_TRUE@am__append_1 = libld_elf.a subdir = src @@ -49,8 +50,6 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ChangeLog ldlex.c ldscript.c ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -71,41 +70,54 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) am__EXEEXT_1 = libld_elf_i386.so$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -elflint_SOURCES = elflint.c -elflint_OBJECTS = elflint.$(OBJEXT) -am__DEPENDENCIES_1 = ../libebl/libebl.a +addr2line_SOURCES = addr2line.c +addr2line_OBJECTS = addr2line.$(OBJEXT) +@MUDFLAP_FALSE@am__DEPENDENCIES_1 = ../libdw/libdw.so +@MUDFLAP_TRUE@am__DEPENDENCIES_1 = ../libdw/libdw.a @MUDFLAP_FALSE@am__DEPENDENCIES_2 = ../libelf/libelf.so @MUDFLAP_TRUE@am__DEPENDENCIES_2 = ../libelf/libelf.a -am__DEPENDENCIES_3 = ../lib/libeu.a -elflint_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ +am__DEPENDENCIES_3 = +addr2line_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +elflint_SOURCES = elflint.c +elflint_OBJECTS = elflint.$(OBJEXT) +am__DEPENDENCIES_4 = ../libebl/libebl.a +am__DEPENDENCIES_5 = ../lib/libeu.a +elflint_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_3) +findtextrel_SOURCES = findtextrel.c +findtextrel_OBJECTS = findtextrel.$(OBJEXT) +findtextrel_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) am_ld_OBJECTS = ld.$(OBJEXT) ldgeneric.$(OBJEXT) ldlex.$(OBJEXT) \ ldscript.$(OBJEXT) symbolhash.$(OBJEXT) sectionhash.$(OBJEXT) \ versionhash.$(OBJEXT) ld_OBJECTS = $(am_ld_OBJECTS) -@NATIVE_LD_TRUE@am__DEPENDENCIES_4 = libld_elf.a -ld_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) +@NATIVE_LD_TRUE@am__DEPENDENCIES_6 = libld_elf.a +ld_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_6) am_libld_elf_i386_so_OBJECTS = libld_elf_i386_so_OBJECTS = $(am_libld_elf_i386_so_OBJECTS) libld_elf_i386_so_LDADD = $(LDADD) nm_SOURCES = nm.c nm_OBJECTS = nm.$(OBJEXT) -@MUDFLAP_FALSE@am__DEPENDENCIES_5 = ../libdw/libdw.so -@MUDFLAP_TRUE@am__DEPENDENCIES_5 = ../libdw/libdw.a -nm_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +nm_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_3) readelf_SOURCES = readelf.c readelf_OBJECTS = readelf.$(OBJEXT) -readelf_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +readelf_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_3) size_SOURCES = size.c size_OBJECTS = size.$(OBJEXT) -size_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +size_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_3) strip_SOURCES = strip.c strip_OBJECTS = strip.$(OBJEXT) -strip_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) +strip_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -116,11 +128,11 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) SOURCES = $(libld_elf_a_SOURCES) $(libld_elf_i386_pic_a_SOURCES) \ - elflint.c $(ld_SOURCES) $(libld_elf_i386_so_SOURCES) nm.c \ - readelf.c size.c strip.c + addr2line.c elflint.c findtextrel.c $(ld_SOURCES) \ + $(libld_elf_i386_so_SOURCES) nm.c readelf.c size.c strip.c DIST_SOURCES = $(libld_elf_a_SOURCES) $(libld_elf_i386_pic_a_SOURCES) \ - elflint.c $(ld_SOURCES) $(libld_elf_i386_so_SOURCES) nm.c \ - readelf.c size.c strip.c + addr2line.c elflint.c findtextrel.c $(ld_SOURCES) \ + $(libld_elf_i386_so_SOURCES) nm.c readelf.c size.c strip.c HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags @@ -136,7 +148,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -147,25 +158,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -183,7 +188,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -231,13 +235,16 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ -@MUDFLAP_FALSE@ $(if $($(*F)_no_Werror),,-Werror) $(native_ld_cflags) +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \ +@MUDFLAP_FALSE@ $(if $($(*F)_no_Werror),,-Werror) \ +@MUDFLAP_FALSE@ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ +@MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),,-Wformat=2) -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ -@MUDFLAP_TRUE@ $(native_ld_cflags) +@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \ +@MUDFLAP_TRUE@ $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \ +@MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),,-Wformat=2) -@MUDFLAP_TRUE@AM_LDFLAGS = -fmudflap +@MUDFLAP_TRUE@libmudflap = -lmudflap INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl -I$(srcdir)/../lib -I$(srcdir)/../libdw -I.. AM_YFLAGS = -pld AM_LFLAGS = -Pld -olex.yy.c @@ -246,6 +253,7 @@ ld_dsos = libld_elf_i386_pic.a @NATIVE_LD_FALSE@noinst_LIBRARIES = libld_elf.a $(ld_dsos) @NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a @NATIVE_LD_TRUE@native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu) +textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \ versionhash.c @@ -260,13 +268,20 @@ ld_modules = i386_ld.c @MUDFLAP_TRUE@libelf = ../libelf/libelf.a libebl = ../libebl/libebl.a libeu = ../lib/libeu.a -readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl -nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl -size_LDADD = $(libelf) $(libeu) -strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl -ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(am__append_1) +nm_no_Wformat = yes +size_no_Wformat = yes +# XXX While the file is not finished, don't warn about this +ldgeneric_no_Wunused = yes +readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +size_LDADD = $(libelf) $(libeu) $(libmudflap) +strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \ + $(am__append_1) ld_LDFLAGS = -rdynamic -elflint_LDADD = $(libebl) $(libelf) $(libeu) -ldl +elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl +findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap) +addr2line_LDADD = $(libdw) $(libelf) $(libmudflap) ldlex_no_Werror = yes # Machine-specific linker code. @@ -345,9 +360,15 @@ clean-binPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +addr2line$(EXEEXT): $(addr2line_OBJECTS) $(addr2line_DEPENDENCIES) + @rm -f addr2line$(EXEEXT) + $(LINK) $(addr2line_LDFLAGS) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS) elflint$(EXEEXT): $(elflint_OBJECTS) $(elflint_DEPENDENCIES) @rm -f elflint$(EXEEXT) $(LINK) $(elflint_LDFLAGS) $(elflint_OBJECTS) $(elflint_LDADD) $(LIBS) +findtextrel$(EXEEXT): $(findtextrel_OBJECTS) $(findtextrel_DEPENDENCIES) + @rm -f findtextrel$(EXEEXT) + $(LINK) $(findtextrel_LDFLAGS) $(findtextrel_OBJECTS) $(findtextrel_LDADD) $(LIBS) ld$(EXEEXT): $(ld_OBJECTS) $(ld_DEPENDENCIES) @rm -f ld$(EXEEXT) $(LINK) $(ld_LDFLAGS) $(ld_OBJECTS) $(ld_LDADD) $(LIBS) @@ -371,7 +392,9 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/$(base_cpu)_ld.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addr2line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elflint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findtextrel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ld.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldgeneric.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldlex.Po@am__quote@ @@ -603,6 +626,7 @@ libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ $(libelf) $(libeu) \ -Wl,--version-script,$(srcdir)/libld_elf_i386.map + $(textrel_check) %.os: %.c %.o if $(filter-out -fmudflap,$(COMPILE)) -c -o $@ -fpic -DPIC -DSHARED \ diff --git a/elfutils/src/addr2line.c b/elfutils/src/addr2line.c new file mode 100644 index 00000000..60fcdf63 --- /dev/null +++ b/elfutils/src/addr2line.c @@ -0,0 +1,372 @@ +/* Locate source files and line information for given addresses + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <argp.h> +#include <assert.h> +#include <errno.h> +#include <error.h> +#include <fcntl.h> +#include <gelf.h> +#include <inttypes.h> +#include <libdw.h> +#include <libintl.h> +#include <locale.h> +#include <mcheck.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdio_ext.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + + +/* Name and version of program. */ +static void print_version (FILE *stream, struct argp_state *state); +void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + + +/* Values for the parameters which have no short form. */ +#define OPT_DEMANGLER 0x100 + +/* Definitions of arguments for argp functions. */ +static const struct argp_option options[] = +{ + { NULL, 0, NULL, 0, N_("Input Selection:"), 0 }, + { "exe", 'e', "FILE", 0, N_("Find addresses in FILE"), 0 }, + + { NULL, 0, NULL, 0, N_("Output Selection:"), 0 }, + { "basenames", 's', NULL, 0, N_("Show only base names of source files"), 0 }, + { "functions", 'f', NULL, 0, N_("Additional show function names"), 0 }, + + { NULL, 0, NULL, 0, N_("Miscellaneous:"), 0 }, + /* Unsupported options. */ + { "target", 'b', "ARG", OPTION_HIDDEN, NULL, 0 }, + { "demangle", 'C', "ARG", OPTION_HIDDEN | OPTION_ARG_OPTIONAL, NULL, 0 }, + { "demangler", OPT_DEMANGLER, "ARG", OPTION_HIDDEN, NULL, 0 }, + { NULL, 0, NULL, 0, NULL, 0 } +}; + +/* Short description of program. */ +static const char doc[] = N_("\ +Locate source files and line information for ADDRs (in a.out by default)."); + +/* Strings for arguments in help texts. */ +static const char args_doc[] = N_("[ADDR...]"); + +/* Prototype for option handler. */ +static error_t parse_opt (int key, char *arg, struct argp_state *state); + +/* Data structure to communicate with argp functions. */ +static struct argp argp = +{ + options, parse_opt, args_doc, doc, NULL, NULL, NULL +}; + + +/* Handle ADDR. */ +static void handle_address (GElf_Addr addr, Elf *elf, Dwarf *dw); + + +/* Name of the executable. */ +static const char *executable = "a.out"; + +/* True if only base names of files should be shown. */ +static bool only_basenames; + +/* True if function names should be shown. */ +static bool show_functions; + + +int +main (int argc, char *argv[]) +{ + int remaining; + int result = 0; + + /* Make memory leak detection possible. */ + mtrace (); + + /* We use no threads here which can interfere with handling a stream. */ + (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER); + + /* Set locale. */ + (void) setlocale (LC_ALL, ""); + + /* Make sure the message catalog can be found. */ + (void) bindtextdomain (PACKAGE, LOCALEDIR); + + /* Initialize the message catalog. */ + (void) textdomain (PACKAGE); + + /* Parse and process arguments. */ + (void) argp_parse (&argp, argc, argv, 0, &remaining, NULL); + + /* Tell the library which version we are expecting. */ + elf_version (EV_CURRENT); + + /* Open the file. */ + int fd = open64 (executable, O_RDONLY); + if (fd == -1) + error (1, errno, gettext ("cannot open '%s'"), executable); + + /* Create the ELF descriptor. */ + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); + if (elf == NULL) + { + close (fd); + error (1, 0, gettext ("cannot create ELF descriptor: %s"), + elf_errmsg (-1)); + } + + /* Try to get a DWARF descriptor. If it fails, we try to locate the + debuginfo file. */ + Dwarf *dw = dwarf_begin_elf (elf, DWARF_C_READ, NULL); + int fd2 = -1; + Elf *elf2 = NULL; + if (dw == NULL) + { + char *canon = canonicalize_file_name (executable); + GElf_Ehdr ehdr_mem; + GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); + + if (canon != NULL && ehdr != NULL) + { + const char *debuginfo_dir; + if (ehdr->e_ident[EI_CLASS] == ELFCLASS32 + || ehdr->e_machine == EM_IA_64 || ehdr->e_machine == EM_ALPHA) + debuginfo_dir = "/usr/lib/debug"; + else + debuginfo_dir = "/usr/lib64/debug"; + + char *difname = alloca (strlen (debuginfo_dir) + strlen (canon) + 1); + strcpy (stpcpy (difname, debuginfo_dir), canon); + fd2 = open64 (difname, O_RDONLY); + if (fd2 != -1) + dw = dwarf_begin_elf (elf2, DWARF_C_READ, NULL); + } + + free (canon); + } + + /* Now handle the addresses. In case none are given on the command + line, read from stdin. */ + if (remaining == argc) + { + /* We use no threads here which can interfere with handling a stream. */ + (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER); + + char *buf = NULL; + size_t len = 0; + while (!feof_unlocked (stdin)) + { + if (getline (&buf, &len, stdin) < 0) + break; + + char *endp; + uintmax_t addr = strtoumax (buf, &endp, 0); + if (endp != buf) + handle_address (addr, elf2 ?: elf, dw); + else + result = 1; + } + + free (buf); + } + else + { + do + { + char *endp; + uintmax_t addr = strtoumax (argv[remaining], &endp, 0); + if (endp != argv[remaining]) + handle_address (addr, elf2 ?: elf, dw); + else + result = 1; + } + while (++remaining < argc); + } + + return result; +} + + +/* Print the version information. */ +static void +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) +{ + fprintf (stream, "addr2line (%s) %s\n", PACKAGE_NAME, VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s Red Hat, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2005"); + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); +} + + +/* Handle program arguments. */ +static error_t +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) +{ + switch (key) + { + case 'b': + case 'C': + case OPT_DEMANGLER: + /* Ignored for compatibility. */ + break; + + case 'e': + executable = arg; + break; + + case 's': + only_basenames = true; + break; + + case 'f': + show_functions = true; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + + +struct func_arg +{ + GElf_Addr addr; + const char *name; +}; + + +static int +match_func (Dwarf_Func *func, void *arg) +{ + struct func_arg *func_arg = (struct func_arg *) arg; + Dwarf_Addr addr; + + if (dwarf_func_lowpc (func, &addr) == 0 && addr <= func_arg->addr + && dwarf_func_highpc (func, &addr) == 0 && func_arg->addr < addr) + { + func_arg->name = dwarf_func_name (func); + return DWARF_CB_ABORT; + } + + return DWARF_CB_OK; +} + + +static const char * +elf_getname (GElf_Addr addr, Elf *elf) +{ + /* The DWARF information is not available. Use the ELF + symbol table. */ + Elf_Scn *scn = NULL; + Elf_Scn *dynscn = NULL; + + while ((scn = elf_nextscn (elf, scn)) != NULL) + { + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + if (shdr != NULL) + { + if (shdr->sh_type == SHT_SYMTAB) + break; + if (shdr->sh_type == SHT_DYNSYM) + dynscn = scn; + } + } + if (scn == NULL) + scn = dynscn; + + if (scn != NULL) + { + /* Look through the symbol table for a matching symbol. */ + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + assert (shdr != NULL); + + Elf_Data *data = elf_getdata (scn, NULL); + if (data != NULL) + for (int cnt = 1; cnt < (int) (shdr->sh_size / shdr->sh_entsize); + ++cnt) + { + GElf_Sym sym_mem; + GElf_Sym *sym = gelf_getsym (data, cnt, &sym_mem); + if (sym != NULL + && sym->st_value <= addr + && addr < sym->st_value + sym->st_size) + return elf_strptr (elf, shdr->sh_link, sym->st_name); + } + } + + return NULL; +} + + +static void +handle_address (GElf_Addr addr, Elf *elf, Dwarf *dw) +{ + Dwarf_Die die_mem; + Dwarf_Die *die = dwarf_addrdie (dw, addr, &die_mem); + + if (show_functions) + { + /* First determine the function name. Use the DWARF information if + possible. */ + struct func_arg arg; + arg.addr = addr; + arg.name = NULL; + + if (dwarf_getfuncs (die, match_func, &arg, 0) <= 0) + arg.name = elf_getname (addr, elf); + + puts (arg.name ?: "??"); + } + + + Dwarf_Line *line; + const char *src; + if ((line = dwarf_getsrc_die (die, addr)) != NULL + && (src = dwarf_linesrc (line, NULL, NULL)) != NULL) + { + if (only_basenames) + src = basename (src); + + int lineno; + if (dwarf_lineno (line, &lineno) != -1) + { + int linecol; + if (dwarf_linecol (line, &linecol) != -1 && linecol != 0) + printf ("%s:%d:%d\n", src, lineno, linecol); + else + printf ("%s:%d\n", src, lineno); + } + else + printf ("%s:0\n", src); + } + else + puts ("??:0"); +} diff --git a/elfutils/src/elflint.c b/elfutils/src/elflint.c index d66cdd13..31043335 100644 --- a/elfutils/src/elflint.c +++ b/elfutils/src/elflint.c @@ -1,5 +1,5 @@ /* Pedantic checking of ELF files compliance with gABI/psABI spec. - Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -41,6 +41,8 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; #define ARGP_strict 300 #define ARGP_gnuld 301 @@ -50,12 +52,13 @@ static const struct argp_option options[] = { { "strict", ARGP_strict, NULL, 0, - N_("Be extremely strict, flag level 2 features.") }, - { "quiet", 'q', NULL, 0, N_("Do not print anything if successful") }, + N_("Be extremely strict, flag level 2 features."), 0 }, + { "quiet", 'q', NULL, 0, N_("Do not print anything if successful"), 0 }, + { "debuginfo", 'd', NULL, 0, N_("Binary is a separate debuginfo file"), 0 }, { "gnu-ld", ARGP_gnuld, NULL, 0, N_("Binary has been created with GNU ld and is therefore known to be \ -broken in certain ways") }, - { NULL, 0, NULL, 0, NULL } +broken in certain ways"), 0 }, + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -68,13 +71,10 @@ static const char args_doc[] = N_("FILE..."); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc, NULL, more_help + options, parse_opt, args_doc, doc, NULL, NULL, NULL }; @@ -91,7 +91,7 @@ static void process_elf_file (Elf *elf, const char *prefix, const char *suffix, printf (str, ##args); \ ++error_count; \ } while (0) -static int error_count; +static unsigned int error_count; /* True if we should perform very strict testing. */ static bool be_strict; @@ -99,6 +99,9 @@ static bool be_strict; /* True if no message is to be printed if the run is succesful. */ static bool be_quiet; +/* True if binary is from strip -f, not a normal ELF file. */ +static bool is_debuginfo; + /* True if binary is assumed to be generated with GNU ld. */ static bool gnuld; @@ -112,9 +115,6 @@ static int *scnref; int main (int argc, char *argv[]) { - int remaining; - bool only_one; - /* Set locale. */ setlocale (LC_ALL, ""); @@ -122,28 +122,18 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* Parse and process arguments. */ + int remaining; argp_parse (&argp, argc, argv, 0, &remaining, NULL); - /* If no ELF file is given punt. */ - if (remaining >= argc) - { - argp_help (&argp, stdout, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, - program_invocation_short_name); - exit (1); - } - /* Before we start tell the ELF library which version we are using. */ elf_version (EV_CURRENT); /* Now process all the files given at the command line. */ - only_one = remaining + 1 == argc; + bool only_one = remaining + 1 == argc; do { - int fd; - Elf *elf; - /* Open the file. */ - fd = open (argv[remaining], O_RDONLY); + int fd = open (argv[remaining], O_RDONLY); if (fd == -1) { error (0, errno, gettext ("cannot open input file")); @@ -151,7 +141,7 @@ main (int argc, char *argv[]) } /* Create an `Elf' descriptor. */ - elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); if (elf == NULL) ERROR (gettext ("cannot generate Elf descriptor: %s\n"), elf_errmsg (-1)); @@ -189,7 +179,8 @@ main (int argc, char *argv[]) /* Handle program arguments. */ static error_t -parse_opt (int key, char *arg, struct argp_state *state) +parse_opt (int key, char *arg __attribute__ ((unused)), + struct argp_state *state __attribute__ ((unused))) { switch (key) { @@ -201,10 +192,19 @@ parse_opt (int key, char *arg, struct argp_state *state) be_quiet = true; break; + case 'd': + is_debuginfo = true; + case ARGP_gnuld: gnuld = true; break; + case ARGP_KEY_NO_ARGS: + fputs (gettext ("Missing file name.\n"), stderr); + argp_help (&argp, stderr, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, + program_invocation_short_name); + exit (1); + default: return ARGP_ERR_UNKNOWN; } @@ -212,37 +212,16 @@ parse_opt (int key, char *arg, struct argp_state *state) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "elflint (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } @@ -317,7 +296,7 @@ Not an ELF file - it has the wrong magic bytes at the start")); static const char * -section_name (Ebl *ebl, GElf_Ehdr *ehdr, int idx) +section_name (Ebl *ebl, int idx) { GElf_Shdr shdr_mem; GElf_Shdr *shdr; @@ -522,7 +501,7 @@ invalid number of section header table entries\n")); /* Check that there is a section group section with index < IDX which contains section IDX and that there is exactly one. */ static void -check_scn_group (Ebl *ebl, GElf_Ehdr *ehdr, int idx) +check_scn_group (Ebl *ebl, int idx) { if (scnref[idx] == 0) { @@ -565,12 +544,12 @@ check_scn_group (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (cnt == shnum) ERROR (gettext ("\ section [%2d] '%s': section with SHF_GROUP flag set not part of a section group\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else ERROR (gettext ("\ section [%2d] '%s': section group [%2zu] '%s' does not preceed group member\n"), - idx, section_name (ebl, ehdr, idx), - cnt, section_name (ebl, ehdr, cnt)); + idx, section_name (ebl, idx), + cnt, section_name (ebl, cnt)); } } @@ -593,14 +572,14 @@ check_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (data == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get section data\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } if (strshdr->sh_type != SHT_STRTAB) ERROR (gettext ("section [%2d] '%s': referenced as string table for section [%2d] '%s' but type is not SHT_STRTAB\n"), - shdr->sh_link, section_name (ebl, ehdr, shdr->sh_link), - idx, section_name (ebl, ehdr, idx)); + shdr->sh_link, section_name (ebl, shdr->sh_link), + idx, section_name (ebl, idx)); /* Search for an extended section index table section. */ size_t cnt; @@ -632,7 +611,7 @@ check_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT)) ERROR (gettext ("\ section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); /* Test the zeroth entry. */ GElf_Sym sym_mem; @@ -640,31 +619,31 @@ section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"), GElf_Sym *sym = gelf_getsymshndx (data, xndxdata, 0, &sym_mem, &xndx); if (sym == NULL) ERROR (gettext ("section [%2d] '%s': cannot get symbol %d: %s\n"), - idx, section_name (ebl, ehdr, idx), 0, elf_errmsg (-1)); + idx, section_name (ebl, idx), 0, elf_errmsg (-1)); else { if (sym->st_name != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_name"); + idx, section_name (ebl, idx), "st_name"); if (sym->st_value != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_value"); + idx, section_name (ebl, idx), "st_value"); if (sym->st_size != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_size"); + idx, section_name (ebl, idx), "st_size"); if (sym->st_info != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_info"); + idx, section_name (ebl, idx), "st_info"); if (sym->st_other != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_other"); + idx, section_name (ebl, idx), "st_other"); if (sym->st_shndx != 0) ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"), - idx, section_name (ebl, ehdr, idx), "st_shndx"); + idx, section_name (ebl, idx), "st_shndx"); if (xndxdata != NULL && xndx != 0) ERROR (gettext ("\ section [%2d] '%s': XINDEX for zeroth entry not zero\n"), - xndxscnidx, section_name (ebl, ehdr, xndxscnidx)); + xndxscnidx, section_name (ebl, xndxscnidx)); } for (cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) @@ -673,7 +652,7 @@ section [%2d] '%s': XINDEX for zeroth entry not zero\n"), if (sym == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get symbol %zu: %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, elf_errmsg (-1)); + idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); continue; } @@ -681,7 +660,7 @@ section [%2d] '%s': XINDEX for zeroth entry not zero\n"), if (sym->st_name >= strshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: invalid name value\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); else { name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name); @@ -694,13 +673,13 @@ section [%2d] '%s': symbol %zu: invalid name value\n"), { ERROR (gettext ("\ section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); no_xndx_warned = true; } else if (xndx < SHN_LORESERVE) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in st_shndx (%" PRIu32 ")\n"), - xndxscnidx, section_name (ebl, ehdr, xndxscnidx), cnt, + xndxscnidx, section_name (ebl, xndxscnidx), cnt, xndx); } else if ((sym->st_shndx >= SHN_LORESERVE @@ -712,18 +691,18 @@ section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in st_shnd /* || sym->st_shndx > SHN_HIRESERVE always false */))) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: invalid section index\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); else xndx = sym->st_shndx; if (GELF_ST_TYPE (sym->st_info) >= STT_NUM) ERROR (gettext ("section [%2d] '%s': symbol %zu: unknown type\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (GELF_ST_BIND (sym->st_info) >= STB_NUM) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: unknown symbol binding\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (xndx == SHN_COMMON) { @@ -731,15 +710,15 @@ section [%2d] '%s': symbol %zu: unknown symbol binding\n"), if (ehdr->e_type != ET_REL) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (cnt < shdr->sh_info) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (GELF_R_TYPE (sym->st_info) == STT_FUNC) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } else if (xndx > 0 && xndx < shnum) { @@ -754,21 +733,21 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"), if ((sym->st_value - destshdr->sh_addr) > destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value out of bounds\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); else if ((sym->st_value - destshdr->sh_addr + sym->st_size) > destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); } else { if ((destshdr->sh_flags & SHF_TLS) == 0) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have SHF_TLS flag set\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); if (ehdr->e_type == ET_REL) { @@ -777,14 +756,14 @@ section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have SHF_ if (sym->st_value > destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); else if (sym->st_value + sym->st_size > destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); } else { @@ -804,7 +783,7 @@ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2 if (no_pt_tls++ == 0) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } else { @@ -812,22 +791,22 @@ section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"), < destshdr->sh_offset - phdr->p_offset) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); else if (sym->st_value > (destshdr->sh_offset - phdr->p_offset + destshdr->sh_size)) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); else if (sym->st_value + sym->st_size > (destshdr->sh_offset - phdr->p_offset + destshdr->sh_size)) ERROR (gettext ("\ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), cnt, - (int) xndx, section_name (ebl, ehdr, xndx)); + idx, section_name (ebl, idx), cnt, + (int) xndx, section_name (ebl, xndx)); } } } @@ -839,21 +818,21 @@ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2 if (cnt >= shdr->sh_info) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: local symbol outside range described in sh_info\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } else { if (cnt < shdr->sh_info) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: non-local symbol outside range described in sh_info\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } if (GELF_ST_TYPE (sym->st_info) == STT_SECTION && GELF_ST_BIND (sym->st_info) != STB_LOCAL) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: non-local section symbol\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (name != NULL) { @@ -863,6 +842,9 @@ section [%2d] '%s': symbol %zu: non-local section symbol\n"), table. We have to locate the GOT by searching for a section named ".got". */ Elf_Scn *gscn = NULL; + GElf_Addr addr = 0; + GElf_Xword size = 0; + bool found = false; while ((gscn = elf_nextscn (ebl->elf, gscn)) != NULL) { @@ -872,35 +854,48 @@ section [%2d] '%s': symbol %zu: non-local section symbol\n"), const char *sname = elf_strptr (ebl->elf, ehdr->e_shstrndx, gshdr->sh_name); - if (sname != NULL && strcmp (sname, ".got") == 0) + if (sname != NULL) { - /* Found it. */ - if (sym->st_value != gshdr->sh_addr) - /* This test is more strict than the psABIs - which usually allow the symbol to be in the - middle of the .got section, allowing - negative offsets. */ - ERROR (gettext ("\ + if (strcmp (sname, ".got.plt") == 0) + { + addr = gshdr->sh_addr; + size = gshdr->sh_size; + found = true; + break; + } + if (strcmp (sname, ".got") == 0) + { + addr = gshdr->sh_addr; + size = gshdr->sh_size; + found = true; + /* Do not stop looking. There might be a + .got.plt section. */ + } + } + } + + if (found) + { + /* Found it. */ + if (sym->st_value != addr) + /* This test is more strict than the psABIs which + usually allow the symbol to be in the middle of + the .got section, allowing negative offsets. */ + ERROR (gettext ("\ section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#" PRIx64 " does not match .got section address %#" PRIx64 "\n"), - idx, section_name (ebl, ehdr, idx), - (uint64_t) sym->st_value, - (uint64_t) gshdr->sh_addr); + idx, section_name (ebl, idx), + (uint64_t) sym->st_value, (uint64_t) addr); - if (sym->st_size != gshdr->sh_size) - ERROR (gettext ("\ + if (!gnuld && sym->st_size != size) + ERROR (gettext ("\ section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %" PRIu64 " does not match .got section size %" PRIu64 "\n"), - idx, section_name (ebl, ehdr, idx), - (uint64_t) sym->st_size, - (uint64_t) gshdr->sh_size); - - break; - } + idx, section_name (ebl, idx), + (uint64_t) sym->st_size, (uint64_t) size); } - - if (gscn == NULL) + else ERROR (gettext ("\ section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got section\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } else if (strcmp (name, "_DYNAMIC") == 0) { @@ -919,14 +914,14 @@ section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got section\n" if (sym->st_value != phdr->p_vaddr) ERROR (gettext ("\ section [%2d] '%s': _DYNAMIC_ symbol value %#" PRIx64 " does not match dynamic segment address %#" PRIx64 "\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), (uint64_t) sym->st_value, (uint64_t) phdr->p_vaddr); - if (sym->st_size != phdr->p_memsz) + if (!gnuld && sym->st_size != phdr->p_memsz) ERROR (gettext ("\ section [%2d] '%s': _DYNAMIC symbol size %" PRIu64 " does not match dynamic segment size %" PRIu64 "\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), (uint64_t) sym->st_size, (uint64_t) phdr->p_memsz); @@ -947,7 +942,7 @@ is_rel_dyn (Ebl *ebl, GElf_Ehdr *ehdr, int idx, GElf_Shdr *shdr, bool rela) return false; /* Check the section name. Unfortunately necessary. */ - if (strcmp (section_name (ebl, ehdr, idx), rela ? ".rela.dyn" : ".rel.dyn")) + if (strcmp (section_name (ebl, idx), rela ? ".rela.dyn" : ".rel.dyn")) return false; /* When a .rel.dyn section is used a DT_RELCOUNT dynamic section @@ -963,7 +958,7 @@ is_rel_dyn (Ebl *ebl, GElf_Ehdr *ehdr, int idx, GElf_Shdr *shdr, bool rela) { /* Found the dynamic section. Look through it. */ Elf_Data *d = elf_getdata (scn, NULL); - int cnt; + size_t cnt; for (cnt = 1; cnt < rcshdr->sh_size / rcshdr->sh_entsize; ++cnt) { @@ -979,7 +974,7 @@ is_rel_dyn (Ebl *ebl, GElf_Ehdr *ehdr, int idx, GElf_Shdr *shdr, bool rela) if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize) ERROR (gettext ("\ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), (int) dyn->d_un.d_val); } } @@ -1013,14 +1008,14 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (data == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get section data\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } /* Check whether the link to the section we relocate is reasonable. */ if (shdr->sh_info >= shnum) ERROR (gettext ("section [%2d] '%s': invalid destination section index\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else { destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info), @@ -1034,7 +1029,7 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (!reldyn) ERROR (gettext ("\ section [%2d] '%s': invalid destination section type\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else { /* There is no standard, but we require that .rela.dyn @@ -1042,21 +1037,21 @@ section [%2d] '%s': invalid destination section type\n"), if (shdr->sh_info != 0) ERROR (gettext ("\ section [%2d] '%s': sh_info should be zero\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } } if ((destshdr->sh_flags & (SHF_MERGE | SHF_STRINGS)) != 0) ERROR (gettext ("\ section [%2d] '%s': no relocations for merge-able sections possible\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } } if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT)) ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Rela\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link); GElf_Shdr symshdr_mem; @@ -1073,17 +1068,17 @@ section [%2d] '%s': section entry size does not match ElfXX_Rela\n"), { ERROR (gettext ("\ section [%2d] '%s': cannot get relocation %zu: %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, elf_errmsg (-1)); + idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); continue; } if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (rela->r_info))) ERROR (gettext ("section [%2d] '%s': relocation %zu: invalid type\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); else if (!ebl_reloc_valid_use (ebl, GELF_R_TYPE (rela->r_info))) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: relocation type invalid for the file type\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (symshdr != NULL && ((GELF_R_SYM (rela->r_info) + 1) @@ -1091,7 +1086,7 @@ section [%2d] '%s': relocation %zu: relocation type invalid for the file type\n" > symshdr->sh_size)) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: invalid symbol index\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (ebl_gotpc_reloc_check (ebl, GELF_R_TYPE (rela->r_info))) { @@ -1106,7 +1101,7 @@ section [%2d] '%s': relocation %zu: invalid symbol index\n"), && strcmp (name, "_GLOBAL_OFFSET_TABLE_") !=0 ) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be used with %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, + idx, section_name (ebl, idx), cnt, ebl_reloc_type_name (ebl, GELF_R_SYM (rela->r_info), buf, sizeof (buf))); } @@ -1121,7 +1116,7 @@ section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be u && (rela->r_offset - destshdr->sh_addr) >= destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: offset out of bounds\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } } } @@ -1148,14 +1143,14 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (data == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get section data\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } /* Check whether the link to the section we relocate is reasonable. */ if (shdr->sh_info >= shnum) ERROR (gettext ("section [%2d] '%s': invalid destination section index\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else { destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info), @@ -1169,7 +1164,7 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (!reldyn) ERROR (gettext ("\ section [%2d] '%s': invalid destination section type\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else { /* There is no standard, but we require that .rela.dyn @@ -1177,21 +1172,21 @@ section [%2d] '%s': invalid destination section type\n"), if (shdr->sh_info != 0) ERROR (gettext ("\ section [%2d] '%s': sh_info should be zero\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } } if ((destshdr->sh_flags & (SHF_MERGE | SHF_STRINGS)) != 0) ERROR (gettext ("\ section [%2d] '%s': no relocations for merge-able sections possible\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } } if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT)) ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link); GElf_Shdr symshdr_mem; @@ -1208,17 +1203,17 @@ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"), { ERROR (gettext ("\ section [%2d] '%s': cannot get relocation %zu: %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, elf_errmsg (-1)); + idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); continue; } if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))) ERROR (gettext ("section [%2d] '%s': relocation %zu: invalid type\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); else if (!ebl_reloc_valid_use (ebl, GELF_R_TYPE (rel->r_info))) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: relocation type invalid for the file type\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (symshdr != NULL && ((GELF_R_SYM (rel->r_info) + 1) @@ -1226,7 +1221,7 @@ section [%2d] '%s': relocation %zu: relocation type invalid for the file type\n" > symshdr->sh_size)) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: invalid symbol index\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (ebl_gotpc_reloc_check (ebl, GELF_R_TYPE (rel->r_info))) { @@ -1241,7 +1236,7 @@ section [%2d] '%s': relocation %zu: invalid symbol index\n"), && strcmp (name, "_GLOBAL_OFFSET_TABLE_") !=0 ) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be used with %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, + idx, section_name (ebl, idx), cnt, ebl_reloc_type_name (ebl, GELF_R_SYM (rel->r_info), buf, sizeof (buf))); } @@ -1257,7 +1252,7 @@ section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be u && (rel->r_offset - destshdr->sh_addr) >= destshdr->sh_size) ERROR (gettext ("\ section [%2d] '%s': relocation %zu: offset out of bounds\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); } } } @@ -1268,7 +1263,7 @@ static int ndynamic; static void -check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, int idx) +check_dynamic (Ebl *ebl, int idx) { Elf_Scn *scn; GElf_Shdr shdr_mem; @@ -1335,7 +1330,7 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (data == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get section data\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } @@ -1343,17 +1338,17 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (strshdr != NULL && strshdr->sh_type != SHT_STRTAB) ERROR (gettext ("\ section [%2d] '%s': referenced as string table for section [%2d] '%s' but type is not SHT_STRTAB\n"), - shdr->sh_link, section_name (ebl, ehdr, shdr->sh_link), - idx, section_name (ebl, ehdr, idx)); + shdr->sh_link, section_name (ebl, shdr->sh_link), + idx, section_name (ebl, idx)); if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT)) ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_info != 0) ERROR (gettext ("section [%2d] '%s': sh_info not zero\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); bool non_null_warned = false; for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) @@ -1366,7 +1361,7 @@ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), { ERROR (gettext ("\ section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, elf_errmsg (-1)); + idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); continue; } @@ -1374,13 +1369,13 @@ section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"), { ERROR (gettext ("\ section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); non_null_warned = true; } if (!ebl_dynamic_tag_check (ebl, dyn->d_tag)) ERROR (gettext ("section [%2d] '%s': entry %zu: unknown tag\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (dyn->d_tag < DT_NUM) { @@ -1392,7 +1387,7 @@ section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"), char buf[50]; ERROR (gettext ("\ section [%2d] '%s': entry %zu: more than one entry with tag %s\n"), - idx, section_name (ebl, ehdr, idx), cnt, + idx, section_name (ebl, idx), cnt, ebl_dynamic_tag_name (ebl, dyn->d_tag, buf, sizeof (buf))); } @@ -1402,7 +1397,7 @@ section [%2d] '%s': entry %zu: more than one entry with tag %s\n"), char buf[50]; ERROR (gettext ("\ section [%2d] '%s': entry %zu: level 2 tag %s used\n"), - idx, section_name (ebl, ehdr, idx), cnt, + idx, section_name (ebl, idx), cnt, ebl_dynamic_tag_name (ebl, dyn->d_tag, buf, sizeof (buf))); } @@ -1414,7 +1409,7 @@ section [%2d] '%s': entry %zu: level 2 tag %s used\n"), && dyn->d_un.d_val != DT_RELA) ERROR (gettext ("\ section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"), - idx, section_name (ebl, ehdr, idx), cnt); + idx, section_name (ebl, idx), cnt); if (dyn->d_tag == DT_REL) reladdr = dyn->d_un.d_ptr; @@ -1439,7 +1434,7 @@ section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"), ERROR (gettext ("\ section [%2d] '%s': contains %s entry but not %s\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), ebl_dynamic_tag_name (ebl, cnt, buf1, sizeof (buf1)), ebl_dynamic_tag_name (ebl, inner, buf2, sizeof (buf2))); } @@ -1451,7 +1446,7 @@ section [%2d] '%s': contains %s entry but not %s\n"), char buf[50]; ERROR (gettext ("\ section [%2d] '%s': mandatory tag %s not present\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), ebl_dynamic_tag_name (ebl, cnt, buf, sizeof (buf))); } } @@ -1461,20 +1456,20 @@ section [%2d] '%s': mandatory tag %s not present\n"), && (!has_dt[DT_RELA] || !has_dt[DT_RELASZ] || !has_dt[DT_RELAENT])) ERROR (gettext ("\ section [%2d] '%s': not all of %s, %s, and %s are present\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), "DT_RELA", "DT_RELASZ", "DT_RELAENT"); if ((has_dt[DT_REL] || has_dt[DT_RELSZ] || has_dt[DT_RELENT]) && (!has_dt[DT_REL] || !has_dt[DT_RELSZ] || !has_dt[DT_RELENT])) ERROR (gettext ("\ section [%2d] '%s': not all of %s, %s, and %s are present\n"), - idx, section_name (ebl, ehdr, idx), + idx, section_name (ebl, idx), "DT_REL", "DT_RELSZ", "DT_RELENT"); } static void -check_symtab_shndx (Ebl *ebl, GElf_Ehdr *ehdr, int idx) +check_symtab_shndx (Ebl *ebl, int idx) { Elf_Scn *scn; GElf_Shdr shdr_mem; @@ -1496,7 +1491,7 @@ check_symtab_shndx (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (symshdr != NULL && symshdr->sh_type != SHT_SYMTAB) ERROR (gettext ("\ section [%2d] '%s': extended section index section not for symbol table\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); symdata = elf_getdata (symscn, NULL); if (symdata == NULL) ERROR (gettext ("cannot get data for symbol section\n")); @@ -1504,18 +1499,18 @@ section [%2d] '%s': extended section index section not for symbol table\n"), if (shdr->sh_entsize != sizeof (Elf32_Word)) ERROR (gettext ("\ section [%2d] '%s': entry size does not match Elf32_Word\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (symshdr != NULL && (shdr->sh_size / shdr->sh_entsize < symshdr->sh_size / symshdr->sh_entsize)) ERROR (gettext ("\ section [%2d] '%s': extended index table too small for symbol table\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_info != 0) ERROR (gettext ("section [%2d] '%s': sh_info not zero\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); for (cnt = idx + 1; cnt < shnum; ++cnt) { @@ -1528,8 +1523,8 @@ section [%2d] '%s': extended index table too small for symbol table\n"), { ERROR (gettext ("\ section [%2d] '%s': extended section index in section [%2zu] '%s' refers to same symbol table\n"), - idx, section_name (ebl, ehdr, idx), - cnt, section_name (ebl, ehdr, cnt)); + idx, section_name (ebl, idx), + cnt, section_name (ebl, cnt)); break; } } @@ -1563,7 +1558,7 @@ extended section index is %" PRIu32 " but symbol index is not XINDEX\n"), static void -check_hash (Ebl *ebl, GElf_Ehdr *ehdr, int idx) +check_hash (Ebl *ebl, int idx) { Elf_Scn *scn; GElf_Shdr shdr_mem; @@ -1582,7 +1577,7 @@ check_hash (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (data == NULL) { ERROR (gettext ("section [%2d] '%s': cannot get section data\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } @@ -1590,22 +1585,22 @@ check_hash (Ebl *ebl, GElf_Ehdr *ehdr, int idx) if (symshdr != NULL && symshdr->sh_type != SHT_DYNSYM) ERROR (gettext ("\ section [%2d] '%s': hash table not for dynamic symbol table\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_entsize != sizeof (Elf32_Word)) ERROR (gettext ("\ section [%2d] '%s': entry size does not match Elf32_Word\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if ((shdr->sh_flags & SHF_ALLOC) == 0) ERROR (gettext ("section [%2d] '%s': not marked to be allocated\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_size < 2 * shdr->sh_entsize) { ERROR (gettext ("\ section [%2d] '%s': hash table has not even room for nbucket and nchain\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } @@ -1615,7 +1610,7 @@ section [%2d] '%s': hash table has not even room for nbucket and nchain\n"), if (shdr->sh_size < (2 + nbucket + nchain) * shdr->sh_entsize) ERROR (gettext ("\ section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"), - idx, section_name (ebl, ehdr, idx), (long int) shdr->sh_size, + idx, section_name (ebl, idx), (long int) shdr->sh_size, (long int) ((2 + nbucket + nchain) * shdr->sh_entsize)); if (symshdr != NULL) @@ -1625,30 +1620,30 @@ section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"), if (nchain < symshdr->sh_size / symshdr->sh_entsize) ERROR (gettext ("section [%2d] '%s': chain array not large enough\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); for (cnt = 2; cnt < 2 + nbucket; ++cnt) if (((Elf32_Word *) data->d_buf)[cnt] >= symsize) ERROR (gettext ("\ section [%2d] '%s': hash bucket reference %zu out of bounds\n"), - idx, section_name (ebl, ehdr, idx), cnt - 2); + idx, section_name (ebl, idx), cnt - 2); for (; cnt < 2 + nbucket + nchain; ++cnt) if (((Elf32_Word *) data->d_buf)[cnt] >= symsize) ERROR (gettext ("\ section [%2d] '%s': hash chain reference %zu out of bounds\n"), - idx, section_name (ebl, ehdr, idx), cnt - 2 - nbucket); + idx, section_name (ebl, idx), cnt - 2 - nbucket); } } static void -check_null (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) +check_null (Ebl *ebl, GElf_Shdr *shdr, int idx) { #define TEST(name, extra) \ if (extra && shdr->sh_##name != 0) \ ERROR (gettext ("section [%2d] '%s': nonzero sh_%s for NULL section\n"), \ - idx, section_name (ebl, ehdr, idx), #name) + idx, section_name (ebl, idx), #name) TEST (name, 1); TEST (flags, 1); @@ -1669,7 +1664,7 @@ check_group (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) { ERROR (gettext ("\ section [%2d] '%s': section groups only allowed in relocatable object files\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); return; } @@ -1679,34 +1674,34 @@ section [%2d] '%s': section groups only allowed in relocatable object files\n"), &symshdr_mem); if (symshdr == NULL) ERROR (gettext ("section [%2d] '%s': cannot get symbol table: %s\n"), - idx, section_name (ebl, ehdr, idx), elf_errmsg (-1)); + idx, section_name (ebl, idx), elf_errmsg (-1)); else { if (symshdr->sh_type != SHT_SYMTAB) ERROR (gettext ("\ section [%2d] '%s': section reference in sh_link is no symbol table\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_info >= symshdr->sh_size / gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT)) ERROR (gettext ("\ section [%2d] '%s': invalid symbol index in sh_info\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (shdr->sh_flags != 0) ERROR (gettext ("section [%2d] '%s': sh_flags not zero\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (be_strict && shdr->sh_entsize != elf32_fsize (ELF_T_WORD, 1, EV_CURRENT)) ERROR (gettext ("section [%2d] '%s': sh_flags not set correctly\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL); if (data == NULL) ERROR (gettext ("section [%2d] '%s': cannot get data: %s\n"), - idx, section_name (ebl, ehdr, idx), elf_errmsg (-1)); + idx, section_name (ebl, idx), elf_errmsg (-1)); else { size_t elsize = elf32_fsize (ELF_T_WORD, 1, EV_CURRENT); @@ -1716,22 +1711,22 @@ section [%2d] '%s': invalid symbol index in sh_info\n"), if (data->d_size % elsize != 0) ERROR (gettext ("\ section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); if (data->d_size < elsize) ERROR (gettext ("\ section [%2d] '%s': section group without flags word\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else if (be_strict) { if (data->d_size < 2 * elsize) ERROR (gettext ("\ section [%2d] '%s': section group without member\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); else if (data->d_size < 3 * elsize) ERROR (gettext ("\ section [%2d] '%s': section group with only one member\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); } #if ALLOW_UNALIGNED @@ -1741,7 +1736,7 @@ section [%2d] '%s': section group with only one member\n"), #endif if ((val & ~GRP_COMDAT) != 0) ERROR (gettext ("section [%2d] '%s': unknown section group flags\n"), - idx, section_name (ebl, ehdr, idx)); + idx, section_name (ebl, idx)); for (cnt = elsize; cnt < data->d_size; cnt += elsize) { @@ -1754,7 +1749,7 @@ section [%2d] '%s': section group with only one member\n"), if (val > shnum) ERROR (gettext ("\ section [%2d] '%s': section index %Zu out of range\n"), - idx, section_name (ebl, ehdr, idx), cnt / elsize); + idx, section_name (ebl, idx), cnt / elsize); else { GElf_Shdr refshdr_mem; @@ -1765,27 +1760,27 @@ section [%2d] '%s': section index %Zu out of range\n"), if (refshdr == NULL) ERROR (gettext ("\ section [%2d] '%s': cannot get section header for element %zu: %s\n"), - idx, section_name (ebl, ehdr, idx), cnt / elsize, + idx, section_name (ebl, idx), cnt / elsize, elf_errmsg (-1)); else { if (refshdr->sh_type == SHT_GROUP) ERROR (gettext ("\ section [%2d] '%s': section group contains another group [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), - val, section_name (ebl, ehdr, val)); + idx, section_name (ebl, idx), + val, section_name (ebl, val)); if ((refshdr->sh_flags & SHF_GROUP) == 0) ERROR (gettext ("\ section [%2d] '%s': element %Zu references section [%2d] '%s' without SHF_GROUP flag set\n"), - idx, section_name (ebl, ehdr, idx), cnt / elsize, - val, section_name (ebl, ehdr, val)); + idx, section_name (ebl, idx), cnt / elsize, + val, section_name (ebl, val)); } if (++scnref[val] == 2) ERROR (gettext ("\ section [%2d] '%s' is contained in more than one section group\n"), - val, section_name (ebl, ehdr, val)); + val, section_name (ebl, val)); } } } @@ -1895,7 +1890,7 @@ section_flags_string (GElf_Word flags, char *buf, size_t len) static void -check_versym (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) +check_versym (Ebl *ebl, GElf_Shdr *shdr, int idx) { /* The number of elements in the version symbol table must be the same as the number of symbols. */ @@ -1910,8 +1905,8 @@ check_versym (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) { ERROR (gettext ("\ section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no dynamic symbol table\n"), - idx, section_name (ebl, ehdr, idx), - shdr->sh_link, section_name (ebl, ehdr, shdr->sh_link)); + idx, section_name (ebl, idx), + shdr->sh_link, section_name (ebl, shdr->sh_link)); return; } @@ -1919,8 +1914,8 @@ section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no dynamic s != symshdr->sh_size / symshdr->sh_entsize) ERROR (gettext ("\ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"), - idx, section_name (ebl, ehdr, idx), - shdr->sh_link, section_name (ebl, ehdr, shdr->sh_link)); + idx, section_name (ebl, idx), + shdr->sh_link, section_name (ebl, shdr->sh_link)); // XXX TODO A lot more tests // check value of the fields. local symbols must have zero entries. @@ -1988,7 +1983,7 @@ zeroth section has nonzero link value while ELF header does not signal overflow { ERROR (gettext ("\ cannot get section header for section [%2zu] '%s': %s\n"), - cnt, section_name (ebl, ehdr, cnt), elf_errmsg (-1)); + cnt, section_name (ebl, cnt), elf_errmsg (-1)); continue; } @@ -2009,7 +2004,8 @@ cannot get section header for section [%2zu] '%s': %s\n"), char stbuf2[100]; char stbuf3[100]; - if (shdr->sh_type != special_sections[s].type) + if (shdr->sh_type != special_sections[s].type + && !(is_debuginfo && shdr->sh_type == SHT_NOBITS)) ERROR (gettext ("\ section [%2d] '%s' has wrong type: expected %s, is %s\n"), (int) cnt, scnname, @@ -2115,7 +2111,7 @@ section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable segments\n if (shdr->sh_entsize != 0 && shdr->sh_size % shdr->sh_entsize) ERROR (gettext ("\ section [%2zu] '%s': size not multiple of entry size\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); if (elf_strptr (ebl->elf, shstrndx, shdr->sh_name) == NULL) ERROR (gettext ("cannot get section header\n")); @@ -2133,7 +2129,7 @@ section [%2zu] '%s': size not multiple of entry size\n"), | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS) if (shdr->sh_flags & ~ALL_SH_FLAGS) ERROR (gettext ("section [%2zu] '%s' contain unknown flag(s) %d\n"), - cnt, section_name (ebl, ehdr, cnt), + cnt, section_name (ebl, cnt), (int) shdr->sh_flags & ~ALL_SH_FLAGS); else if (shdr->sh_flags & SHF_TLS) { @@ -2141,7 +2137,7 @@ section [%2zu] '%s': size not multiple of entry size\n"), if (shdr->sh_addr != 0 && !gnuld) ERROR (gettext ("\ section [%2zu] '%s': thread-local data sections address not zero\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); // XXX TODO more tests!? } @@ -2149,27 +2145,27 @@ section [%2zu] '%s': thread-local data sections address not zero\n"), if (shdr->sh_link >= shnum) ERROR (gettext ("\ section [%2zu] '%s': invalid section reference in link value\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); if (SH_INFO_LINK_P (shdr) && shdr->sh_info >= shnum) ERROR (gettext ("\ section [%2zu] '%s': invalid section reference in info value\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); if ((shdr->sh_flags & SHF_MERGE) == 0 && (shdr->sh_flags & SHF_STRINGS) != 0 && be_strict) ERROR (gettext ("\ section [%2zu] '%s': strings flag set without merge flag\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); if ((shdr->sh_flags & SHF_MERGE) != 0 && shdr->sh_entsize == 0) ERROR (gettext ("\ section [%2zu] '%s': merge flag set but entry size is zero\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); if (shdr->sh_flags & SHF_GROUP) - check_scn_group (ebl, ehdr, cnt); + check_scn_group (ebl, cnt); if (ehdr->e_type != ET_REL && (shdr->sh_flags & SHF_ALLOC) != 0) { @@ -2193,21 +2189,22 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"), < shdr->sh_offset + shdr->sh_size) ERROR (gettext ("\ section [%2zu] '%s' not fully contained in segment of program header entry %d\n"), - cnt, section_name (ebl, ehdr, cnt), pcnt); + cnt, section_name (ebl, cnt), pcnt); if (shdr->sh_type == SHT_NOBITS) { - if (shdr->sh_offset < phdr->p_offset + phdr->p_filesz) + if (shdr->sh_offset < phdr->p_offset + phdr->p_filesz + && !is_debuginfo) ERROR (gettext ("\ section [%2zu] '%s' has type NOBITS but is read from the file in segment of program header entry %d\n"), - cnt, section_name (ebl, ehdr, cnt), pcnt); + cnt, section_name (ebl, cnt), pcnt); } else { if (shdr->sh_offset >= phdr->p_offset + phdr->p_filesz) ERROR (gettext ("\ section [%2zu] '%s' has not type NOBITS but is not read from the file in segment of program header entry %d\n"), - cnt, section_name (ebl, ehdr, cnt), pcnt); + cnt, section_name (ebl, cnt), pcnt); } break; @@ -2216,13 +2213,13 @@ section [%2zu] '%s' has not type NOBITS but is not read from the file in segment if (pcnt == ehdr->e_phnum) ERROR (gettext ("\ section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); } if (cnt == shstrndx && shdr->sh_type != SHT_STRTAB) ERROR (gettext ("\ section [%2zu] '%s': ELF header says this is the section header string table but type is not SHT_TYPE\n"), - cnt, section_name (ebl, ehdr, cnt)); + cnt, section_name (ebl, cnt)); switch (shdr->sh_type) { @@ -2240,19 +2237,19 @@ section [%2zu] '%s': ELF header says this is the section header string table but break; case SHT_DYNAMIC: - check_dynamic (ebl, ehdr, cnt); + check_dynamic (ebl, cnt); break; case SHT_SYMTAB_SHNDX: - check_symtab_shndx (ebl, ehdr, cnt); + check_symtab_shndx (ebl, cnt); break; case SHT_HASH: - check_hash (ebl, ehdr, cnt); + check_hash (ebl, cnt); break; case SHT_NULL: - check_null (ebl, ehdr, shdr, cnt); + check_null (ebl, shdr, cnt); break; case SHT_GROUP: @@ -2260,7 +2257,7 @@ section [%2zu] '%s': ELF header says this is the section header string table but break; case SHT_GNU_versym: - check_versym (ebl, ehdr, shdr, cnt); + check_versym (ebl, shdr, cnt); break; default: @@ -2285,6 +2282,10 @@ check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt) phdr[%d]: no note entries defined for the type of file\n"), cnt); + if (is_debuginfo) + /* The p_offset values in a separate debug file are bogus. */ + return; + char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz); /* ELF64 files often use note section entries in the 32-bit format. @@ -2447,7 +2448,7 @@ only executables, shared objects, and core files can have program headers\n")); } if (phdr->p_type >= PT_NUM && phdr->p_type != PT_GNU_EH_FRAME - && phdr->p_type != PT_GNU_STACK) + && phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO) ERROR (gettext ("\ program header entry %d: unknown program header entry type\n"), cnt); @@ -2488,7 +2489,7 @@ more than one GNU_RELRO entry in program header\n")); GElf_Phdr phdr2_mem; GElf_Phdr *phdr2; - phdr2 = gelf_getphdr (ebl->elf, cnt, &phdr2_mem); + phdr2 = gelf_getphdr (ebl->elf, inner, &phdr2_mem); if (phdr2 == NULL) continue; diff --git a/elfutils/src/findtextrel.c b/elfutils/src/findtextrel.c new file mode 100644 index 00000000..662fe95c --- /dev/null +++ b/elfutils/src/findtextrel.c @@ -0,0 +1,596 @@ +/* Locate source files or functions which caused text relocations. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper <drepper@redhat.com>, 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <argp.h> +#include <assert.h> +#include <errno.h> +#include <error.h> +#include <fcntl.h> +#include <gelf.h> +#include <libdw.h> +#include <libintl.h> +#include <locale.h> +#include <search.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + + +struct segments +{ + GElf_Addr from; + GElf_Addr to; +}; + + +/* Name and version of program. */ +static void print_version (FILE *stream, struct argp_state *state); +void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + +/* Values for the parameters which have no short form. */ +#define OPT_DEBUGINFO 0x100 + +/* Definitions of arguments for argp functions. */ +static const struct argp_option options[] = +{ + { NULL, 0, NULL, 0, N_("Input Selection:"), 0 }, + { "root", 'r', "PATH", 0, N_("Prepend PATH to all file names"), 0 }, + { "debuginfo", OPT_DEBUGINFO, "PATH", 0, + N_("Use PATH as root of debuginfo hierarchy"), 0 }, + + { NULL, 0, NULL, 0, N_("Miscellaneous:"), 0 }, + { NULL, 0, NULL, 0, NULL, 0 } +}; + +/* Short description of program. */ +static const char doc[] = N_("\ +Locate source of text relocations in FILEs (a.out by default)."); + +/* Strings for arguments in help texts. */ +static const char args_doc[] = N_("[FILE...]"); + +/* Prototype for option handler. */ +static error_t parse_opt (int key, char *arg, struct argp_state *state); + +/* Data structure to communicate with argp functions. */ +static struct argp argp = +{ + options, parse_opt, args_doc, doc, NULL, NULL, NULL +}; + + +/* Print symbols in file named FNAME. */ +static int process_file (const char *fname, bool more_than_one); + +/* Check for text relocations in the given file. The segment + information is known. */ +static void check_rel (size_t nsegments, struct segments segments[nsegments], + GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, + const char *fname, bool more_than_one, + void **knownsrcs); + + + +/* User-provided root directory. */ +static const char *rootdir = "/"; + +/* Root of debuginfo directory hierarchy. */ +static const char *debuginfo_root; + + +int +main (int argc, char *argv[]) +{ + int remaining; + int result = 0; + + /* Set locale. */ + (void) setlocale (LC_ALL, ""); + + /* Make sure the message catalog can be found. */ + (void) bindtextdomain (PACKAGE, LOCALEDIR); + + /* Initialize the message catalog. */ + (void) textdomain (PACKAGE); + + /* Parse and process arguments. */ + (void) argp_parse (&argp, argc, argv, 0, &remaining, NULL); + + /* Tell the library which version we are expecting. */ + elf_version (EV_CURRENT); + + /* If the user has not specified the root directory for the + debuginfo hierarchy, we have to determine it ourselves. */ + if (debuginfo_root == NULL) + { + // XXX The runtime should provide this information. +#if defined __ia64__ || defined __alpha__ + debuginfo_root = "/usr/lib/debug"; +#else + debuginfo_root = (sizeof (long int) == 4 + ? "/usr/lib/debug" : "/usr/lib64/debug"); +#endif + } + + if (remaining == argc) + result = process_file ("a.out", false); + else + { + /* Process all the remaining files. */ + const bool more_than_one = remaining + 1 < argc; + + do + result |= process_file (argv[remaining], more_than_one); + while (++remaining < argc); + } + + return result; +} + + +/* Print the version information. */ +static void +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) +{ + fprintf (stream, "findtextrel (%s) %s\n", PACKAGE_NAME, VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s Red Hat, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2005"); + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); +} + + +/* Handle program arguments. */ +static error_t +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) +{ + switch (key) + { + case 'r': + rootdir = arg; + break; + + case OPT_DEBUGINFO: + debuginfo_root = arg; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + + +static void +noop (void *arg __attribute__ ((unused))) +{ +} + + +static int +process_file (const char *fname, bool more_than_one) +{ + int result = 0; + void *knownsrcs = NULL; + + size_t fname_len = strlen (fname); + size_t rootdir_len = strlen (rootdir); + const char *real_fname = fname; + if (fname[0] == '/' && (rootdir[0] != '/' || rootdir[1] != '\0')) + { + /* Prepend the user-provided root directory. */ + char *new_fname = alloca (rootdir_len + fname_len + 2); + *((char *) mempcpy (stpcpy (mempcpy (new_fname, rootdir, rootdir_len), + "/"), + fname, fname_len)) = '\0'; + real_fname = new_fname; + } + + int fd = open64 (real_fname, O_RDONLY); + if (fd == -1) + { + error (0, errno, gettext ("cannot open '%s'"), fname); + return 1; + } + + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); + if (elf == NULL) + { + error (0, 0, gettext ("cannot create ELF descriptor for '%s': %s"), + fname, elf_errmsg (-1)); + goto err_close; + } + + /* Make sure the file is a DSO. */ + GElf_Ehdr ehdr_mem; + GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); + if (ehdr == NULL) + { + error (0, 0, gettext ("cannot get ELF header '%s': %s"), + fname, elf_errmsg (-1)); + err_elf_close: + elf_end (elf); + err_close: + close (fd); + return 1; + } + + if (ehdr->e_type != ET_DYN) + { + error (0, 0, gettext ("'%s' is not a DSO or PIE"), fname); + goto err_elf_close; + } + + /* Determine whether the DSO has text relocations at all and locate + the symbol table. */ + Elf_Scn *symscn = NULL; + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (elf, scn)) != NULL) + { + /* Handle the section if it is a symbol table. */ + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + + if (shdr == NULL) + { + error (0, 0, + gettext ("getting get section header of section %zu: %s"), + elf_ndxscn (scn), elf_errmsg (-1)); + goto err_elf_close; + } + + if (shdr->sh_type == SHT_DYNAMIC) + { + Elf_Data *data = elf_getdata (scn, NULL); + + for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; + ++cnt) + { + GElf_Dyn dynmem; + GElf_Dyn *dyn; + + dyn = gelf_getdyn (data, cnt, &dynmem); + if (dyn == NULL) + { + error (0, 0, gettext ("cannot read dynamic section: %s"), + elf_errmsg (-1)); + goto err_elf_close; + } + + if (dyn->d_tag == DT_TEXTREL + || (dyn->d_tag == DT_FLAGS + && (dyn->d_un.d_val & DF_TEXTREL) != 0)) + goto have_textrel; + } + } + else if (shdr->sh_type == SHT_SYMTAB) + symscn = scn; + } + + error (0, 0, gettext ("no text relocations reported in '%s'"), fname); + return 1; + + have_textrel:; + int fd2 = -1; + Elf *elf2 = NULL; + /* Get the address ranges for the loaded segments. */ + size_t nsegments_max = 10; + size_t nsegments = 0; + struct segments *segments + = (struct segments *) malloc (nsegments_max * sizeof (segments[0])); + if (segments == NULL) + error (1, errno, gettext ("while reading ELF file")); + + for (int i = 0; i < ehdr->e_phnum; ++i) + { + GElf_Phdr phdr_mem; + GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem); + if (phdr == NULL) + { + error (0, 0, + gettext ("cannot get program header index at offset %d: %s"), + i, elf_errmsg (-1)); + result = 1; + goto next; + } + + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_W) == 0) + { + if (nsegments == nsegments_max) + { + nsegments_max *= 2; + segments + = (struct segments *) realloc (segments, + nsegments_max + * sizeof (segments[0])); + if (segments == NULL) + { + error (0, 0, gettext ("\ +cannot get program header index at offset %d: %s"), + i, elf_errmsg (-1)); + result = 1; + goto next; + } + } + + segments[nsegments].from = phdr->p_vaddr; + segments[nsegments].to = phdr->p_vaddr + phdr->p_memsz; + ++nsegments; + } + } + + if (nsegments > 0) + { + + Dwarf *dw = dwarf_begin_elf (elf, DWARF_C_READ, NULL); + /* Look for debuginfo files if the information is not the in + opened file itself. This makes only sense if the input file + is specified with an absolute path. */ + if (dw == NULL && fname[0] == '/') + { + size_t debuginfo_rootlen = strlen (debuginfo_root); + char *difname = (char *) alloca (rootdir_len + debuginfo_rootlen + + fname_len + 8); + strcpy (mempcpy (stpcpy (mempcpy (mempcpy (difname, rootdir, + rootdir_len), + debuginfo_root, + debuginfo_rootlen), + "/"), + fname, fname_len), + ".debug"); + + fd2 = open64 (difname, O_RDONLY); + if (fd2 != -1 + && (elf2 = elf_begin (fd2, ELF_C_READ_MMAP, NULL)) != NULL) + dw = dwarf_begin_elf (elf2, DWARF_C_READ, NULL); + } + + /* Look at all relocations and determine which modify + write-protected segments. */ + scn = NULL; + while ((scn = elf_nextscn (elf, scn)) != NULL) + { + /* Handle the section if it is a symbol table. */ + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + + if (shdr == NULL) + { + error (0, 0, + gettext ("cannot get section header of section %Zu: %s"), + elf_ndxscn (scn), elf_errmsg (-1)); + result = 1; + goto next; + } + + if ((shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA) + && symscn == NULL) + { + symscn = elf_getscn (elf, shdr->sh_link); + if (symscn == NULL) + { + error (0, 0, gettext ("\ +cannot get symbol table section %zu in '%s': %s"), + (size_t) shdr->sh_link, fname, elf_errmsg (-1)); + result = 1; + goto next; + } + } + + if (shdr->sh_type == SHT_REL) + { + Elf_Data *data = elf_getdata (scn, NULL); + + for (int cnt = 0; + (size_t) cnt < shdr->sh_size / shdr->sh_entsize; + ++cnt) + { + GElf_Rel rel_mem; + GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); + if (rel == NULL) + { + error (0, 0, gettext ("\ +cannot get relocation at index %d in section %zu in '%s': %s"), + cnt, elf_ndxscn (scn), fname, elf_errmsg (-1)); + result = 1; + goto next; + } + + check_rel (nsegments, segments, rel->r_offset, elf, + symscn, dw, fname, more_than_one, &knownsrcs); + } + } + else if (shdr->sh_type == SHT_RELA) + { + Elf_Data *data = elf_getdata (scn, NULL); + + for (int cnt = 0; + (size_t) cnt < shdr->sh_size / shdr->sh_entsize; + ++cnt) + { + GElf_Rela rela_mem; + GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); + if (rela == NULL) + { + error (0, 0, gettext ("\ +cannot get relocation at index %d in section %zu in '%s': %s"), + cnt, elf_ndxscn (scn), fname, elf_errmsg (-1)); + result = 1; + goto next; + } + + check_rel (nsegments, segments, rela->r_offset, elf, + symscn, dw, fname, more_than_one, &knownsrcs); + } + } + } + + dwarf_end (dw); + } + + next: + elf_end (elf); + elf_end (elf2); + close (fd); + if (fd2 != -1) + close (fd2); + + tdestroy (knownsrcs, noop); + + return result; +} + + +static int +ptrcompare (const void *p1, const void *p2) +{ + if ((uintptr_t) p1 < (uintptr_t) p2) + return -1; + if ((uintptr_t) p1 > (uintptr_t) p2) + return 1; + return 0; +} + + +static void +check_rel (size_t nsegments, struct segments segments[nsegments], + GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, + const char *fname, bool more_than_one, void **knownsrcs) +{ + for (size_t cnt = 0; cnt < nsegments; ++cnt) + if (segments[cnt].from <= addr && segments[cnt].to > addr) + { + Dwarf_Die die_mem; + Dwarf_Die *die; + Dwarf_Line *line; + const char *src; + + if (more_than_one) + printf ("%s: ", fname); + + if ((die = dwarf_addrdie (dw, addr, &die_mem)) != NULL + && (line = dwarf_getsrc_die (die, addr)) != NULL + && (src = dwarf_linesrc (line, NULL, NULL)) != NULL) + { + /* There can be more than one relocation against one file. + Try to avoid multiple messages. And yes, the code uses + pointer comparison. */ + if (tfind (src, knownsrcs, ptrcompare) == NULL) + { + printf (gettext ("%s not compiled with -fpic/-fPIC\n"), src); + tsearch (src, knownsrcs, ptrcompare); + } + return; + } + else + { + /* At least look at the symbol table to see which function + the modified address is in. */ + Elf_Data *symdata = elf_getdata (symscn, NULL); + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (symscn, &shdr_mem); + if (shdr != NULL) + { + GElf_Addr lowaddr = 0; + int lowidx = -1; + GElf_Addr highaddr = ~0ul; + int highidx = -1; + GElf_Sym sym_mem; + GElf_Sym *sym; + + for (int i = 0; (size_t) i < shdr->sh_size / shdr->sh_entsize; + ++i) + { + sym = gelf_getsym (symdata, i, &sym_mem); + if (sym == NULL) + continue; + + if (sym->st_value < addr && sym->st_value > lowaddr) + { + lowaddr = sym->st_value; + lowidx = i; + } + if (sym->st_value > addr && sym->st_value < highaddr) + { + highaddr = sym->st_value; + highidx = i; + } + } + + if (lowidx != -1) + { + sym = gelf_getsym (symdata, lowidx, &sym_mem); + assert (sym != NULL); + + const char *lowstr = elf_strptr (elf, shdr->sh_link, + sym->st_name); + + if (sym->st_value + sym->st_size > addr) + { + /* It is this function. */ + if (tfind (lowstr, knownsrcs, ptrcompare) == NULL) + { + printf (gettext ("\ +the file containing the function '%s' is not compiled with -fpic/-fPIC\n"), + lowstr); + tsearch (lowstr, knownsrcs, ptrcompare); + } + } + else if (highidx == -1) + printf (gettext ("\ +the file containing the function '%s' might not be compiled with -fpic/-fPIC\n"), + lowstr); + else + { + sym = gelf_getsym (symdata, highidx, &sym_mem); + assert (sym != NULL); + + printf (gettext ("\ +either the file containing the function '%s' or the file containing the function '%s' is not compiled with -fpic/-fPIC\n"), + lowstr, elf_strptr (elf, shdr->sh_link, + sym->st_name)); + } + return; + } + else if (highidx != -1) + { + sym = gelf_getsym (symdata, highidx, &sym_mem); + assert (sym != NULL); + + printf (gettext ("\ +the file containing the function '%s' might not be compiled with -fpic/-fPIC\n"), + elf_strptr (elf, shdr->sh_link, sym->st_name)); + return; + } + } + } + + printf (gettext ("\ +a relocation modifies memory at offset %llu in a write-protected segment\n"), + (unsigned long long int) addr); + break; + } +} diff --git a/elfutils/src/i386_ld.c b/elfutils/src/i386_ld.c index 28304ca0..ee1cb966 100644 --- a/elfutils/src/i386_ld.c +++ b/elfutils/src/i386_ld.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -38,8 +38,10 @@ static int (*old_open_outfile) (struct ld_state *, int, int, int); static int -elf_i386_open_outfile (struct ld_state *statep, int machine, int klass, - int data) +elf_i386_open_outfile (struct ld_state *statep, + int machine __attribute__ ((unused)), + int klass __attribute__ ((unused)), + int data __attribute__ ((unused))) { /* This backend only handles 32-bit object files. */ /* XXX For now just use the generic backend. */ @@ -50,8 +52,8 @@ elf_i386_open_outfile (struct ld_state *statep, int machine, int klass, /* Process relocations for the output in a relocatable file. This only means adjusting offset and symbol indices. */ static void -elf_i386_relocate_section (struct ld_state *statep, Elf_Scn *outscn, - struct scninfo *firstp, +elf_i386_relocate_section (struct ld_state *statep __attribute__ ((unused)), + Elf_Scn *outscn, struct scninfo *firstp, const Elf32_Word *dblindirect) { struct scninfo *runp; @@ -324,7 +326,8 @@ struct plt_entry static void -elf_i386_finalize_plt (struct ld_state *statep, size_t nsym, size_t nsym_dyn) +elf_i386_finalize_plt (struct ld_state *statep, size_t nsym, + size_t nsym_dyn __attribute__ ((unused))) { Elf_Scn *scn; XElf_Shdr_vardef (shdr); @@ -503,7 +506,7 @@ elf_i386_count_relocations (struct ld_state *statep, struct scninfo *scninfo) /* XXX Should we complain about failing accesses? */ if (rel != NULL) { - int r_sym = XELF_R_SYM (rel->r_info); + Elf32_Word r_sym = XELF_R_SYM (rel->r_info); switch (XELF_R_TYPE (rel->r_info)) { @@ -631,7 +634,7 @@ elf_i386_count_relocations (struct ld_state *statep, struct scninfo *scninfo) static void elf_i386_create_relocations (struct ld_state *statep, - const Elf32_Word *dblindirect) + const Elf32_Word *dblindirect __attribute__ ((unused))) { /* Get the address of the got section. */ Elf_Scn *pltscn = elf_getscn (statep->outelf, statep->pltscnidx); diff --git a/elfutils/src/ld.c b/elfutils/src/ld.c index a6b664f7..2aece00e 100644 --- a/elfutils/src/ld.c +++ b/elfutils/src/ld.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -38,6 +38,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Values for the various options. */ enum @@ -68,116 +71,121 @@ static const struct argp_option options[] = /* XXX This list will be reordered and section names will be added. Just not right now. */ { "whole-archive", ARGP_whole_archive, NULL, 0, - N_("Include whole archives in the output from now on.") }, + N_("Include whole archives in the output from now on."), 0 }, { "no-whole-archive", ARGP_no_whole_archive, NULL, 0, - N_("Stop including the whole arhives in the output.") }, + N_("Stop including the whole arhives in the output."), 0 }, - { "output", 'o', N_("FILE"), 0, N_("Place output in FILE.") }, + { "output", 'o', N_("FILE"), 0, N_("Place output in FILE."), 0 }, { NULL, 'O', N_("LEVEL"), OPTION_ARG_OPTIONAL, - N_("Set optimization level to LEVEL.") }, + N_("Set optimization level to LEVEL."), 0 }, - { "verbose", 'v', NULL, 0, N_("Verbose messages.") }, - { "trace", 't', NULL, 0, N_("Trace file opens.") }, + { "verbose", 'v', NULL, 0, N_("Verbose messages."), 0 }, + { "trace", 't', NULL, 0, N_("Trace file opens."), 0 }, { "conserve-memory", ARGP_conserve, NULL, 0, - N_("Trade speed for less memory usage") }, + N_("Trade speed for less memory usage"), 0 }, - { NULL, 'z', "KEYWORD", OPTION_HIDDEN, NULL }, + { NULL, 'z', "KEYWORD", OPTION_HIDDEN, NULL, 0 }, { "-z nodefaultlib", '\0', NULL, OPTION_DOC, - N_("Object is marked to not use default search path at runtime.") }, + N_("Object is marked to not use default search path at runtime."), 0 }, { "-z allextract", '\0', NULL, OPTION_DOC, - N_("Same as --whole-archive.") }, + N_("Same as --whole-archive."), 0 }, { "-z defaultextract", '\0', NULL, OPTION_DOC, N_("\ -Default rules of extracting from archive; weak references are not enough.") }, +Default rules of extracting from archive; weak references are not enough."), + 0 }, { "-z weakextract", '\0', NULL, OPTION_DOC, - N_("Weak references cause extraction from archive.") }, + N_("Weak references cause extraction from archive."), 0 }, { "-z muldefs", '\0', NULL, OPTION_DOC, - N_("Allow multiple definitions; first is used.") }, + N_("Allow multiple definitions; first is used."), 0 }, { "-z defs | nodefs", '\0', NULL, OPTION_DOC, - N_("Disallow/allow undefined symbols in DSOs.") }, - { "no-undefined", ARGP_no_undefined, NULL, OPTION_HIDDEN, NULL }, + N_("Disallow/allow undefined symbols in DSOs."), 0 }, + { "no-undefined", ARGP_no_undefined, NULL, OPTION_HIDDEN, NULL, 0 }, { "-z origin", '\0', NULL, OPTION_DOC, - N_("Object requires immediate handling of $ORIGIN.") }, + N_("Object requires immediate handling of $ORIGIN."), 0 }, { "-z now", '\0', NULL, OPTION_DOC, - N_("Relocation will not be processed lazily.") }, + N_("Relocation will not be processed lazily."), 0 }, { "-z nodelete", '\0', NULL, OPTION_DOC, - N_("Object cannot be unloaded at runtime.") }, + N_("Object cannot be unloaded at runtime."), 0 }, { "-z initfirst", '\0', NULL, OPTION_DOC, - N_("Mark object to be initialized first.") }, + N_("Mark object to be initialized first."), 0 }, { "-z lazyload | nolazyload", '\0', NULL, OPTION_DOC, - N_("Enable/disable lazy-loading flag for following dependencies.") }, + N_("Enable/disable lazy-loading flag for following dependencies."), 0 }, { "-z nodlopen", '\0', NULL, OPTION_DOC, - N_("Mark object as not loadable with 'dlopen'.") }, + N_("Mark object as not loadable with 'dlopen'."), 0 }, { "-z ignore | record", '\0', NULL, OPTION_DOC, - N_("Ignore/record dependencies on unused DSOs.") }, + N_("Ignore/record dependencies on unused DSOs."), 0 }, { "-z systemlibrary", '\0', NULL, OPTION_DOC, - N_("Generated DSO will be a system library.") }, + N_("Generated DSO will be a system library."), 0 }, - { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL }, + { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL, 0 }, - { NULL, '(', NULL, 0, N_("Start a group.") }, - { NULL, ')', NULL, 0, N_("End a group.") }, + { NULL, '(', NULL, 0, N_("Start a group."), 0 }, + { NULL, ')', NULL, 0, N_("End a group."), 0 }, { NULL, 'L', N_("PATH"), 0, - N_("Add PATH to list of directories files are searched in.") }, + N_("Add PATH to list of directories files are searched in."), 0 }, - { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE.") }, + { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE."), 0 }, - { "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address.") }, + { "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address."), 0 }, - { "static", ARGP_static, NULL, OPTION_HIDDEN, NULL }, + { "static", ARGP_static, NULL, OPTION_HIDDEN, NULL, 0 }, { "-B static", ARGP_static, NULL, OPTION_DOC, - N_("Do not link against shared libraries.") }, - { "dynamic", ARGP_dynamic, NULL, OPTION_HIDDEN, NULL }, + N_("Do not link against shared libraries."), 0 }, + { "dynamic", ARGP_dynamic, NULL, OPTION_HIDDEN, NULL, 0 }, { "-B dynamic", ARGP_dynamic, NULL, OPTION_DOC, - N_("Prefer linking against shared libraries.") }, + N_("Prefer linking against shared libraries."), 0 }, - { "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols.") }, + { "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols."), 0 }, - { "strip-all", 's', NULL, 0, N_("Strip all symbols.") }, - { "strip-debug", 'S', NULL, 0, N_("Strip debugging symbols.") }, + { "strip-all", 's', NULL, 0, N_("Strip all symbols."), 0 }, + { "strip-debug", 'S', NULL, 0, N_("Strip debugging symbols."), 0 }, { "pagesize", ARGP_pagesize, "SIZE", 0, - N_("Assume pagesize for the target system to be SIZE.") }, + N_("Assume pagesize for the target system to be SIZE."), 0 }, - { "rpath", ARGP_rpath, "PATH", OPTION_HIDDEN, NULL }, - { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL }, + { "rpath", ARGP_rpath, "PATH", OPTION_HIDDEN, NULL, 0 }, + { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL, 0 }, - { "runpath", ARGP_runpath, "PATH", 0, N_("Set runtime DSO search path.") }, + { "runpath", ARGP_runpath, "PATH", 0, N_("Set runtime DSO search path."), + 0 }, { "runpath-link", ARGP_runpath_link, "PATH", 0, - N_("Set link time DSO search path.") }, + N_("Set link time DSO search path."), 0 }, - { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable.") }, + { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable."), + 0 }, { "version-script", ARGP_version_script, "FILE", 0, - N_("Read version information from FILE.") }, + N_("Read version information from FILE."), 0 }, - { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME.") }, + { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME."), 0 }, - { "shared", 'G', NULL, 0, N_("Generate dynamic shared object.") }, - { NULL, 'r', NULL, 0L, N_("Generate relocatable object.") }, + { "shared", 'G', NULL, 0, N_("Generate dynamic shared object."), 0 }, + { NULL, 'r', NULL, 0L, N_("Generate relocatable object."), 0 }, - { NULL, 'B', "KEYWORD", OPTION_HIDDEN, "" }, + { NULL, 'B', "KEYWORD", OPTION_HIDDEN, "", 0 }, { "-B local", 'B', NULL, OPTION_DOC, - N_("Causes symbol not assigned to a version be reduced to local.") }, + N_("Causes symbol not assigned to a version be reduced to local."), 0 }, - { "gc-sections", ARGP_gc_sections, NULL, 0, N_("Remove unused sections.") }, + { "gc-sections", ARGP_gc_sections, NULL, 0, N_("Remove unused sections."), + 0 }, { "no-gc-sections", ARGP_no_gc_sections, NULL, 0, - N_("Don't remove unused sections.") }, + N_("Don't remove unused sections."), 0 }, - { "soname", 'h', "NAME", 0, N_("Set soname of shared object.") }, - { "dynamic-linker", 'I', "NAME", 0, N_("Set the dynamic linker name.") }, + { "soname", 'h', "NAME", 0, N_("Set soname of shared object."), 0 }, + { "dynamic-linker", 'I', "NAME", 0, N_("Set the dynamic linker name."), 0 }, - { NULL, 'Q', "YN", OPTION_HIDDEN, NULL }, + { NULL, 'Q', "YN", OPTION_HIDDEN, NULL, 0 }, { "-Q y | n", 'Q', NULL, OPTION_DOC, - N_("Add/suppress addition indentifying link-editor to .comment section") }, + N_("Add/suppress addition indentifying link-editor to .comment section"), + 0 }, #if YYDEBUG { "yydebug", ARGP_yydebug, NULL, 0, - N_("Select to get parser debug information") }, + N_("Select to get parser debug information"), 0 }, #endif - { NULL, 0, NULL, 0, NULL } + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -190,17 +198,14 @@ static const char args_doc[] = N_("[FILE]..."); static error_t parse_opt_1st (int key, char *arg, struct argp_state *state); static error_t parse_opt_2nd (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp_1st = { - options, parse_opt_1st, args_doc, doc, NULL, more_help + options, parse_opt_1st, args_doc, doc, NULL, NULL, NULL }; static struct argp argp_2nd = { - options, parse_opt_2nd, args_doc, doc, NULL, more_help + options, parse_opt_2nd, args_doc, doc, NULL, NULL, NULL }; @@ -478,30 +483,10 @@ main (int argc, char *argv[]) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - /* Quick scan of the parameter list for options with global effect. */ static error_t -parse_opt_1st (int key, char *arg, struct argp_state *state) +parse_opt_1st (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { switch (key) { @@ -685,7 +670,8 @@ parse_opt_1st (int key, char *arg, struct argp_state *state) /* Handle program arguments for real. */ static error_t -parse_opt_2nd (int key, char *arg, struct argp_state *state) +parse_opt_2nd (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { static bool group_start_requested; static bool group_end_requested; @@ -865,14 +851,14 @@ load_needed (void) /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "ld (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } diff --git a/elfutils/src/ld.h b/elfutils/src/ld.h index 760ff125..a463a188 100644 --- a/elfutils/src/ld.h +++ b/elfutils/src/ld.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -464,6 +464,7 @@ struct filename_list struct filename_list *next; bool group_start; bool group_end; + bool as_needed; }; @@ -1054,9 +1055,9 @@ extern bool dynamically_linked_p (void); /* Helper functions for the architecture specific code. */ /* Checked whether the symbol is undefined and referenced from a DSO. */ -extern bool linked_from_dso_p (struct scninfo *scninfo, int symidx); +extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx); extern inline bool -linked_from_dso_p (struct scninfo *scninfo, int symidx) +linked_from_dso_p (struct scninfo *scninfo, size_t symidx) { struct usedfiles *file = scninfo->fileinfo; diff --git a/elfutils/src/ldgeneric.c b/elfutils/src/ldgeneric.c index a33e9fcc..1b6c7207 100644 --- a/elfutils/src/ldgeneric.c +++ b/elfutils/src/ldgeneric.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -137,7 +137,7 @@ dynamically_linked_p (void) bool -linked_from_dso_p (struct scninfo *scninfo, int symidx) +linked_from_dso_p (struct scninfo *scninfo, size_t symidx) { struct usedfiles *file = scninfo->fileinfo; @@ -1003,7 +1003,7 @@ add_section (struct usedfiles *fileinfo, struct scninfo *scninfo) static int -add_relocatable_file (struct usedfiles *fileinfo, int secttype) +add_relocatable_file (struct usedfiles *fileinfo, GElf_Word secttype) { size_t scncnt; size_t cnt; @@ -2765,7 +2765,7 @@ sort_sections_lscript (void) renaming the containing section in the output file. */ ld_state.nallsections = 0; size_t segment_nr; - size_t last_writable = ~0; + size_t last_writable = ~0ul; for (segment_nr = 0; segment != NULL; segment = segment->next, ++segment_nr) { struct output_rule *orule; @@ -2801,7 +2801,7 @@ sort_sections_lscript (void) This is why it is important to get the last block. */ if (ld_state.ncopy > 0 || ld_state.common_syms != NULL) { - if (last_writable == ~0) + if (last_writable == ~0ul) error (EXIT_FAILURE, 0, "no writable segment"); if (ld_state.allsections[last_writable]->type != SHT_NOBITS) @@ -6278,7 +6278,7 @@ ld_generic_special_section_number_p (struct ld_state *statep, size_t number) static bool ld_generic_section_type_p (struct ld_state *statep, GElf_Word type) { - if ((type >= SHT_NULL && type < SHT_NUM) + if (type < SHT_NUM /* XXX Enable the following two when implemented. */ // || type == SHT_GNU_LIBLIST // || type == SHT_CHECKSUM diff --git a/elfutils/src/ldlex.c b/elfutils/src/ldlex.c index e0bf0a5f..8d192fa9 100644 --- a/elfutils/src/ldlex.c +++ b/elfutils/src/ldlex.c @@ -308,54 +308,55 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 49 -#define YY_END_OF_BUFFER 50 -static yyconst short int yy_acclist[373] = +#define YY_NUM_RULES 50 +#define YY_END_OF_BUFFER 51 +static yyconst short int yy_acclist[390] = { 0, - 50, 48, 49, 47, 48, 49, 47, 49, 40, 48, - 49, 41, 48, 49, 31, 48, 49, 32, 48, 49, - 38, 45, 48, 49, 36, 48, 49, 43, 48, 49, - 37, 48, 49, 45, 48, 49, 39, 48, 49, 44, - 45, 48, 49, 44, 45, 48, 49, 33, 48, 49, - 34, 48, 49, 35, 48, 49, 45, 48, 49, 45, - 48, 49, 45, 48, 49, 45, 48, 49, 45, 48, - 49, 45, 48, 49, 45, 48, 49, 45, 48, 49, - 45, 48, 49, 45, 48, 49, 48, 49, 48, 49, - 45, 48, 49, 45, 48, 49, 29, 48, 49, 42, - - 48, 49, 30, 48, 49, 48, 49, 9, 49, 9, - 49, 47, 45, 46, 45, 46, 10, 46, 44, 45, - 46, 44, 45, 46, 44, 45, 46, 45, 46, 44, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 28, 45, - 46, 45, 46, 44, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - - 44, 45, 46, 45, 46, 45, 46, 45, 46, 45, - 46, 45, 46, 45, 46, 18, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 26, 45, 46, 45, 46, 45, 46, 45, 46, 11, - 45, 46, 12, 45, 46, 45, 46, 15, 45, 46, - 16, 45, 46, 45, 46, 45, 46, 45, 46, 45, - 46, 45, 46, 45, 46, 45, 46, 45, 46, 45, - 46, 45, 46, 45, 46, 17, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 45, 46, 45, 46, 19, 2, 6, 45, 46, 45, - - 46, 45, 46, 22, 45, 46, 45, 46, 24, 45, - 46, 45, 46, 27, 45, 46, 14, 4, 1, 8, - 5, 45, 46, 45, 46, 21, 45, 46, 45, 46, - 45, 46, 45, 46, 45, 46, 45, 46, 45, 46, - 3, 7, 45, 46, 45, 46, 23, 45, 46, 45, - 46, 45, 46, 45, 46, 45, 46, 13, 45, 46, - 45, 46, 45, 46, 20, 45, 46, 45, 46, 25, - 45, 46 + 51, 49, 50, 48, 49, 50, 48, 50, 41, 49, + 50, 42, 49, 50, 32, 49, 50, 33, 49, 50, + 39, 46, 49, 50, 37, 49, 50, 44, 49, 50, + 38, 49, 50, 46, 49, 50, 40, 49, 50, 45, + 46, 49, 50, 45, 46, 49, 50, 34, 49, 50, + 35, 49, 50, 36, 49, 50, 46, 49, 50, 46, + 49, 50, 46, 49, 50, 46, 49, 50, 46, 49, + 50, 46, 49, 50, 46, 49, 50, 46, 49, 50, + 46, 49, 50, 46, 49, 50, 49, 50, 49, 50, + 46, 49, 50, 46, 49, 50, 30, 49, 50, 43, + + 49, 50, 31, 49, 50, 49, 50, 9, 50, 9, + 50, 48, 46, 47, 46, 47, 10, 47, 45, 46, + 47, 45, 46, 47, 45, 46, 47, 46, 47, 45, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + 29, 46, 47, 46, 47, 45, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + + 46, 47, 46, 47, 45, 46, 47, 46, 47, 46, + 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, + 47, 19, 46, 47, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 27, 46, 47, 46, + 47, 46, 47, 46, 47, 11, 46, 47, 46, 47, + 13, 46, 47, 46, 47, 16, 46, 47, 17, 46, + 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, + 47, 46, 47, 46, 47, 46, 47, 46, 47, 46, + 47, 46, 47, 46, 47, 18, 46, 47, 46, 47, + 46, 47, 46, 47, 46, 47, 46, 47, 46, 47, + + 46, 47, 46, 47, 20, 2, 6, 46, 47, 46, + 47, 46, 47, 46, 47, 23, 46, 47, 46, 47, + 25, 46, 47, 46, 47, 28, 46, 47, 15, 4, + 1, 8, 5, 46, 47, 46, 47, 46, 47, 22, + 46, 47, 46, 47, 46, 47, 12, 46, 47, 46, + 47, 46, 47, 46, 47, 46, 47, 3, 7, 46, + 47, 46, 47, 24, 46, 47, 46, 47, 46, 47, + 46, 47, 46, 47, 14, 46, 47, 46, 47, 46, + 47, 21, 46, 47, 46, 47, 26, 46, 47 } ; -static yyconst short int yy_accept[212] = +static yyconst short int yy_accept[220] = { 0, 1, 1, 1, 1, 1, 2, 4, 7, 9, 12, 15, 18, 21, 25, 28, 31, 34, 37, 40, 44, @@ -363,24 +364,24 @@ static yyconst short int yy_accept[212] = 78, 81, 84, 87, 89, 91, 94, 97, 100, 103, 106, 108, 110, 112, 113, 114, 115, 117, 119, 122, 125, 128, 130, 133, 135, 137, 139, 141, 143, 145, - 147, 149, 151, 153, 155, 157, 159, 159, 160, 162, - 164, 164, 164, 164, 164, 167, 169, 171, 173, 175, + 147, 149, 151, 153, 155, 157, 159, 161, 161, 162, + 164, 166, 166, 166, 166, 166, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, - 197, 197, 199, 201, 201, 201, 201, 201, 201, 201, - - 204, 206, 208, 210, 212, 214, 216, 219, 221, 223, - 225, 227, 229, 231, 234, 236, 236, 238, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 243, 246, 248, - 251, 254, 256, 258, 260, 262, 264, 266, 268, 270, - 272, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 276, 279, 281, 283, 285, 287, 289, 291, 293, 295, - 296, 296, 297, 297, 297, 297, 298, 298, 298, 300, - 302, 304, 307, 309, 312, 314, 317, 318, 318, 319, - 320, 320, 321, 322, 324, 326, 329, 331, 333, 333, - 333, 335, 337, 339, 341, 342, 343, 345, 347, 350, - - 352, 354, 356, 358, 361, 363, 365, 368, 370, 373, - 373 + 197, 199, 201, 201, 203, 205, 205, 205, 205, 205, + + 205, 205, 208, 210, 212, 214, 216, 218, 220, 222, + 225, 227, 229, 231, 233, 235, 237, 240, 242, 242, + 244, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 249, 251, 254, 256, 259, 262, 264, 266, 268, 270, + 272, 274, 276, 278, 280, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 284, 286, 289, 291, 293, 295, + 297, 299, 301, 303, 305, 306, 306, 307, 307, 307, + 307, 308, 308, 308, 310, 312, 314, 316, 319, 321, + 324, 326, 329, 330, 330, 331, 332, 332, 333, 334, + 336, 338, 340, 343, 345, 347, 347, 347, 350, 352, + + 354, 356, 358, 359, 360, 362, 364, 367, 369, 371, + 373, 375, 378, 380, 382, 385, 387, 390, 390 } ; static yyconst int yy_ec[256] = @@ -426,63 +427,65 @@ static yyconst int yy_meta[67] = 3, 3, 3, 2, 1, 2 } ; -static yyconst short int yy_base[215] = +static yyconst short int yy_base[223] = { 0, - 0, 218, 0, 216, 219, 2141, 65, 67, 2141, 2141, - 2141, 2141, 0, 2141, 2141, 2141, 70, 208, 135, 62, - 2141, 2141, 2141, 0, 70, 127, 158, 171, 192, 211, - 260, 309, 215, 46, 0, 269, 273, 2141, 2141, 2141, - 42, 2141, 43, 70, 0, 0, 330, 0, 48, 322, - 333, 382, 385, 434, 437, 458, 471, 520, 507, 529, - 558, 564, 613, 609, 616, 647, 67, 2141, 666, 670, - 47, 160, 59, 158, 90, 703, 722, 725, 756, 760, - 789, 793, 822, 828, 851, 862, 873, 886, 907, 926, - 89, 945, 964, 65, 159, 158, 67, 157, 153, 985, - - 1004, 1008, 1039, 1042, 1073, 1076, 1107, 1111, 1130, 1161, - 1165, 1169, 1198, 1205, 1227, 155, 1234, 1256, 144, 143, - 139, 140, 137, 127, 112, 113, 1263, 1285, 1292, 1296, - 1325, 1329, 1336, 1365, 1386, 1389, 1420, 1441, 1444, 1465, - 1494, 106, 151, 83, 79, 77, 154, 61, 59, 1500, - 1503, 1534, 1553, 1556, 1587, 1590, 1609, 1640, 1644, 2141, - 58, 2141, 160, 162, 54, 2141, 169, 174, 1648, 1677, - 1698, 1701, 1722, 1735, 1757, 1766, 2141, 43, 2141, 2141, - 37, 2141, 2141, 1779, 1788, 1801, 1810, 1832, 177, 181, - 1839, 1861, 1868, 1892, 2141, 2141, 1901, 1905, 1936, 1945, - - 1958, 1980, 1989, 2002, 2011, 2024, 2047, 2055, 2068, 2141, - 2131, 76, 2134, 2137 + 0, 224, 0, 219, 221, 2250, 65, 67, 2250, 2250, + 2250, 2250, 0, 2250, 2250, 2250, 70, 211, 135, 62, + 2250, 2250, 2250, 0, 186, 70, 127, 146, 179, 210, + 259, 308, 246, 46, 0, 268, 297, 2250, 2250, 2250, + 42, 2250, 43, 70, 0, 0, 304, 0, 48, 224, + 337, 386, 389, 438, 441, 444, 493, 496, 545, 532, + 554, 583, 589, 638, 634, 641, 672, 73, 2250, 691, + 695, 47, 161, 49, 160, 96, 728, 747, 751, 780, + 784, 813, 819, 842, 848, 871, 877, 900, 908, 929, + 937, 958, 89, 966, 987, 57, 161, 160, 61, 158, + + 155, 995, 1018, 1031, 1039, 1070, 1062, 1091, 1120, 1127, + 1131, 1160, 1171, 1193, 1204, 1164, 1226, 1233, 151, 1237, + 1266, 142, 134, 124, 115, 112, 111, 102, 99, 1277, + 1288, 1301, 1322, 1341, 1345, 1374, 1380, 1409, 1430, 1433, + 1464, 1485, 1488, 1509, 1538, 95, 154, 83, 79, 77, + 169, 69, 67, 1545, 1549, 1578, 1582, 1589, 1611, 1633, + 1640, 1644, 1684, 1693, 2250, 58, 2250, 171, 173, 48, + 2250, 181, 184, 1697, 1728, 1737, 1750, 1772, 1781, 1794, + 1803, 1825, 2250, 43, 2250, 2250, 37, 2250, 2250, 1834, + 1847, 1838, 1869, 1878, 1900, 189, 204, 1907, 1929, 1936, + + 1960, 1967, 2250, 2250, 1989, 1996, 2000, 2040, 2051, 2029, + 2064, 2085, 2108, 2119, 2142, 2148, 2177, 2250, 2240, 76, + 2243, 2246 } ; -static yyconst short int yy_def[215] = +static yyconst short int yy_def[223] = { 0, - 210, 1, 211, 211, 210, 210, 210, 210, 210, 210, - 210, 210, 212, 210, 210, 210, 213, 214, 213, 19, - 210, 210, 210, 212, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 210, 214, 19, 19, 210, 210, 210, - 210, 210, 210, 210, 212, 214, 19, 214, 19, 19, + 218, 1, 219, 219, 218, 218, 218, 218, 218, 218, + 218, 218, 220, 218, 218, 218, 221, 222, 221, 19, + 218, 218, 218, 220, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 218, 222, 19, 19, 218, 218, 218, + 218, 218, 218, 218, 220, 222, 19, 222, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 210, 210, 19, 19, - 210, 210, 210, 210, 52, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 218, 218, 19, + 19, 218, 218, 218, 218, 52, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 210, 19, 19, 210, 210, 210, 210, 210, 210, 19, + 19, 19, 218, 19, 19, 218, 218, 218, 218, 218, + 218, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 218, 19, + 19, 218, 218, 218, 218, 218, 218, 218, 218, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 210, 19, 19, 210, 210, - 210, 210, 210, 210, 210, 210, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 210, 210, 210, 210, 210, 210, 210, 210, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 19, 19, - 19, 19, 19, 19, 19, 19, 210, 210, 210, 210, - 210, 210, 210, 19, 19, 19, 19, 19, 210, 210, - 19, 19, 19, 19, 210, 210, 19, 19, 19, 19, - - 19, 19, 19, 19, 19, 19, 19, 19, 19, 0, - 210, 210, 210, 210 + 19, 19, 19, 19, 19, 218, 218, 218, 218, 218, + 218, 218, 218, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 218, 218, 218, 218, 218, 218, 218, 19, + 19, 19, 19, 19, 19, 218, 218, 19, 19, 19, + + 19, 19, 218, 218, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 0, 218, 218, + 218, 218 } ; -static yyconst short int yy_nxt[2208] = +static yyconst short int yy_nxt[2317] = { 0, 6, 7, 8, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, @@ -492,244 +495,256 @@ static yyconst short int yy_nxt[2208] = 17, 17, 17, 17, 17, 36, 17, 17, 37, 17, 17, 17, 17, 38, 39, 40, 44, 44, 44, 44, 46, 44, 44, 46, 46, 46, 50, 50, 45, 46, - 46, 46, 67, 46, 47, 47, 47, 67, 67, 46, - 47, 190, 53, 68, 53, 71, 73, 189, 72, 74, - - 47, 54, 47, 91, 47, 94, 95, 181, 91, 91, - 47, 178, 47, 168, 68, 167, 46, 97, 98, 53, - 100, 119, 100, 123, 47, 116, 120, 47, 124, 165, - 116, 116, 47, 164, 46, 46, 68, 163, 46, 46, - 46, 47, 47, 47, 46, 46, 46, 100, 46, 49, - 49, 50, 162, 162, 46, 166, 166, 47, 161, 47, - 55, 179, 179, 180, 180, 51, 149, 51, 148, 56, - 182, 182, 47, 47, 47, 183, 183, 52, 195, 195, - 147, 46, 196, 196, 47, 47, 47, 47, 47, 47, - 47, 146, 51, 145, 57, 144, 143, 52, 142, 46, - - 47, 47, 68, 47, 58, 126, 47, 47, 47, 125, - 122, 121, 99, 47, 96, 47, 48, 59, 210, 43, - 47, 41, 47, 210, 47, 47, 47, 47, 47, 47, - 47, 47, 210, 47, 47, 210, 210, 210, 210, 210, - 66, 47, 210, 47, 210, 47, 210, 47, 210, 47, - 60, 210, 210, 47, 47, 210, 210, 47, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 47, 210, - 210, 210, 47, 47, 47, 47, 47, 47, 210, 210, - 210, 61, 210, 47, 47, 47, 210, 47, 47, 47, - 47, 210, 47, 210, 210, 210, 62, 210, 210, 47, - - 210, 47, 47, 47, 210, 47, 210, 210, 210, 210, - 210, 47, 210, 210, 210, 47, 210, 47, 210, 210, - 210, 210, 47, 47, 47, 47, 47, 69, 210, 210, - 47, 47, 210, 70, 63, 47, 50, 50, 64, 47, - 210, 47, 210, 65, 47, 47, 47, 47, 47, 47, - 210, 47, 53, 210, 53, 210, 210, 210, 210, 210, - 47, 210, 47, 47, 47, 47, 47, 210, 210, 210, - 210, 47, 47, 210, 210, 47, 210, 210, 210, 53, - 210, 210, 210, 210, 47, 210, 210, 47, 210, 210, - 47, 210, 47, 210, 210, 47, 75, 75, 75, 47, - - 47, 47, 210, 75, 75, 75, 75, 75, 75, 210, - 210, 210, 47, 210, 47, 47, 210, 47, 210, 210, - 210, 210, 210, 210, 47, 210, 210, 47, 210, 210, - 210, 75, 75, 75, 75, 75, 75, 210, 210, 47, - 210, 210, 47, 210, 47, 210, 210, 47, 47, 47, - 47, 47, 47, 47, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 76, 47, 210, 47, 47, 210, 47, - 210, 210, 47, 47, 47, 77, 47, 210, 210, 47, - 210, 78, 210, 210, 210, 47, 47, 47, 47, 210, - 47, 47, 210, 210, 47, 210, 47, 210, 210, 47, - - 47, 47, 210, 47, 210, 79, 210, 210, 210, 210, - 210, 210, 210, 47, 210, 47, 210, 210, 210, 210, - 47, 47, 47, 47, 210, 210, 210, 210, 47, 210, - 210, 210, 82, 47, 47, 47, 47, 47, 210, 47, - 210, 210, 210, 47, 47, 47, 210, 210, 210, 47, - 47, 210, 47, 210, 210, 80, 210, 210, 81, 47, - 210, 47, 47, 210, 47, 210, 210, 83, 210, 47, - 210, 47, 47, 47, 47, 210, 210, 47, 47, 47, - 47, 210, 47, 210, 210, 84, 47, 210, 47, 210, - 47, 47, 210, 210, 47, 210, 47, 210, 85, 210, - - 47, 210, 210, 210, 210, 210, 47, 210, 210, 210, - 210, 210, 210, 210, 210, 47, 210, 210, 210, 210, - 47, 47, 210, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 210, 86, 210, 210, 210, 210, 47, - 87, 47, 210, 47, 210, 47, 47, 210, 47, 210, - 210, 47, 89, 88, 210, 47, 210, 210, 47, 210, - 210, 47, 47, 47, 210, 210, 47, 210, 210, 210, - 47, 47, 210, 47, 210, 47, 210, 47, 47, 47, - 47, 47, 47, 90, 47, 47, 47, 210, 210, 47, - 210, 210, 210, 210, 210, 210, 47, 210, 47, 210, - - 47, 210, 47, 210, 47, 210, 210, 210, 47, 47, - 210, 210, 47, 210, 210, 210, 210, 47, 47, 47, - 210, 93, 210, 47, 210, 210, 92, 47, 47, 210, - 101, 210, 47, 47, 210, 47, 47, 47, 47, 47, - 47, 47, 210, 210, 210, 47, 210, 210, 210, 210, - 210, 210, 47, 210, 47, 47, 103, 47, 102, 210, - 47, 210, 210, 210, 47, 47, 210, 47, 210, 210, - 47, 47, 47, 210, 47, 47, 47, 210, 210, 47, - 210, 210, 47, 210, 47, 210, 47, 47, 47, 210, - 47, 210, 47, 210, 210, 104, 210, 210, 47, 105, - - 210, 210, 47, 47, 47, 47, 210, 47, 47, 47, - 210, 210, 210, 47, 106, 210, 210, 47, 47, 47, - 210, 47, 47, 47, 210, 47, 210, 210, 107, 210, - 210, 47, 210, 210, 210, 47, 47, 47, 47, 210, - 210, 210, 47, 47, 47, 210, 47, 210, 210, 210, - 47, 47, 47, 109, 47, 47, 210, 108, 47, 210, - 47, 210, 210, 210, 47, 47, 47, 47, 210, 210, - 47, 210, 210, 210, 210, 210, 47, 47, 47, 47, - 210, 47, 210, 47, 47, 47, 210, 47, 47, 47, - 47, 110, 47, 47, 47, 210, 210, 210, 111, 210, - - 47, 47, 47, 47, 47, 112, 210, 210, 47, 210, - 210, 113, 210, 47, 210, 47, 47, 210, 47, 47, - 210, 47, 47, 47, 47, 210, 210, 210, 47, 210, - 47, 210, 210, 210, 210, 47, 210, 47, 210, 47, - 47, 47, 47, 47, 210, 114, 210, 210, 47, 47, - 210, 210, 210, 210, 210, 210, 47, 210, 47, 47, - 47, 47, 210, 115, 47, 210, 210, 210, 47, 47, - 210, 210, 210, 210, 210, 47, 210, 47, 47, 47, - 47, 210, 210, 47, 210, 210, 210, 47, 47, 210, - 210, 210, 210, 210, 47, 117, 47, 210, 210, 47, - - 47, 47, 47, 210, 210, 210, 47, 47, 210, 210, - 210, 210, 210, 118, 210, 47, 210, 47, 47, 47, - 47, 47, 47, 47, 47, 210, 47, 47, 210, 210, - 210, 210, 210, 210, 47, 210, 47, 127, 47, 210, - 47, 210, 47, 210, 210, 210, 47, 47, 210, 210, - 47, 128, 210, 47, 47, 47, 47, 47, 47, 210, - 210, 47, 210, 210, 210, 47, 47, 210, 210, 47, - 47, 47, 47, 210, 47, 210, 210, 130, 129, 210, - 210, 47, 210, 210, 47, 210, 210, 47, 47, 47, - 47, 47, 47, 210, 210, 210, 47, 210, 210, 47, - - 210, 47, 210, 47, 47, 47, 47, 210, 47, 210, - 210, 131, 132, 210, 210, 47, 210, 210, 47, 210, - 210, 47, 47, 47, 210, 47, 47, 47, 210, 210, - 47, 210, 210, 47, 210, 47, 210, 47, 47, 47, - 210, 47, 210, 47, 47, 47, 47, 210, 210, 47, - 133, 210, 210, 47, 210, 210, 210, 210, 210, 210, - 47, 210, 47, 210, 47, 210, 210, 134, 47, 47, - 210, 210, 47, 47, 210, 47, 47, 47, 210, 47, - 47, 47, 210, 47, 47, 47, 210, 47, 136, 210, - 135, 47, 47, 47, 137, 47, 210, 47, 210, 47, - - 210, 47, 210, 47, 210, 210, 210, 47, 210, 210, - 210, 47, 47, 47, 47, 210, 210, 210, 47, 47, - 47, 47, 47, 47, 210, 210, 47, 47, 47, 210, - 47, 47, 138, 210, 210, 47, 210, 47, 210, 210, - 47, 47, 47, 47, 210, 210, 210, 47, 47, 47, - 47, 210, 210, 210, 210, 47, 139, 47, 210, 47, - 47, 210, 47, 210, 47, 210, 47, 47, 210, 47, - 47, 47, 47, 210, 210, 210, 47, 47, 47, 47, - 210, 210, 210, 140, 47, 210, 47, 210, 47, 47, - 210, 47, 210, 47, 210, 47, 47, 210, 47, 47, - - 47, 47, 210, 210, 210, 47, 47, 47, 47, 210, - 47, 47, 47, 47, 141, 47, 150, 47, 47, 210, - 47, 210, 47, 210, 47, 47, 47, 47, 47, 210, - 210, 210, 210, 210, 47, 210, 210, 210, 47, 47, - 47, 47, 47, 47, 47, 47, 210, 47, 210, 47, - 47, 47, 47, 47, 47, 47, 210, 47, 47, 47, - 210, 47, 210, 210, 151, 210, 47, 47, 47, 210, - 210, 47, 210, 210, 152, 210, 210, 210, 47, 47, - 47, 47, 47, 210, 210, 210, 47, 47, 210, 210, - 210, 47, 210, 47, 153, 47, 210, 47, 47, 210, - - 47, 47, 47, 47, 47, 47, 210, 47, 210, 210, - 154, 210, 210, 210, 210, 210, 47, 155, 47, 47, - 210, 47, 47, 210, 210, 210, 210, 47, 47, 210, - 210, 47, 210, 210, 47, 47, 47, 210, 210, 210, - 210, 210, 210, 47, 210, 210, 47, 210, 47, 210, - 47, 47, 47, 156, 210, 47, 47, 47, 47, 47, - 47, 210, 47, 210, 210, 210, 210, 157, 210, 210, - 210, 47, 210, 47, 47, 210, 47, 47, 158, 47, - 47, 47, 47, 47, 210, 210, 47, 210, 210, 210, - 210, 210, 210, 210, 210, 47, 210, 47, 47, 210, - - 210, 47, 210, 47, 210, 210, 47, 47, 47, 47, - 47, 160, 210, 210, 47, 47, 47, 47, 47, 47, - 210, 210, 47, 159, 47, 169, 47, 47, 210, 210, - 47, 210, 47, 47, 210, 47, 47, 210, 210, 210, - 210, 210, 47, 210, 210, 47, 210, 210, 47, 47, - 47, 47, 210, 210, 210, 210, 47, 47, 210, 210, - 47, 210, 47, 210, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 210, 210, 210, 47, 210, 210, 210, - 210, 172, 170, 47, 210, 47, 47, 210, 47, 210, - 210, 47, 210, 210, 210, 47, 47, 171, 47, 210, - - 210, 47, 47, 47, 47, 47, 47, 210, 210, 210, - 47, 210, 210, 47, 210, 47, 210, 47, 47, 47, - 47, 210, 47, 47, 47, 47, 210, 210, 174, 47, - 210, 210, 47, 210, 210, 173, 210, 210, 210, 47, - 210, 47, 210, 210, 47, 210, 210, 47, 210, 47, - 210, 47, 47, 210, 47, 47, 47, 175, 47, 47, - 47, 177, 47, 47, 47, 210, 47, 210, 210, 210, - 47, 47, 47, 176, 47, 210, 47, 210, 47, 210, - 47, 210, 47, 210, 210, 210, 47, 210, 210, 210, - 47, 47, 47, 47, 210, 210, 184, 47, 210, 210, - - 210, 47, 47, 185, 210, 47, 47, 47, 210, 47, - 47, 210, 47, 47, 47, 47, 47, 47, 210, 47, - 210, 210, 210, 186, 210, 210, 210, 210, 47, 210, - 47, 47, 210, 47, 47, 210, 47, 47, 47, 47, - 47, 210, 210, 47, 210, 210, 187, 210, 210, 47, - 47, 47, 47, 210, 47, 47, 210, 210, 47, 210, - 47, 210, 210, 47, 47, 47, 210, 47, 210, 210, - 210, 47, 47, 47, 210, 210, 210, 47, 210, 47, - 47, 47, 47, 210, 47, 188, 210, 47, 210, 47, - 210, 210, 47, 47, 47, 47, 47, 47, 47, 47, - - 210, 210, 47, 47, 47, 191, 210, 210, 47, 47, - 210, 47, 210, 210, 47, 47, 47, 47, 47, 47, - 47, 47, 192, 47, 47, 47, 47, 210, 47, 210, - 47, 47, 210, 47, 210, 210, 47, 210, 210, 193, - 47, 47, 47, 47, 210, 47, 47, 47, 47, 210, - 47, 210, 47, 47, 47, 47, 210, 194, 47, 210, - 210, 210, 47, 47, 47, 210, 210, 47, 197, 47, - 210, 47, 47, 210, 47, 47, 47, 47, 210, 210, - 210, 47, 47, 47, 47, 210, 210, 210, 210, 47, - 210, 47, 210, 47, 47, 210, 47, 198, 47, 210, - - 47, 47, 210, 47, 199, 210, 47, 47, 47, 210, - 47, 210, 210, 200, 210, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 210, 210, 210, 210, - 47, 47, 201, 47, 47, 47, 210, 202, 210, 210, - 210, 210, 210, 47, 210, 210, 210, 47, 210, 47, - 47, 47, 47, 210, 47, 210, 210, 210, 47, 47, - 47, 47, 47, 47, 210, 210, 47, 47, 47, 203, - 210, 210, 47, 47, 47, 47, 210, 47, 47, 210, - 210, 210, 210, 204, 210, 210, 210, 47, 47, 210, - 47, 210, 210, 47, 47, 47, 47, 210, 47, 210, - - 47, 205, 47, 47, 47, 47, 210, 47, 210, 210, - 47, 210, 47, 210, 206, 47, 47, 47, 47, 47, - 47, 47, 47, 210, 210, 47, 47, 47, 210, 210, - 210, 47, 47, 210, 47, 210, 210, 47, 47, 47, - 47, 47, 47, 47, 47, 210, 47, 210, 210, 207, - 210, 47, 210, 47, 47, 210, 47, 210, 210, 47, - 208, 47, 47, 47, 47, 210, 47, 210, 47, 47, - 47, 47, 210, 47, 210, 210, 210, 47, 210, 47, - 210, 47, 47, 47, 47, 47, 47, 47, 210, 47, - 210, 210, 209, 210, 210, 210, 210, 47, 47, 210, - - 47, 210, 210, 210, 47, 210, 210, 210, 210, 47, - 47, 210, 47, 210, 210, 210, 210, 47, 210, 210, - 210, 210, 210, 210, 210, 47, 210, 210, 210, 210, - 47, 42, 42, 42, 47, 210, 47, 46, 210, 46, - 5, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - - 210, 210, 210, 210, 210, 210, 210 + 46, 46, 68, 46, 47, 47, 47, 68, 68, 46, + 47, 197, 53, 69, 53, 72, 74, 196, 73, 75, + + 47, 187, 47, 56, 47, 96, 97, 99, 100, 93, + 47, 184, 57, 122, 93, 93, 46, 126, 123, 53, + 69, 173, 127, 172, 47, 119, 102, 47, 102, 170, + 119, 119, 47, 169, 46, 46, 69, 168, 46, 46, + 46, 47, 47, 47, 46, 46, 46, 166, 46, 49, + 49, 50, 153, 102, 46, 167, 167, 47, 152, 47, + 47, 47, 47, 58, 151, 51, 150, 51, 149, 47, + 171, 171, 185, 185, 186, 186, 47, 52, 47, 59, + 148, 46, 188, 188, 47, 189, 189, 147, 47, 47, + 203, 203, 51, 47, 47, 47, 146, 52, 69, 46, + + 47, 47, 47, 47, 60, 204, 204, 129, 47, 47, + 128, 47, 125, 124, 101, 98, 47, 54, 47, 48, + 218, 47, 43, 55, 47, 47, 47, 41, 47, 218, + 218, 218, 218, 218, 218, 218, 47, 218, 50, 50, + 47, 47, 47, 47, 218, 218, 218, 218, 47, 61, + 218, 218, 47, 218, 53, 218, 53, 218, 218, 218, + 47, 47, 47, 218, 218, 218, 47, 47, 218, 218, + 218, 67, 47, 47, 47, 47, 47, 218, 47, 218, + 62, 53, 47, 47, 47, 218, 47, 218, 47, 47, + 218, 47, 218, 218, 218, 63, 218, 218, 47, 218, + + 47, 47, 218, 47, 218, 218, 218, 218, 47, 218, + 47, 47, 47, 47, 218, 218, 47, 218, 47, 47, + 47, 47, 47, 47, 47, 47, 70, 47, 218, 47, + 47, 218, 218, 64, 47, 218, 47, 65, 47, 47, + 47, 218, 66, 218, 218, 218, 47, 218, 218, 218, + 47, 47, 47, 47, 47, 218, 218, 71, 218, 47, + 218, 47, 218, 218, 218, 47, 47, 47, 218, 47, + 47, 218, 218, 218, 218, 218, 218, 218, 218, 47, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 47, 218, 218, 218, 218, 47, + + 76, 76, 76, 47, 47, 47, 218, 76, 76, 76, + 76, 76, 76, 218, 218, 218, 47, 218, 47, 47, + 218, 47, 218, 218, 218, 218, 218, 218, 47, 218, + 218, 47, 218, 218, 218, 76, 76, 76, 76, 76, + 76, 218, 218, 47, 218, 218, 47, 218, 47, 218, + 218, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 218, 218, 218, 218, 218, 218, 77, 47, 218, + 47, 47, 218, 47, 47, 218, 47, 218, 218, 218, + 47, 218, 79, 47, 218, 218, 47, 218, 218, 78, + 218, 218, 218, 218, 218, 47, 218, 218, 47, 218, + + 47, 47, 218, 47, 218, 218, 47, 47, 47, 47, + 47, 47, 47, 218, 218, 218, 80, 218, 218, 218, + 218, 218, 218, 47, 218, 47, 47, 218, 47, 218, + 81, 218, 218, 218, 218, 47, 218, 218, 47, 218, + 218, 218, 218, 218, 218, 218, 47, 47, 47, 218, + 47, 218, 218, 47, 218, 47, 218, 84, 47, 47, + 47, 47, 47, 218, 47, 218, 218, 218, 47, 47, + 47, 218, 218, 218, 47, 47, 218, 47, 218, 218, + 82, 218, 218, 83, 47, 218, 47, 47, 218, 47, + 218, 218, 85, 218, 47, 218, 47, 47, 47, 47, + + 218, 218, 47, 47, 47, 47, 218, 47, 218, 218, + 86, 47, 218, 47, 218, 47, 47, 218, 218, 47, + 218, 47, 218, 87, 218, 47, 218, 218, 218, 218, + 218, 47, 218, 218, 218, 218, 218, 218, 218, 218, + 47, 218, 218, 218, 218, 47, 47, 218, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 218, 88, + 218, 218, 218, 218, 47, 89, 47, 218, 47, 218, + 47, 47, 218, 47, 218, 218, 47, 91, 90, 218, + 47, 218, 218, 47, 218, 218, 47, 47, 47, 218, + 218, 47, 218, 218, 218, 47, 47, 218, 47, 218, + + 47, 218, 47, 47, 47, 47, 47, 47, 92, 47, + 47, 47, 218, 218, 47, 218, 218, 218, 218, 218, + 218, 47, 218, 47, 218, 47, 218, 47, 218, 47, + 218, 218, 218, 47, 47, 218, 218, 47, 218, 218, + 218, 218, 47, 47, 47, 218, 95, 218, 47, 218, + 218, 94, 47, 47, 218, 103, 218, 47, 47, 218, + 47, 47, 47, 47, 218, 47, 47, 47, 218, 218, + 47, 218, 218, 218, 218, 218, 218, 47, 218, 47, + 104, 47, 218, 47, 218, 47, 218, 105, 218, 47, + 47, 218, 218, 47, 47, 47, 47, 218, 47, 47, + + 47, 218, 218, 218, 47, 218, 218, 218, 47, 47, + 47, 106, 47, 47, 47, 218, 47, 218, 218, 218, + 218, 218, 47, 107, 218, 218, 47, 47, 47, 47, + 218, 218, 218, 47, 47, 47, 218, 47, 218, 218, + 218, 47, 47, 47, 109, 47, 47, 218, 218, 47, + 218, 47, 108, 218, 218, 47, 47, 47, 47, 218, + 218, 47, 47, 47, 47, 218, 218, 218, 218, 218, + 47, 218, 47, 218, 47, 47, 47, 110, 47, 218, + 47, 47, 218, 111, 47, 47, 47, 47, 218, 218, + 47, 47, 47, 47, 218, 218, 112, 218, 218, 47, + + 218, 47, 218, 47, 47, 47, 218, 47, 218, 47, + 47, 218, 218, 47, 47, 47, 47, 113, 218, 47, + 218, 218, 47, 47, 47, 218, 218, 218, 47, 218, + 47, 218, 47, 47, 47, 218, 114, 218, 47, 47, + 115, 218, 47, 47, 47, 47, 218, 218, 218, 218, + 47, 47, 47, 47, 116, 218, 218, 47, 218, 47, + 218, 47, 47, 218, 218, 47, 218, 47, 218, 47, + 47, 47, 47, 47, 47, 117, 218, 218, 218, 47, + 47, 47, 47, 218, 218, 218, 47, 218, 47, 218, + 47, 47, 218, 218, 47, 118, 47, 218, 47, 47, + + 47, 47, 47, 47, 218, 218, 218, 218, 47, 47, + 47, 47, 218, 218, 218, 47, 120, 47, 218, 47, + 47, 218, 218, 47, 218, 47, 218, 47, 47, 47, + 218, 218, 47, 47, 47, 218, 121, 47, 218, 218, + 218, 218, 218, 218, 47, 47, 47, 47, 47, 47, + 47, 130, 47, 47, 47, 47, 131, 47, 218, 218, + 47, 47, 218, 47, 218, 218, 218, 218, 218, 47, + 218, 47, 218, 47, 218, 47, 47, 47, 47, 218, + 47, 47, 132, 218, 47, 47, 47, 218, 47, 218, + 218, 218, 47, 47, 47, 218, 47, 134, 218, 218, + + 47, 47, 47, 218, 47, 47, 47, 47, 218, 133, + 218, 218, 47, 218, 218, 218, 218, 218, 218, 47, + 218, 47, 218, 47, 47, 218, 218, 47, 218, 135, + 218, 218, 47, 47, 47, 47, 47, 218, 218, 218, + 218, 47, 47, 47, 218, 47, 47, 47, 47, 218, + 47, 218, 47, 47, 218, 218, 136, 47, 218, 47, + 218, 47, 47, 47, 218, 218, 218, 218, 218, 47, + 137, 218, 218, 47, 47, 47, 47, 47, 47, 47, + 47, 218, 47, 218, 47, 47, 47, 47, 47, 47, + 47, 218, 47, 47, 47, 218, 47, 138, 142, 218, + + 139, 47, 47, 47, 218, 218, 47, 47, 47, 47, + 218, 218, 218, 47, 218, 218, 140, 47, 47, 47, + 47, 47, 47, 47, 218, 47, 47, 218, 47, 141, + 218, 218, 218, 47, 47, 47, 47, 218, 218, 218, + 47, 47, 47, 218, 218, 218, 47, 47, 47, 47, + 47, 47, 47, 47, 218, 47, 47, 218, 47, 218, + 218, 47, 143, 47, 218, 47, 47, 47, 47, 47, + 218, 218, 218, 218, 218, 47, 218, 218, 218, 47, + 47, 47, 47, 47, 218, 218, 144, 218, 47, 218, + 47, 47, 47, 47, 47, 47, 47, 218, 47, 47, + + 218, 218, 47, 47, 47, 218, 218, 47, 47, 47, + 218, 218, 218, 154, 218, 47, 47, 47, 47, 47, + 47, 218, 218, 47, 145, 218, 218, 218, 47, 218, + 47, 47, 218, 47, 47, 218, 47, 47, 47, 47, + 218, 218, 218, 47, 218, 47, 155, 218, 218, 218, + 47, 218, 47, 218, 47, 47, 47, 47, 47, 47, + 47, 47, 218, 47, 47, 218, 218, 218, 218, 218, + 218, 47, 218, 47, 218, 47, 218, 47, 218, 47, + 218, 218, 218, 47, 47, 218, 218, 47, 47, 47, + 47, 218, 218, 218, 47, 47, 47, 218, 47, 218, + + 218, 218, 47, 47, 47, 218, 47, 47, 218, 156, + 47, 218, 47, 218, 218, 218, 47, 218, 157, 218, + 218, 218, 47, 47, 47, 47, 218, 218, 218, 218, + 218, 47, 218, 218, 218, 218, 47, 47, 158, 47, + 218, 47, 47, 218, 47, 47, 47, 47, 47, 47, + 218, 47, 218, 218, 159, 218, 218, 218, 218, 218, + 47, 160, 47, 47, 218, 47, 47, 218, 218, 218, + 218, 47, 47, 218, 218, 47, 218, 218, 47, 47, + 47, 218, 218, 218, 218, 218, 218, 47, 218, 218, + 47, 218, 47, 218, 47, 47, 47, 161, 218, 47, + + 47, 47, 47, 47, 47, 218, 47, 218, 218, 218, + 218, 162, 218, 218, 218, 47, 218, 47, 47, 218, + 47, 47, 163, 47, 47, 47, 47, 47, 218, 218, + 47, 218, 218, 218, 218, 218, 218, 218, 218, 47, + 218, 47, 47, 218, 218, 47, 218, 47, 218, 218, + 47, 47, 47, 47, 47, 165, 218, 218, 218, 47, + 47, 47, 218, 47, 47, 47, 47, 164, 47, 174, + 47, 47, 218, 218, 175, 47, 218, 47, 218, 47, + 47, 47, 218, 218, 218, 218, 218, 47, 218, 218, + 218, 47, 47, 47, 47, 47, 47, 47, 47, 218, + + 47, 218, 47, 47, 47, 47, 47, 47, 47, 218, + 47, 47, 47, 218, 47, 218, 218, 218, 218, 47, + 47, 47, 218, 218, 47, 47, 47, 47, 218, 218, + 176, 47, 218, 177, 218, 47, 178, 218, 218, 47, + 47, 47, 218, 47, 47, 218, 47, 47, 47, 47, + 218, 47, 218, 47, 47, 47, 47, 218, 47, 47, + 47, 218, 218, 47, 218, 47, 218, 218, 47, 218, + 47, 218, 47, 47, 47, 47, 47, 218, 180, 218, + 218, 179, 47, 218, 218, 218, 47, 218, 218, 218, + 47, 218, 181, 218, 218, 47, 218, 47, 47, 47, + + 47, 47, 47, 218, 218, 218, 47, 47, 47, 47, + 183, 47, 47, 47, 47, 218, 47, 182, 218, 218, + 218, 218, 190, 47, 218, 47, 47, 47, 218, 47, + 218, 218, 218, 218, 218, 47, 218, 218, 218, 47, + 218, 47, 47, 47, 47, 218, 47, 218, 218, 218, + 47, 47, 47, 47, 47, 47, 218, 218, 47, 47, + 47, 218, 218, 192, 47, 47, 47, 47, 218, 47, + 47, 218, 218, 218, 218, 193, 191, 218, 218, 47, + 47, 218, 47, 218, 218, 47, 47, 47, 47, 218, + 47, 218, 47, 218, 47, 47, 47, 47, 218, 47, + + 218, 218, 47, 218, 47, 194, 218, 47, 47, 47, + 47, 47, 47, 47, 47, 218, 218, 47, 47, 47, + 218, 218, 218, 47, 47, 218, 47, 218, 218, 47, + 218, 195, 218, 47, 47, 47, 47, 218, 47, 47, + 47, 47, 218, 47, 218, 47, 218, 218, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 198, 218, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 218, + 47, 218, 200, 199, 218, 218, 47, 47, 218, 47, + 47, 218, 47, 47, 47, 47, 218, 47, 218, 47, + 218, 47, 47, 47, 47, 47, 47, 218, 218, 47, + + 47, 47, 218, 218, 47, 218, 218, 201, 47, 47, + 47, 47, 218, 218, 47, 47, 47, 218, 218, 218, + 47, 47, 47, 47, 218, 202, 47, 218, 218, 218, + 47, 47, 47, 218, 218, 47, 218, 47, 218, 47, + 47, 218, 47, 47, 47, 47, 218, 218, 218, 47, + 47, 47, 47, 218, 218, 218, 218, 47, 205, 47, + 218, 47, 47, 218, 47, 218, 47, 218, 47, 47, + 218, 47, 206, 218, 47, 47, 47, 218, 47, 218, + 218, 47, 47, 47, 218, 218, 47, 218, 208, 218, + 47, 47, 47, 47, 218, 218, 207, 47, 47, 47, + + 218, 218, 47, 47, 47, 47, 218, 218, 218, 47, + 47, 47, 47, 218, 47, 47, 47, 47, 218, 47, + 209, 47, 47, 218, 47, 218, 47, 218, 210, 47, + 47, 47, 47, 218, 218, 218, 218, 218, 47, 218, + 218, 218, 47, 47, 47, 47, 47, 218, 218, 218, + 213, 47, 218, 47, 47, 47, 47, 47, 47, 47, + 218, 47, 47, 218, 211, 47, 47, 47, 218, 218, + 47, 47, 47, 218, 218, 218, 212, 218, 47, 47, + 47, 47, 47, 47, 218, 218, 47, 218, 218, 214, + 218, 47, 218, 47, 47, 218, 47, 47, 218, 47, + + 47, 47, 47, 218, 218, 218, 47, 218, 47, 218, + 218, 218, 218, 47, 218, 47, 218, 47, 218, 218, + 218, 47, 47, 47, 47, 218, 47, 47, 218, 218, + 218, 218, 218, 47, 47, 47, 218, 218, 47, 218, + 47, 218, 47, 218, 218, 218, 215, 47, 218, 47, + 47, 47, 218, 218, 218, 216, 47, 47, 47, 218, + 218, 47, 47, 47, 47, 47, 218, 218, 218, 218, + 47, 218, 47, 218, 47, 218, 47, 218, 47, 218, + 47, 47, 218, 218, 47, 217, 218, 218, 218, 218, + 47, 47, 47, 47, 218, 218, 218, 218, 218, 47, + + 218, 218, 218, 218, 47, 47, 218, 47, 218, 47, + 47, 218, 218, 218, 218, 218, 218, 218, 218, 47, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 47, 218, 218, 218, 218, 47, + 42, 42, 42, 47, 218, 47, 46, 218, 46, 5, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218 } ; -static yyconst short int yy_chk[2208] = +static yyconst short int yy_chk[2317] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -738,242 +753,254 @@ static yyconst short int yy_chk[2208] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 8, 8, - 17, 44, 44, 17, 17, 17, 20, 20, 212, 17, - 17, 17, 34, 17, 25, 25, 25, 34, 34, 17, - 49, 181, 20, 34, 20, 41, 43, 178, 41, 43, - - 25, 25, 25, 67, 20, 71, 71, 165, 67, 67, - 49, 161, 25, 149, 67, 148, 17, 73, 73, 20, - 75, 94, 75, 97, 20, 91, 94, 25, 97, 146, - 91, 91, 25, 145, 17, 19, 91, 144, 19, 19, - 19, 26, 26, 26, 19, 19, 19, 75, 19, 19, - 19, 19, 143, 143, 19, 147, 147, 26, 142, 26, - 26, 163, 163, 164, 164, 19, 126, 19, 125, 26, - 167, 167, 27, 27, 27, 168, 168, 19, 189, 189, - 124, 19, 190, 190, 26, 28, 28, 28, 27, 26, - 27, 123, 19, 122, 27, 121, 120, 19, 119, 19, - - 27, 28, 116, 28, 28, 99, 29, 29, 29, 98, - 96, 95, 74, 28, 72, 27, 18, 29, 5, 4, - 27, 2, 29, 0, 29, 30, 30, 30, 28, 33, - 33, 33, 0, 28, 29, 0, 0, 0, 0, 0, - 33, 30, 0, 30, 0, 33, 0, 33, 0, 29, - 30, 0, 0, 30, 29, 0, 0, 33, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, - 0, 0, 33, 30, 31, 31, 31, 33, 0, 0, - 0, 31, 0, 36, 36, 36, 0, 37, 37, 37, - 31, 0, 31, 0, 0, 0, 31, 0, 0, 36, - - 0, 36, 31, 37, 0, 37, 0, 0, 0, 0, - 0, 36, 0, 0, 0, 37, 0, 31, 0, 0, - 0, 0, 31, 32, 32, 32, 36, 36, 0, 0, - 37, 36, 0, 37, 32, 37, 50, 50, 32, 32, - 0, 32, 0, 32, 47, 47, 47, 51, 51, 51, - 0, 32, 50, 0, 50, 0, 0, 0, 0, 0, - 47, 0, 47, 51, 50, 51, 32, 0, 0, 0, - 0, 32, 47, 0, 0, 51, 0, 0, 0, 50, - 0, 0, 0, 0, 50, 0, 0, 47, 0, 0, - 51, 0, 47, 0, 0, 51, 52, 52, 52, 53, - - 53, 53, 0, 52, 52, 52, 52, 52, 52, 0, - 0, 0, 52, 0, 52, 53, 0, 53, 0, 0, - 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, - 0, 52, 52, 52, 52, 52, 52, 0, 0, 52, - 0, 0, 53, 0, 52, 0, 0, 53, 54, 54, - 54, 55, 55, 55, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 54, 54, 0, 54, 55, 0, 55, - 0, 0, 56, 56, 56, 55, 54, 0, 0, 55, - 0, 56, 0, 0, 0, 57, 57, 57, 56, 0, - 56, 54, 0, 0, 55, 0, 54, 0, 0, 55, - - 56, 57, 0, 57, 0, 57, 0, 0, 0, 0, - 0, 0, 0, 57, 0, 56, 0, 0, 0, 0, - 56, 59, 59, 59, 0, 0, 0, 0, 57, 0, - 0, 0, 59, 57, 58, 58, 58, 59, 0, 59, - 0, 0, 0, 60, 60, 60, 0, 0, 0, 59, - 58, 0, 58, 0, 0, 58, 0, 0, 58, 60, - 0, 60, 58, 0, 59, 0, 0, 60, 0, 59, - 0, 60, 61, 61, 61, 0, 0, 58, 62, 62, - 62, 0, 58, 0, 0, 61, 60, 0, 61, 0, - 61, 60, 0, 0, 62, 0, 62, 0, 62, 0, - - 61, 0, 0, 0, 0, 0, 62, 0, 0, 0, - 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, - 61, 62, 0, 64, 64, 64, 62, 63, 63, 63, - 65, 65, 65, 0, 63, 0, 0, 0, 0, 64, - 63, 64, 0, 63, 0, 63, 65, 0, 65, 0, - 0, 64, 65, 64, 0, 63, 0, 0, 65, 0, - 0, 66, 66, 66, 0, 0, 64, 0, 0, 0, - 63, 64, 0, 65, 0, 63, 0, 66, 65, 66, - 69, 69, 69, 66, 70, 70, 70, 0, 0, 66, - 0, 0, 0, 0, 0, 0, 69, 0, 69, 0, - - 70, 0, 70, 0, 66, 0, 0, 0, 69, 66, - 0, 0, 70, 0, 0, 0, 0, 76, 76, 76, - 0, 70, 0, 69, 0, 0, 69, 70, 69, 0, - 76, 0, 70, 76, 0, 76, 77, 77, 77, 78, - 78, 78, 0, 0, 0, 76, 0, 0, 0, 0, - 0, 0, 77, 0, 77, 78, 78, 78, 77, 0, - 76, 0, 0, 0, 77, 76, 0, 78, 0, 0, - 79, 79, 79, 0, 80, 80, 80, 0, 0, 77, - 0, 0, 78, 0, 77, 0, 79, 78, 79, 0, - 80, 0, 80, 0, 0, 79, 0, 0, 79, 80, - - 0, 0, 80, 81, 81, 81, 0, 82, 82, 82, - 0, 0, 0, 79, 81, 0, 0, 80, 79, 81, - 0, 81, 80, 82, 0, 82, 0, 0, 82, 0, - 0, 81, 0, 0, 0, 82, 83, 83, 83, 0, - 0, 0, 84, 84, 84, 0, 81, 0, 0, 0, - 82, 81, 83, 84, 83, 82, 0, 83, 84, 0, - 84, 0, 0, 0, 83, 85, 85, 85, 0, 0, - 84, 0, 0, 0, 0, 0, 86, 86, 86, 83, - 0, 85, 0, 85, 83, 84, 0, 87, 87, 87, - 84, 85, 86, 85, 86, 0, 0, 0, 86, 0, - - 88, 88, 88, 87, 86, 87, 0, 0, 85, 0, - 0, 88, 0, 85, 0, 87, 88, 0, 88, 86, - 0, 89, 89, 89, 86, 0, 0, 0, 88, 0, - 87, 0, 0, 0, 0, 87, 0, 89, 0, 89, - 90, 90, 90, 88, 0, 89, 0, 0, 88, 89, - 0, 0, 0, 0, 0, 0, 90, 0, 90, 92, - 92, 92, 0, 90, 89, 0, 0, 0, 90, 89, - 0, 0, 0, 0, 0, 92, 0, 92, 93, 93, - 93, 0, 0, 90, 0, 0, 0, 92, 90, 0, - 0, 0, 0, 0, 93, 92, 93, 0, 0, 100, - - 100, 100, 92, 0, 0, 0, 93, 92, 0, 0, - 0, 0, 0, 93, 0, 100, 0, 100, 101, 101, - 101, 93, 102, 102, 102, 0, 93, 100, 0, 0, - 0, 0, 0, 0, 101, 0, 101, 101, 102, 0, - 102, 0, 100, 0, 0, 0, 101, 100, 0, 0, - 102, 102, 0, 103, 103, 103, 104, 104, 104, 0, - 0, 101, 0, 0, 0, 102, 101, 0, 0, 103, - 102, 103, 104, 0, 104, 0, 0, 104, 103, 0, - 0, 103, 0, 0, 104, 0, 0, 105, 105, 105, - 106, 106, 106, 0, 0, 0, 103, 0, 0, 104, - - 0, 103, 0, 105, 104, 105, 106, 0, 106, 0, - 0, 105, 106, 0, 0, 105, 0, 0, 106, 0, - 0, 107, 107, 107, 0, 108, 108, 108, 0, 0, - 105, 0, 0, 106, 0, 105, 0, 107, 106, 107, - 0, 108, 0, 108, 109, 109, 109, 0, 0, 107, - 108, 0, 0, 108, 0, 0, 0, 0, 0, 0, - 109, 0, 109, 0, 107, 0, 0, 109, 108, 107, - 0, 0, 109, 108, 0, 110, 110, 110, 0, 111, - 111, 111, 0, 112, 112, 112, 0, 109, 111, 0, - 110, 110, 109, 110, 112, 111, 0, 111, 0, 112, - - 0, 112, 0, 110, 0, 0, 0, 111, 0, 0, - 0, 112, 113, 113, 113, 0, 0, 0, 110, 114, - 114, 114, 111, 110, 0, 0, 112, 111, 113, 0, - 113, 112, 113, 0, 0, 114, 0, 114, 0, 0, - 113, 115, 115, 115, 0, 0, 0, 114, 117, 117, - 117, 0, 0, 0, 0, 113, 115, 115, 0, 115, - 113, 0, 114, 0, 117, 0, 117, 114, 0, 115, - 118, 118, 118, 0, 0, 0, 117, 127, 127, 127, - 0, 0, 0, 117, 115, 0, 118, 0, 118, 115, - 0, 117, 0, 127, 0, 127, 117, 0, 118, 128, - - 128, 128, 0, 0, 0, 127, 129, 129, 129, 0, - 130, 130, 130, 118, 118, 128, 129, 128, 118, 0, - 127, 0, 129, 0, 129, 127, 130, 128, 130, 0, - 0, 0, 0, 0, 129, 0, 0, 0, 130, 131, - 131, 131, 128, 132, 132, 132, 0, 128, 0, 129, - 133, 133, 133, 130, 129, 131, 0, 131, 130, 132, - 0, 132, 0, 0, 132, 0, 133, 131, 133, 0, - 0, 132, 0, 0, 133, 0, 0, 0, 133, 134, - 134, 134, 131, 0, 0, 0, 132, 131, 0, 0, - 0, 132, 0, 133, 134, 134, 0, 134, 133, 0, - - 135, 135, 135, 136, 136, 136, 0, 134, 0, 0, - 135, 0, 0, 0, 0, 0, 135, 136, 135, 136, - 0, 136, 134, 0, 0, 0, 0, 134, 135, 0, - 0, 136, 0, 0, 137, 137, 137, 0, 0, 0, - 0, 0, 0, 135, 0, 0, 136, 0, 135, 0, - 137, 136, 137, 137, 0, 138, 138, 138, 139, 139, - 139, 0, 137, 0, 0, 0, 0, 138, 0, 0, - 0, 138, 0, 138, 139, 0, 139, 137, 139, 140, - 140, 140, 137, 138, 0, 0, 139, 0, 0, 0, - 0, 0, 0, 0, 0, 140, 0, 140, 138, 0, - - 0, 139, 0, 138, 0, 0, 139, 140, 141, 141, - 141, 141, 0, 0, 150, 150, 150, 151, 151, 151, - 0, 0, 140, 140, 141, 150, 141, 140, 0, 0, - 150, 0, 150, 151, 0, 151, 141, 0, 0, 0, - 0, 0, 150, 0, 0, 151, 0, 0, 152, 152, - 152, 141, 0, 0, 0, 0, 141, 150, 0, 0, - 151, 0, 150, 0, 152, 151, 152, 153, 153, 153, - 154, 154, 154, 0, 0, 0, 152, 0, 0, 0, - 0, 154, 152, 153, 0, 153, 154, 0, 154, 0, - 0, 152, 0, 0, 0, 153, 152, 153, 154, 0, - - 0, 155, 155, 155, 156, 156, 156, 0, 0, 0, - 153, 0, 0, 154, 0, 153, 0, 155, 154, 155, - 156, 0, 156, 157, 157, 157, 0, 0, 156, 155, - 0, 0, 156, 0, 0, 155, 0, 0, 0, 157, - 0, 157, 0, 0, 155, 0, 0, 156, 0, 155, - 0, 157, 156, 0, 158, 158, 158, 157, 159, 159, - 159, 159, 169, 169, 169, 0, 157, 0, 0, 0, - 158, 157, 158, 158, 159, 0, 159, 0, 169, 0, - 169, 0, 158, 0, 0, 0, 159, 0, 0, 0, - 169, 170, 170, 170, 0, 0, 169, 158, 0, 0, - - 0, 159, 158, 170, 0, 169, 159, 170, 0, 170, - 169, 0, 171, 171, 171, 172, 172, 172, 0, 170, - 0, 0, 0, 171, 0, 0, 0, 0, 171, 0, - 171, 172, 0, 172, 170, 0, 173, 173, 173, 170, - 171, 0, 0, 172, 0, 0, 173, 0, 0, 174, - 174, 174, 173, 0, 173, 171, 0, 0, 172, 0, - 171, 0, 0, 172, 173, 174, 0, 174, 0, 0, - 0, 175, 175, 175, 0, 0, 0, 174, 0, 173, - 176, 176, 176, 0, 173, 175, 0, 175, 0, 175, - 0, 0, 174, 184, 184, 184, 176, 174, 176, 175, - - 0, 0, 185, 185, 185, 184, 0, 0, 176, 184, - 0, 184, 0, 0, 175, 186, 186, 186, 185, 175, - 185, 184, 185, 176, 187, 187, 187, 0, 176, 0, - 185, 186, 0, 186, 0, 0, 184, 0, 0, 187, - 187, 184, 187, 186, 0, 185, 188, 188, 188, 0, - 185, 0, 187, 191, 191, 191, 0, 188, 186, 0, - 0, 0, 188, 186, 188, 0, 0, 187, 191, 191, - 0, 191, 187, 0, 188, 192, 192, 192, 0, 0, - 0, 191, 193, 193, 193, 0, 0, 0, 0, 188, - 0, 192, 0, 192, 188, 0, 191, 192, 193, 0, - - 193, 191, 0, 192, 193, 0, 194, 194, 194, 0, - 193, 0, 0, 194, 0, 197, 197, 197, 192, 198, - 198, 198, 194, 192, 194, 193, 0, 0, 0, 0, - 193, 197, 197, 197, 194, 198, 0, 198, 0, 0, - 0, 0, 0, 197, 0, 0, 0, 198, 0, 194, - 199, 199, 199, 0, 194, 0, 0, 0, 197, 200, - 200, 200, 198, 197, 0, 0, 199, 198, 199, 200, - 0, 0, 201, 201, 201, 200, 0, 200, 199, 0, - 0, 0, 0, 201, 0, 0, 0, 200, 201, 0, - 201, 0, 0, 199, 202, 202, 202, 0, 199, 0, - - 201, 202, 200, 203, 203, 203, 0, 200, 0, 0, - 202, 0, 202, 0, 203, 201, 204, 204, 204, 203, - 201, 203, 202, 0, 0, 205, 205, 205, 0, 0, - 0, 203, 204, 0, 204, 0, 0, 202, 206, 206, - 206, 205, 202, 205, 204, 0, 203, 0, 0, 205, - 0, 203, 0, 205, 206, 0, 206, 0, 0, 204, - 206, 207, 207, 207, 204, 0, 206, 0, 205, 208, - 208, 208, 0, 205, 0, 0, 0, 207, 0, 207, - 0, 206, 209, 209, 209, 208, 206, 208, 0, 207, - 0, 0, 208, 0, 0, 0, 0, 208, 209, 0, - - 209, 0, 0, 0, 207, 0, 0, 0, 0, 207, - 209, 0, 208, 0, 0, 0, 0, 208, 0, 0, - 0, 0, 0, 0, 0, 209, 0, 0, 0, 0, - 209, 211, 211, 211, 213, 0, 213, 214, 0, 214, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - - 210, 210, 210, 210, 210, 210, 210 + 17, 44, 44, 17, 17, 17, 20, 20, 220, 17, + 17, 17, 34, 17, 26, 26, 26, 34, 34, 17, + 49, 187, 20, 34, 20, 41, 43, 184, 41, 43, + + 26, 170, 26, 26, 20, 72, 72, 74, 74, 68, + 49, 166, 26, 96, 68, 68, 17, 99, 96, 20, + 68, 153, 99, 152, 20, 93, 76, 26, 76, 150, + 93, 93, 26, 149, 17, 19, 93, 148, 19, 19, + 19, 27, 27, 27, 19, 19, 19, 146, 19, 19, + 19, 19, 129, 76, 19, 147, 147, 27, 128, 27, + 28, 28, 28, 27, 127, 19, 126, 19, 125, 27, + 151, 151, 168, 168, 169, 169, 28, 19, 28, 28, + 124, 19, 172, 172, 27, 173, 173, 123, 28, 27, + 196, 196, 19, 29, 29, 29, 122, 19, 119, 19, + + 25, 25, 25, 28, 29, 197, 197, 101, 28, 29, + 100, 29, 98, 97, 75, 73, 25, 25, 25, 18, + 5, 29, 4, 25, 30, 30, 30, 2, 25, 0, + 0, 0, 0, 0, 0, 0, 29, 0, 50, 50, + 30, 29, 30, 25, 0, 0, 0, 0, 25, 30, + 0, 0, 30, 0, 50, 0, 50, 0, 0, 0, + 33, 33, 33, 0, 0, 0, 50, 30, 0, 0, + 0, 33, 30, 31, 31, 31, 33, 0, 33, 0, + 31, 50, 36, 36, 36, 0, 50, 0, 33, 31, + 0, 31, 0, 0, 0, 31, 0, 0, 36, 0, + + 36, 31, 0, 33, 0, 0, 0, 0, 33, 0, + 36, 37, 37, 37, 0, 0, 31, 0, 47, 47, + 47, 31, 32, 32, 32, 36, 36, 37, 0, 37, + 36, 0, 0, 32, 47, 0, 47, 32, 32, 37, + 32, 0, 32, 0, 0, 0, 47, 0, 0, 0, + 32, 51, 51, 51, 37, 0, 0, 37, 0, 37, + 0, 47, 0, 0, 0, 32, 47, 51, 0, 51, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 51, 0, 0, 0, 0, 51, + + 52, 52, 52, 53, 53, 53, 0, 52, 52, 52, + 52, 52, 52, 0, 0, 0, 52, 0, 52, 53, + 0, 53, 0, 0, 0, 0, 0, 0, 52, 0, + 0, 53, 0, 0, 0, 52, 52, 52, 52, 52, + 52, 0, 0, 52, 0, 0, 53, 0, 52, 0, + 0, 53, 54, 54, 54, 55, 55, 55, 56, 56, + 56, 0, 0, 0, 0, 0, 0, 54, 54, 0, + 54, 55, 0, 55, 56, 0, 56, 0, 0, 0, + 54, 0, 56, 55, 0, 0, 56, 0, 0, 55, + 0, 0, 0, 0, 0, 54, 0, 0, 55, 0, + + 54, 56, 0, 55, 0, 0, 56, 57, 57, 57, + 58, 58, 58, 0, 0, 0, 57, 0, 0, 0, + 0, 0, 0, 57, 0, 57, 58, 0, 58, 0, + 58, 0, 0, 0, 0, 57, 0, 0, 58, 0, + 0, 0, 0, 0, 0, 0, 60, 60, 60, 0, + 57, 0, 0, 58, 0, 57, 0, 60, 58, 59, + 59, 59, 60, 0, 60, 0, 0, 0, 61, 61, + 61, 0, 0, 0, 60, 59, 0, 59, 0, 0, + 59, 0, 0, 59, 61, 0, 61, 59, 0, 60, + 0, 0, 61, 0, 60, 0, 61, 62, 62, 62, + + 0, 0, 59, 63, 63, 63, 0, 59, 0, 0, + 62, 61, 0, 62, 0, 62, 61, 0, 0, 63, + 0, 63, 0, 63, 0, 62, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 62, 0, 0, 0, 0, 62, 63, 0, 65, 65, + 65, 63, 64, 64, 64, 66, 66, 66, 0, 64, + 0, 0, 0, 0, 65, 64, 65, 0, 64, 0, + 64, 66, 0, 66, 0, 0, 65, 66, 65, 0, + 64, 0, 0, 66, 0, 0, 67, 67, 67, 0, + 0, 65, 0, 0, 0, 64, 65, 0, 66, 0, + + 64, 0, 67, 66, 67, 70, 70, 70, 67, 71, + 71, 71, 0, 0, 67, 0, 0, 0, 0, 0, + 0, 70, 0, 70, 0, 71, 0, 71, 0, 67, + 0, 0, 0, 70, 67, 0, 0, 71, 0, 0, + 0, 0, 77, 77, 77, 0, 71, 0, 70, 0, + 0, 70, 71, 70, 0, 77, 0, 71, 77, 0, + 77, 78, 78, 78, 0, 79, 79, 79, 0, 0, + 77, 0, 0, 0, 0, 0, 0, 78, 0, 78, + 78, 79, 0, 79, 0, 77, 0, 79, 0, 78, + 77, 0, 0, 79, 80, 80, 80, 0, 81, 81, + + 81, 0, 0, 0, 78, 0, 0, 0, 79, 78, + 80, 80, 80, 79, 81, 0, 81, 0, 0, 0, + 0, 0, 80, 81, 0, 0, 81, 82, 82, 82, + 0, 0, 0, 83, 83, 83, 0, 80, 0, 0, + 0, 81, 80, 82, 83, 82, 81, 0, 0, 83, + 0, 83, 82, 0, 0, 82, 84, 84, 84, 0, + 0, 83, 85, 85, 85, 0, 0, 0, 0, 0, + 82, 0, 84, 0, 84, 82, 83, 84, 85, 0, + 85, 83, 0, 85, 84, 86, 86, 86, 0, 0, + 85, 87, 87, 87, 0, 0, 86, 0, 0, 84, + + 0, 86, 0, 86, 84, 85, 0, 87, 0, 87, + 85, 0, 0, 86, 88, 88, 88, 87, 0, 87, + 0, 0, 89, 89, 89, 0, 0, 0, 86, 0, + 88, 0, 88, 86, 87, 0, 88, 0, 89, 87, + 89, 0, 88, 90, 90, 90, 0, 0, 0, 0, + 89, 91, 91, 91, 90, 0, 0, 88, 0, 90, + 0, 90, 88, 0, 0, 89, 0, 91, 0, 91, + 89, 90, 92, 92, 92, 91, 0, 0, 0, 91, + 94, 94, 94, 0, 0, 0, 90, 0, 92, 0, + 92, 90, 0, 0, 91, 92, 94, 0, 94, 91, + + 92, 95, 95, 95, 0, 0, 0, 0, 94, 102, + 102, 102, 0, 0, 0, 92, 94, 95, 0, 95, + 92, 0, 0, 94, 0, 102, 0, 102, 94, 95, + 0, 0, 103, 103, 103, 0, 95, 102, 0, 0, + 0, 0, 0, 0, 95, 104, 104, 104, 103, 95, + 103, 103, 102, 105, 105, 105, 104, 102, 0, 0, + 103, 104, 0, 104, 0, 0, 0, 0, 0, 105, + 0, 105, 0, 104, 0, 103, 107, 107, 107, 0, + 103, 105, 105, 0, 106, 106, 106, 0, 104, 0, + 0, 0, 107, 104, 107, 0, 105, 107, 0, 0, + + 106, 105, 106, 0, 107, 108, 108, 108, 0, 106, + 0, 0, 106, 0, 0, 0, 0, 0, 0, 107, + 0, 108, 0, 108, 107, 0, 0, 106, 0, 108, + 0, 0, 106, 108, 109, 109, 109, 0, 0, 0, + 0, 110, 110, 110, 0, 111, 111, 111, 108, 0, + 109, 0, 109, 108, 0, 0, 109, 110, 0, 110, + 0, 111, 109, 111, 0, 0, 0, 0, 0, 110, + 111, 0, 0, 111, 112, 112, 112, 109, 116, 116, + 116, 0, 109, 0, 110, 113, 113, 113, 111, 110, + 112, 0, 112, 111, 116, 0, 116, 112, 116, 0, + + 113, 113, 112, 113, 0, 0, 116, 114, 114, 114, + 0, 0, 0, 113, 0, 0, 114, 112, 115, 115, + 115, 116, 112, 114, 0, 114, 116, 0, 113, 115, + 0, 0, 0, 113, 115, 114, 115, 0, 0, 0, + 117, 117, 117, 0, 0, 0, 115, 118, 118, 118, + 114, 120, 120, 120, 0, 114, 117, 0, 117, 0, + 0, 115, 118, 118, 0, 118, 115, 120, 117, 120, + 0, 0, 0, 0, 0, 118, 0, 0, 0, 120, + 121, 121, 121, 117, 0, 0, 120, 0, 117, 0, + 118, 130, 130, 130, 120, 118, 121, 0, 121, 120, + + 0, 0, 131, 131, 131, 0, 0, 130, 121, 130, + 0, 0, 0, 131, 0, 132, 132, 132, 131, 130, + 131, 0, 0, 121, 121, 0, 0, 0, 121, 0, + 131, 132, 0, 132, 130, 0, 133, 133, 133, 130, + 0, 0, 0, 132, 0, 131, 133, 0, 0, 0, + 131, 0, 133, 0, 133, 134, 134, 134, 132, 135, + 135, 135, 0, 132, 133, 0, 0, 0, 0, 0, + 0, 134, 0, 134, 0, 135, 0, 135, 0, 133, + 0, 0, 0, 134, 133, 0, 0, 135, 136, 136, + 136, 0, 0, 0, 137, 137, 137, 0, 134, 0, + + 0, 0, 135, 134, 136, 0, 136, 135, 0, 136, + 137, 0, 137, 0, 0, 0, 136, 0, 137, 0, + 0, 0, 137, 138, 138, 138, 0, 0, 0, 0, + 0, 136, 0, 0, 0, 0, 136, 137, 138, 138, + 0, 138, 137, 0, 139, 139, 139, 140, 140, 140, + 0, 138, 0, 0, 139, 0, 0, 0, 0, 0, + 139, 140, 139, 140, 0, 140, 138, 0, 0, 0, + 0, 138, 139, 0, 0, 140, 0, 0, 141, 141, + 141, 0, 0, 0, 0, 0, 0, 139, 0, 0, + 140, 0, 139, 0, 141, 140, 141, 141, 0, 142, + + 142, 142, 143, 143, 143, 0, 141, 0, 0, 0, + 0, 142, 0, 0, 0, 142, 0, 142, 143, 0, + 143, 141, 143, 144, 144, 144, 141, 142, 0, 0, + 143, 0, 0, 0, 0, 0, 0, 0, 0, 144, + 0, 144, 142, 0, 0, 143, 0, 142, 0, 0, + 143, 144, 145, 145, 145, 145, 0, 0, 0, 154, + 154, 154, 0, 155, 155, 155, 144, 144, 145, 154, + 145, 144, 0, 0, 155, 154, 0, 154, 0, 155, + 145, 155, 0, 0, 0, 0, 0, 154, 0, 0, + 0, 155, 156, 156, 156, 145, 157, 157, 157, 0, + + 145, 0, 154, 158, 158, 158, 155, 154, 156, 0, + 156, 155, 157, 0, 157, 0, 0, 0, 0, 158, + 156, 158, 0, 0, 157, 159, 159, 159, 0, 0, + 157, 158, 0, 158, 0, 156, 159, 0, 0, 157, + 156, 159, 0, 159, 157, 0, 158, 160, 160, 160, + 0, 158, 0, 159, 161, 161, 161, 0, 162, 162, + 162, 0, 0, 160, 0, 160, 0, 0, 159, 0, + 161, 0, 161, 159, 162, 160, 162, 0, 161, 0, + 0, 160, 161, 0, 0, 0, 162, 0, 0, 0, + 160, 0, 162, 0, 0, 160, 0, 161, 163, 163, + + 163, 162, 161, 0, 0, 0, 162, 164, 164, 164, + 164, 174, 174, 174, 163, 0, 163, 163, 0, 0, + 0, 0, 174, 164, 0, 164, 163, 174, 0, 174, + 0, 0, 0, 0, 0, 164, 0, 0, 0, 174, + 0, 163, 175, 175, 175, 0, 163, 0, 0, 0, + 164, 176, 176, 176, 174, 164, 0, 0, 175, 174, + 175, 0, 0, 176, 177, 177, 177, 176, 0, 176, + 175, 0, 0, 0, 0, 177, 175, 0, 0, 176, + 177, 0, 177, 0, 0, 175, 178, 178, 178, 0, + 175, 0, 177, 0, 176, 179, 179, 179, 0, 176, + + 0, 0, 178, 0, 178, 179, 0, 177, 180, 180, + 180, 179, 177, 179, 178, 0, 0, 181, 181, 181, + 0, 0, 0, 179, 180, 0, 180, 0, 0, 178, + 0, 181, 0, 181, 178, 181, 180, 0, 179, 182, + 182, 182, 0, 179, 0, 181, 0, 0, 190, 190, + 190, 180, 192, 192, 192, 182, 180, 182, 190, 0, + 181, 191, 191, 191, 190, 181, 190, 182, 192, 0, + 192, 0, 192, 191, 0, 0, 190, 191, 0, 191, + 192, 0, 182, 193, 193, 193, 0, 182, 0, 191, + 0, 190, 194, 194, 194, 192, 190, 0, 0, 193, + + 192, 193, 0, 0, 191, 0, 0, 194, 194, 191, + 194, 193, 0, 0, 195, 195, 195, 0, 0, 0, + 194, 198, 198, 198, 0, 195, 193, 0, 0, 0, + 195, 193, 195, 0, 0, 194, 0, 198, 0, 198, + 194, 0, 195, 199, 199, 199, 0, 0, 0, 198, + 200, 200, 200, 0, 0, 0, 0, 195, 199, 199, + 0, 199, 195, 0, 198, 0, 200, 0, 200, 198, + 0, 199, 200, 0, 201, 201, 201, 0, 200, 0, + 0, 202, 202, 202, 0, 0, 199, 0, 202, 0, + 201, 199, 201, 200, 0, 0, 201, 202, 200, 202, + + 0, 0, 201, 205, 205, 205, 0, 0, 0, 202, + 206, 206, 206, 0, 207, 207, 207, 201, 0, 205, + 205, 205, 201, 0, 202, 0, 206, 0, 206, 202, + 207, 205, 207, 0, 0, 0, 0, 0, 206, 0, + 0, 0, 207, 210, 210, 210, 205, 0, 0, 0, + 210, 205, 0, 206, 208, 208, 208, 207, 206, 210, + 0, 210, 207, 0, 208, 209, 209, 209, 0, 0, + 208, 210, 208, 0, 0, 0, 209, 0, 211, 211, + 211, 209, 208, 209, 0, 0, 210, 0, 0, 211, + 0, 210, 0, 209, 211, 0, 211, 208, 0, 212, + + 212, 212, 208, 0, 0, 0, 211, 0, 209, 0, + 0, 0, 0, 209, 0, 212, 0, 212, 0, 0, + 0, 211, 213, 213, 213, 0, 211, 212, 0, 0, + 0, 0, 0, 214, 214, 214, 0, 0, 213, 0, + 213, 0, 212, 0, 0, 0, 213, 212, 0, 214, + 213, 214, 0, 0, 0, 214, 215, 215, 215, 0, + 0, 214, 216, 216, 216, 213, 0, 0, 0, 0, + 213, 0, 215, 0, 215, 0, 214, 0, 216, 0, + 216, 214, 0, 0, 215, 216, 0, 0, 0, 0, + 216, 217, 217, 217, 0, 0, 0, 0, 0, 215, + + 0, 0, 0, 0, 215, 216, 0, 217, 0, 217, + 216, 0, 0, 0, 0, 0, 0, 0, 0, 217, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 217, 0, 0, 0, 0, 217, + 219, 219, 219, 221, 0, 221, 222, 0, 222, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; @@ -990,10 +1017,10 @@ goto find_rule; \ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 1 "/home/drepper/devel/elfutils/src/ldlex.l" #define INITIAL 0 -#line 2 "/home/drepper/gnu/elfutils/src/ldlex.l" -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +#line 2 "/home/drepper/devel/elfutils/src/ldlex.l" +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -1035,6 +1062,11 @@ char *yytext; #undef fwrite #define fwrite(b, m, n, s) fwrite_unlocked (b, m, n, s) +/* ECHO must be redefined since the default implementation ignores + the return value of fwrite_unlocked. */ +#define ECHO do { size_t n__ __attribute__ ((unused)) \ + = fwrite (yytext, yyleng, 1, yyout); } while (0) + /* Defined in ld.c. */ extern int ld_scan_version_script; @@ -1057,7 +1089,7 @@ static void invalid_char (int ch); #define YY_NEVER_INTERACTIVE 1 #define IGNORE 1 -#line 1061 "ldlex.c" +#line 1093 "ldlex.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1211,7 +1243,7 @@ YY_DECL register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 79 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 84 "/home/drepper/devel/elfutils/src/ldlex.l" if (unlikely (ld_scan_version_script)) { @@ -1219,7 +1251,7 @@ YY_DECL return kVERSION_SCRIPT; } -#line 1223 "ldlex.c" +#line 1255 "ldlex.c" if ( yy_init ) { @@ -1268,14 +1300,14 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 211 ) + if ( yy_current_state >= 219 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_base[yy_current_state] != 2141 ); + while ( yy_base[yy_current_state] != 2250 ); yy_find_action: yy_current_state = *--yy_state_ptr; @@ -1316,7 +1348,7 @@ case 1: yy_c_buf_p = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 86 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 91 "/home/drepper/devel/elfutils/src/ldlex.l" { BEGIN (handle_ifdef ()); } YY_BREAK case 2: @@ -1324,7 +1356,7 @@ case 2: yy_c_buf_p = yy_cp = yy_bp + 5; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 87 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 92 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (true); push_state (skip_to_endif); BEGIN (IGNORE); } @@ -1334,7 +1366,7 @@ case 3: yy_c_buf_p = yy_cp = yy_bp + 8; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 90 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 95 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (false); push_state (skip_to_endif); BEGIN (IGNORE); } @@ -1344,7 +1376,7 @@ case 4: yy_c_buf_p = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 93 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 98 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (true) ; } YY_BREAK case 5: @@ -1352,7 +1384,7 @@ case 5: yy_c_buf_p = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 95 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 100 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (false); push_state (skip_to_endif); } YY_BREAK @@ -1361,7 +1393,7 @@ case 6: yy_c_buf_p = yy_cp = yy_bp + 5; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 97 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 102 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (true); assert (prepdepth > 0); if (prepstate[prepdepth - 1] == skip_if) @@ -1377,7 +1409,7 @@ case 7: yy_c_buf_p = yy_cp = yy_bp + 8; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 106 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 111 "/home/drepper/devel/elfutils/src/ldlex.l" { assert (prepdepth > 0); if (prepstate[prepdepth - 1] == skip_if) { @@ -1392,192 +1424,197 @@ case 8: yy_c_buf_p = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 114 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 119 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_to_eol (true); BEGIN (pop_state ()); } YY_BREAK case 9: YY_RULE_SETUP -#line 116 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 121 "/home/drepper/devel/elfutils/src/ldlex.l" { /* nothing */ } YY_BREAK case 10: YY_RULE_SETUP -#line 119 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 124 "/home/drepper/devel/elfutils/src/ldlex.l" { eat_comment (); } YY_BREAK case 11: YY_RULE_SETUP -#line 121 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 126 "/home/drepper/devel/elfutils/src/ldlex.l" { return kALIGN; } YY_BREAK case 12: YY_RULE_SETUP -#line 122 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kENTRY; } +#line 127 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kAS_NEEDED; } YY_BREAK case 13: YY_RULE_SETUP -#line 123 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kEXCLUDE_FILE; } +#line 128 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kENTRY; } YY_BREAK case 14: YY_RULE_SETUP -#line 124 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kGLOBAL; } +#line 129 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kEXCLUDE_FILE; } YY_BREAK case 15: YY_RULE_SETUP -#line 125 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kGROUP; } +#line 130 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kGLOBAL; } YY_BREAK case 16: YY_RULE_SETUP -#line 126 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kINPUT; } +#line 131 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kGROUP; } YY_BREAK case 17: YY_RULE_SETUP -#line 127 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kINTERP; } +#line 132 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kINPUT; } YY_BREAK case 18: YY_RULE_SETUP -#line 128 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kKEEP; } +#line 133 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kINTERP; } YY_BREAK case 19: YY_RULE_SETUP -#line 129 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kLOCAL; } +#line 134 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kKEEP; } YY_BREAK case 20: YY_RULE_SETUP -#line 130 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kOUTPUT_FORMAT; } +#line 135 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kLOCAL; } YY_BREAK case 21: YY_RULE_SETUP -#line 131 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kPAGESIZE; } +#line 136 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kOUTPUT_FORMAT; } YY_BREAK case 22: YY_RULE_SETUP -#line 132 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kPROVIDE; } +#line 137 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kPAGESIZE; } YY_BREAK case 23: YY_RULE_SETUP -#line 133 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kSEARCH_DIR; } +#line 138 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kPROVIDE; } YY_BREAK case 24: YY_RULE_SETUP -#line 134 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kSEGMENT; } +#line 139 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kSEARCH_DIR; } YY_BREAK case 25: YY_RULE_SETUP -#line 135 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kSIZEOF_HEADERS; } +#line 140 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kSEGMENT; } YY_BREAK case 26: YY_RULE_SETUP -#line 136 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kSORT; } +#line 141 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kSIZEOF_HEADERS; } YY_BREAK case 27: YY_RULE_SETUP -#line 137 "/home/drepper/gnu/elfutils/src/ldlex.l" -{ return kVERSION; } +#line 142 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kSORT; } YY_BREAK case 28: YY_RULE_SETUP -#line 139 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 143 "/home/drepper/devel/elfutils/src/ldlex.l" +{ return kVERSION; } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 145 "/home/drepper/devel/elfutils/src/ldlex.l" { int cnt = 1 ; ldlval.num = 0; while (cnt < yyleng - 1) ldlval.num |= attrib_convert (yytext[cnt++]); return kMODE; } YY_BREAK -case 29: +case 30: YY_RULE_SETUP -#line 145 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 151 "/home/drepper/devel/elfutils/src/ldlex.l" { return '{'; } YY_BREAK -case 30: +case 31: YY_RULE_SETUP -#line 146 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 152 "/home/drepper/devel/elfutils/src/ldlex.l" { return '}'; } YY_BREAK -case 31: +case 32: YY_RULE_SETUP -#line 147 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 153 "/home/drepper/devel/elfutils/src/ldlex.l" { return '('; } YY_BREAK -case 32: +case 33: YY_RULE_SETUP -#line 148 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 154 "/home/drepper/devel/elfutils/src/ldlex.l" { return ')'; } YY_BREAK -case 33: +case 34: YY_RULE_SETUP -#line 149 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 155 "/home/drepper/devel/elfutils/src/ldlex.l" { return ':'; } YY_BREAK -case 34: +case 35: YY_RULE_SETUP -#line 150 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 156 "/home/drepper/devel/elfutils/src/ldlex.l" { return ';'; } YY_BREAK -case 35: +case 36: YY_RULE_SETUP -#line 151 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 157 "/home/drepper/devel/elfutils/src/ldlex.l" { return '='; } YY_BREAK -case 36: +case 37: YY_RULE_SETUP -#line 152 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 158 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.op = exp_plus; return kADD_OP; } YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 153 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 159 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.op = exp_minus; return kADD_OP; } YY_BREAK -case 38: +case 39: YY_RULE_SETUP -#line 154 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 160 "/home/drepper/devel/elfutils/src/ldlex.l" { return '*'; } YY_BREAK -case 39: +case 40: YY_RULE_SETUP -#line 155 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 161 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.op = exp_div; return kMUL_OP; } YY_BREAK -case 40: +case 41: YY_RULE_SETUP -#line 156 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 162 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.op = exp_mod; return kMUL_OP; } YY_BREAK -case 41: +case 42: YY_RULE_SETUP -#line 157 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 163 "/home/drepper/devel/elfutils/src/ldlex.l" { return '&'; } YY_BREAK -case 42: +case 43: YY_RULE_SETUP -#line 158 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 164 "/home/drepper/devel/elfutils/src/ldlex.l" { return '|'; } YY_BREAK -case 43: +case 44: YY_RULE_SETUP -#line 160 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 166 "/home/drepper/devel/elfutils/src/ldlex.l" { return ','; } YY_BREAK -case 44: +case 45: YY_RULE_SETUP -#line 162 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 168 "/home/drepper/devel/elfutils/src/ldlex.l" { char *endp; ldlval.num = strtoumax (yytext, &endp, 0); if (*endp != '\0') @@ -1592,36 +1629,36 @@ YY_RULE_SETUP } return kNUM; } YY_BREAK -case 45: +case 46: YY_RULE_SETUP -#line 176 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 182 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.str = obstack_strndup (&ld_state.smem, yytext, yyleng); return kID; } YY_BREAK -case 46: +case 47: YY_RULE_SETUP -#line 180 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 186 "/home/drepper/devel/elfutils/src/ldlex.l" { ldlval.str = obstack_strndup (&ld_state.smem, yytext, yyleng); return kFILENAME; } YY_BREAK -case 47: +case 48: YY_RULE_SETUP -#line 184 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 190 "/home/drepper/devel/elfutils/src/ldlex.l" { /* IGNORE */ } YY_BREAK -case 48: +case 49: YY_RULE_SETUP -#line 186 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 192 "/home/drepper/devel/elfutils/src/ldlex.l" { invalid_char (*yytext); } YY_BREAK -case 49: +case 50: YY_RULE_SETUP -#line 188 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 194 "/home/drepper/devel/elfutils/src/ldlex.l" ECHO; YY_BREAK -#line 1625 "ldlex.c" +#line 1662 "ldlex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(IGNORE): yyterminate(); @@ -1912,7 +1949,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 211 ) + if ( yy_current_state >= 219 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1942,11 +1979,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 211 ) + if ( yy_current_state >= 219 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 210); + yy_is_jam = (yy_current_state == 218); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; @@ -2504,7 +2541,7 @@ int main() return 0; } #endif -#line 188 "/home/drepper/gnu/elfutils/src/ldlex.l" +#line 194 "/home/drepper/devel/elfutils/src/ldlex.l" static void diff --git a/elfutils/src/ldlex.l b/elfutils/src/ldlex.l index 06ea6237..9e30a865 100644 --- a/elfutils/src/ldlex.l +++ b/elfutils/src/ldlex.l @@ -1,5 +1,5 @@ %{ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -41,6 +41,11 @@ #undef fwrite #define fwrite(b, m, n, s) fwrite_unlocked (b, m, n, s) +/* ECHO must be redefined since the default implementation ignores + the return value of fwrite_unlocked. */ +#define ECHO do { size_t n__ __attribute__ ((unused)) \ + = fwrite (yytext, yyleng, 1, yyout); } while (0) + /* Defined in ld.c. */ extern int ld_scan_version_script; @@ -119,6 +124,7 @@ WHITE [[:space:]]+ "/*" { eat_comment (); } ALIGN { return kALIGN; } +AS_NEEDED { return kAS_NEEDED; } ENTRY { return kENTRY; } EXCLUDE_FILE { return kEXCLUDE_FILE; } "global:" { return kGLOBAL; } diff --git a/elfutils/src/ldscript.c b/elfutils/src/ldscript.c index 0f70ca95..af23aa7c 100644 --- a/elfutils/src/ldscript.c +++ b/elfutils/src/ldscript.c @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.0. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 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 @@ -45,8 +45,7 @@ /* Using locations. */ #define YYLSP_NEEDED 0 -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ +/* Substitute the variable and function names. */ #define yyparse ldparse #define yylex ldlex #define yyerror lderror @@ -64,67 +63,69 @@ enum yytokentype { kADD_OP = 258, kALIGN = 259, - kENTRY = 260, - kEXCLUDE_FILE = 261, - kFILENAME = 262, - kGLOBAL = 263, - kGROUP = 264, - kID = 265, - kINPUT = 266, - kINTERP = 267, - kKEEP = 268, - kLOCAL = 269, - kMODE = 270, - kMUL_OP = 271, - kNUM = 272, - kOUTPUT_FORMAT = 273, - kPAGESIZE = 274, - kPROVIDE = 275, - kSEARCH_DIR = 276, - kSEGMENT = 277, - kSIZEOF_HEADERS = 278, - kSORT = 279, - kVERSION = 280, - kVERSION_SCRIPT = 281, - ADD_OP = 282, - MUL_OP = 283 + kAS_NEEDED = 260, + kENTRY = 261, + kEXCLUDE_FILE = 262, + kFILENAME = 263, + kGLOBAL = 264, + kGROUP = 265, + kID = 266, + kINPUT = 267, + kINTERP = 268, + kKEEP = 269, + kLOCAL = 270, + kMODE = 271, + kMUL_OP = 272, + kNUM = 273, + kOUTPUT_FORMAT = 274, + kPAGESIZE = 275, + kPROVIDE = 276, + kSEARCH_DIR = 277, + kSEGMENT = 278, + kSIZEOF_HEADERS = 279, + kSORT = 280, + kVERSION = 281, + kVERSION_SCRIPT = 282, + ADD_OP = 283, + MUL_OP = 284 }; #endif #define kADD_OP 258 #define kALIGN 259 -#define kENTRY 260 -#define kEXCLUDE_FILE 261 -#define kFILENAME 262 -#define kGLOBAL 263 -#define kGROUP 264 -#define kID 265 -#define kINPUT 266 -#define kINTERP 267 -#define kKEEP 268 -#define kLOCAL 269 -#define kMODE 270 -#define kMUL_OP 271 -#define kNUM 272 -#define kOUTPUT_FORMAT 273 -#define kPAGESIZE 274 -#define kPROVIDE 275 -#define kSEARCH_DIR 276 -#define kSEGMENT 277 -#define kSIZEOF_HEADERS 278 -#define kSORT 279 -#define kVERSION 280 -#define kVERSION_SCRIPT 281 -#define ADD_OP 282 -#define MUL_OP 283 +#define kAS_NEEDED 260 +#define kENTRY 261 +#define kEXCLUDE_FILE 262 +#define kFILENAME 263 +#define kGLOBAL 264 +#define kGROUP 265 +#define kID 266 +#define kINPUT 267 +#define kINTERP 268 +#define kKEEP 269 +#define kLOCAL 270 +#define kMODE 271 +#define kMUL_OP 272 +#define kNUM 273 +#define kOUTPUT_FORMAT 274 +#define kPAGESIZE 275 +#define kPROVIDE 276 +#define kSEARCH_DIR 277 +#define kSEGMENT 278 +#define kSIZEOF_HEADERS 279 +#define kSORT 280 +#define kVERSION 281 +#define kVERSION_SCRIPT 282 +#define ADD_OP 283 +#define MUL_OP 284 /* Copy the first part of user declarations. */ -#line 1 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 1 "/home/drepper/devel/elfutils/src/ldscript.y" /* Parser for linker scripts. - Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -170,6 +171,7 @@ static void new_segment (int mode, struct output_rule *output_rule); static struct filename_list *new_filename_listelem (const char *string); static void add_inputfiles (struct filename_list *fnames); static struct id_list *new_id_listelem (const char *str); + static struct filename_list *mark_as_needed (struct filename_list *listp); static struct version *new_version (struct id_list *local, struct id_list *global); static struct version *merge_versions (struct version *one, @@ -193,7 +195,7 @@ extern int yylex (void); #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 58 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 59 "/home/drepper/devel/elfutils/src/ldscript.y" typedef union YYSTYPE { uintmax_t num; enum expression_tag op; @@ -208,8 +210,8 @@ typedef union YYSTYPE { struct version *version; struct id_list *id_list; } YYSTYPE; -/* Line 191 of yacc.c. */ -#line 213 "ldscript.c" +/* Line 190 of yacc.c. */ +#line 215 "ldscript.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -220,8 +222,8 @@ typedef union YYSTYPE { /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 225 "ldscript.c" +/* Line 213 of yacc.c. */ +#line 227 "ldscript.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -236,14 +238,10 @@ typedef union YYSTYPE { # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca # endif # endif # endif @@ -269,7 +267,7 @@ typedef union YYSTYPE { /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + short int yyss; YYSTYPE yyvs; }; @@ -279,7 +277,7 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do @@ -321,26 +319,26 @@ union yyalloc #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short yysigned_char; + typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 30 +#define YYFINAL 32 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 198 +#define YYLAST 228 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 39 +#define YYNTOKENS 40 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 22 /* YYNRULES -- Number of rules. */ -#define YYNRULES 62 +#define YYNRULES 65 /* YYNRULES -- Number of states. */ -#define YYNSTATES 146 +#define YYNSTATES 158 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 283 +#define YYMAXUTOK 284 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -351,16 +349,16 @@ static const unsigned char yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 28, 2, - 32, 33, 30, 2, 38, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 34, - 2, 37, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 29, 2, + 33, 34, 31, 2, 39, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 35, + 2, 38, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 35, 27, 36, 2, 2, 2, 2, + 2, 2, 2, 36, 28, 37, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -376,7 +374,7 @@ static const unsigned char yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 29, 31 + 25, 26, 27, 30, 32 }; #if YYDEBUG @@ -385,52 +383,53 @@ static const unsigned char yytranslate[] = static const unsigned char yyprhs[] = { 0, 0, 3, 5, 8, 11, 13, 19, 25, 31, - 37, 43, 49, 54, 59, 64, 69, 72, 74, 77, - 82, 85, 89, 96, 99, 101, 103, 108, 111, 117, - 119, 124, 129, 130, 135, 139, 143, 147, 151, 155, - 159, 161, 163, 165, 167, 171, 173, 175, 176, 179, - 181, 186, 192, 199, 202, 204, 207, 210, 214, 217, - 219, 221, 223 + 37, 43, 49, 54, 59, 64, 69, 74, 77, 79, + 82, 87, 90, 94, 101, 104, 106, 108, 113, 116, + 122, 124, 129, 134, 135, 140, 144, 148, 152, 156, + 160, 164, 166, 168, 170, 172, 177, 182, 186, 188, + 190, 191, 194, 196, 201, 207, 214, 217, 219, 222, + 225, 229, 232, 234, 236, 238 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { - 40, 0, -1, 41, -1, 26, 54, -1, 41, 42, - -1, 42, -1, 5, 32, 10, 33, 34, -1, 21, - 32, 59, 33, 34, -1, 19, 32, 17, 33, 34, - -1, 12, 32, 59, 33, 34, -1, 22, 15, 35, - 43, 36, -1, 22, 1, 35, 43, 36, -1, 9, - 32, 52, 33, -1, 11, 32, 52, 33, -1, 25, - 35, 54, 36, -1, 18, 32, 59, 33, -1, 43, - 44, -1, 44, -1, 45, 34, -1, 10, 35, 46, - 36, -1, 10, 34, -1, 10, 37, 51, -1, 20, - 32, 10, 37, 51, 33, -1, 46, 47, -1, 47, - -1, 48, -1, 13, 32, 48, 33, -1, 45, 34, - -1, 60, 32, 50, 49, 33, -1, 10, -1, 24, - 32, 10, 33, -1, 6, 32, 59, 33, -1, -1, - 4, 32, 51, 33, -1, 32, 51, 33, -1, 51, - 30, 51, -1, 51, 16, 51, -1, 51, 3, 51, - -1, 51, 28, 51, -1, 51, 27, 51, -1, 17, - -1, 10, -1, 23, -1, 19, -1, 52, 53, 59, - -1, 59, -1, 38, -1, -1, 54, 55, -1, 55, - -1, 35, 56, 36, 34, -1, 59, 35, 56, 36, - 34, -1, 59, 35, 56, 36, 59, 34, -1, 56, - 57, -1, 57, -1, 8, 58, -1, 14, 58, -1, - 58, 60, 34, -1, 60, 34, -1, 7, -1, 10, - -1, 59, -1, 30, -1 + 41, 0, -1, 42, -1, 27, 55, -1, 42, 43, + -1, 43, -1, 6, 33, 11, 34, 35, -1, 22, + 33, 60, 34, 35, -1, 20, 33, 18, 34, 35, + -1, 13, 33, 60, 34, 35, -1, 23, 16, 36, + 44, 37, -1, 23, 1, 36, 44, 37, -1, 10, + 33, 53, 34, -1, 12, 33, 53, 34, -1, 5, + 33, 53, 34, -1, 26, 36, 55, 37, -1, 19, + 33, 60, 34, -1, 44, 45, -1, 45, -1, 46, + 35, -1, 11, 36, 47, 37, -1, 11, 35, -1, + 11, 38, 52, -1, 21, 33, 11, 38, 52, 34, + -1, 47, 48, -1, 48, -1, 49, -1, 14, 33, + 49, 34, -1, 46, 35, -1, 61, 33, 51, 50, + 34, -1, 11, -1, 25, 33, 11, 34, -1, 7, + 33, 60, 34, -1, -1, 4, 33, 52, 34, -1, + 33, 52, 34, -1, 52, 31, 52, -1, 52, 17, + 52, -1, 52, 3, 52, -1, 52, 29, 52, -1, + 52, 28, 52, -1, 18, -1, 11, -1, 24, -1, + 20, -1, 10, 33, 53, 34, -1, 5, 33, 53, + 34, -1, 53, 54, 60, -1, 60, -1, 39, -1, + -1, 55, 56, -1, 56, -1, 36, 57, 37, 35, + -1, 60, 36, 57, 37, 35, -1, 60, 36, 57, + 37, 60, 35, -1, 57, 58, -1, 58, -1, 9, + 59, -1, 15, 59, -1, 59, 61, 35, -1, 61, + 35, -1, 8, -1, 11, -1, 60, -1, 31, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const unsigned short int yyrline[] = { - 0, 128, 128, 129, 133, 134, 137, 142, 146, 151, - 156, 160, 166, 177, 179, 181, 185, 190, 194, 199, - 211, 235, 237, 241, 246, 250, 255, 262, 269, 280, - 282, 286, 289, 292, 297, 299, 305, 311, 317, 323, - 329, 334, 339, 341, 345, 351, 355, 356, 359, 364, - 368, 374, 380, 389, 391, 395, 397, 402, 408, 412, - 414, 418, 420 + 0, 130, 130, 131, 135, 136, 139, 144, 148, 153, + 158, 162, 168, 179, 181, 183, 185, 189, 194, 198, + 203, 215, 239, 241, 245, 250, 254, 259, 266, 273, + 284, 286, 290, 293, 296, 301, 303, 309, 315, 321, + 327, 333, 338, 343, 345, 349, 360, 362, 368, 372, + 373, 376, 381, 385, 391, 397, 406, 408, 412, 414, + 419, 425, 429, 431, 435, 437 }; #endif @@ -439,9 +438,9 @@ static const unsigned short yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "kADD_OP", "kALIGN", "kENTRY", - "kEXCLUDE_FILE", "kFILENAME", "kGLOBAL", "kGROUP", "kID", "kINPUT", - "kINTERP", "kKEEP", "kLOCAL", "kMODE", "kMUL_OP", "kNUM", + "$end", "error", "$undefined", "kADD_OP", "kALIGN", "kAS_NEEDED", + "kENTRY", "kEXCLUDE_FILE", "kFILENAME", "kGLOBAL", "kGROUP", "kID", + "kINPUT", "kINTERP", "kKEEP", "kLOCAL", "kMODE", "kMUL_OP", "kNUM", "kOUTPUT_FORMAT", "kPAGESIZE", "kPROVIDE", "kSEARCH_DIR", "kSEGMENT", "kSIZEOF_HEADERS", "kSORT", "kVERSION", "kVERSION_SCRIPT", "'|'", "'&'", "ADD_OP", "'*'", "MUL_OP", "'('", "')'", "';'", "'{'", "'}'", "'='", @@ -457,37 +456,37 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 124, 38, 282, - 42, 283, 40, 41, 59, 123, 125, 61, 44 + 275, 276, 277, 278, 279, 280, 281, 282, 124, 38, + 283, 42, 284, 40, 41, 59, 123, 125, 61, 44 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 39, 40, 40, 41, 41, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 43, 43, 44, 44, - 44, 45, 45, 46, 46, 47, 47, 47, 48, 49, - 49, 50, 50, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 52, 52, 53, 53, 54, 54, - 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, - 59, 60, 60 + 0, 40, 41, 41, 42, 42, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 44, 44, 45, + 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, + 50, 50, 51, 51, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 53, 53, 53, 53, 54, + 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, + 59, 59, 60, 60, 61, 61 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 2, 2, 1, 5, 5, 5, 5, - 5, 5, 4, 4, 4, 4, 2, 1, 2, 4, - 2, 3, 6, 2, 1, 1, 4, 2, 5, 1, - 4, 4, 0, 4, 3, 3, 3, 3, 3, 3, - 1, 1, 1, 1, 3, 1, 1, 0, 2, 1, - 4, 5, 6, 2, 1, 2, 2, 3, 2, 1, - 1, 1, 1 + 5, 5, 4, 4, 4, 4, 4, 2, 1, 2, + 4, 2, 3, 6, 2, 1, 1, 4, 2, 5, + 1, 4, 4, 0, 4, 3, 3, 3, 3, 3, + 3, 1, 1, 1, 1, 4, 4, 3, 1, 1, + 0, 2, 1, 4, 5, 6, 2, 1, 2, 2, + 3, 2, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -496,58 +495,60 @@ static const unsigned char yyr2[] = static const unsigned char yydefact[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 60, 0, 3, 49, 0, - 1, 4, 0, 47, 45, 47, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 54, 48, 0, 0, - 12, 46, 0, 13, 0, 15, 0, 0, 0, 0, - 0, 17, 0, 0, 14, 62, 55, 61, 0, 56, - 0, 53, 0, 6, 44, 9, 8, 7, 20, 0, - 0, 0, 11, 16, 18, 10, 0, 58, 50, 0, - 60, 0, 0, 0, 24, 25, 0, 0, 41, 40, - 43, 42, 0, 21, 0, 57, 51, 0, 0, 27, - 19, 23, 32, 0, 0, 0, 0, 0, 0, 0, - 0, 52, 0, 0, 0, 0, 34, 37, 36, 39, - 38, 35, 0, 26, 0, 29, 0, 0, 33, 22, - 0, 0, 28, 31, 0, 30 + 0, 0, 0, 2, 5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 63, 0, 3, + 52, 0, 1, 4, 0, 0, 50, 48, 0, 50, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 57, 51, 0, 0, 0, 14, 49, 0, 0, + 12, 13, 0, 16, 0, 0, 0, 0, 0, 18, + 0, 0, 15, 65, 58, 64, 0, 59, 0, 56, + 0, 50, 50, 47, 6, 9, 8, 7, 21, 0, + 0, 0, 11, 17, 19, 10, 0, 61, 53, 0, + 46, 45, 63, 0, 0, 0, 25, 26, 0, 0, + 42, 41, 44, 43, 0, 22, 0, 60, 54, 0, + 0, 28, 20, 24, 33, 0, 0, 0, 0, 0, + 0, 0, 0, 55, 0, 0, 0, 0, 35, 38, + 37, 40, 39, 36, 0, 27, 0, 30, 0, 0, + 34, 23, 0, 0, 29, 32, 0, 31 }; /* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +static const short int yydefgoto[] = { - -1, 11, 12, 13, 60, 61, 62, 93, 94, 95, - 137, 124, 103, 33, 52, 27, 28, 45, 46, 66, - 67, 96 + -1, 12, 13, 14, 68, 69, 70, 105, 106, 107, + 149, 136, 115, 36, 58, 29, 30, 50, 51, 74, + 75, 108 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -41 -static const short yypact[] = +#define YYPACT_NINF -46 +static const short int yypact[] = { - 107, -28, -20, -13, 34, 77, 85, 88, 91, 33, - 38, 123, 125, -41, 117, 52, 52, 52, 52, 114, - 52, 100, 103, 38, -41, -41, 96, 38, -41, 110, - -41, -41, 115, 64, -41, 67, 116, 118, 120, 127, - 1, 1, 28, 84, 84, 36, -41, -41, 96, 128, - -41, -41, 52, -41, 129, -41, 130, 131, 105, 134, - 75, -41, 133, 79, -41, -41, 84, -41, 135, 84, - 136, -41, 41, -41, -41, -41, -41, -41, -41, 83, - 48, 151, -41, -41, -41, -41, 137, -41, -41, 44, - 138, 140, 139, 17, -41, -41, 142, 144, -41, -41, - -41, -41, 48, 54, 141, -41, -41, 143, 84, -41, - -41, -41, 162, 48, -2, 48, 48, 48, 48, 48, - 48, -41, 146, 148, 97, 6, -41, 54, 54, 58, - 53, -1, 13, -41, 52, -41, 149, 150, -41, -41, - 152, 172, -41, -41, 153, -41 + 105, -12, -1, 26, 30, 51, 81, 89, 93, 120, + 84, 4, 103, 128, -46, 14, 126, 14, 14, 135, + 135, 121, 135, 109, 116, 4, -46, -46, 87, 4, + -46, 139, -46, -46, 129, 144, 22, -46, 145, 127, + 130, 147, 148, 149, 150, 9, 9, 61, 2, 2, + 67, -46, -46, 87, 14, 14, -46, -46, 135, 143, + -46, -46, 151, -46, 152, 153, 138, 156, 5, -46, + 155, 79, -46, -46, 2, -46, 157, 2, 158, -46, + 68, 131, 133, -46, -46, -46, -46, -46, -46, 98, + 46, 169, -46, -46, -46, -46, 159, -46, -46, 78, + -46, -46, 160, 162, 161, 54, -46, -46, 164, 166, + -46, -46, -46, -46, 46, 64, 163, -46, -46, 165, + 2, -46, -46, -46, 178, 46, 0, 46, 46, 46, + 46, 46, 46, -46, 168, 170, 119, 20, -46, 64, + 64, 70, 77, 146, 24, -46, 135, -46, 171, 172, + -46, -46, 173, 180, -46, -46, 174, -46 }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const short int yypgoto[] = { - -41, -41, -41, 175, 147, -40, 29, -41, 98, 76, - -41, -41, 39, 173, -41, 167, -24, 145, 15, 154, - -10, 32 + -46, -46, -46, 192, 167, 100, 18, -46, 104, 90, + -46, -46, 28, -16, -46, 186, 31, 175, -45, 176, + -11, -3 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -557,71 +558,78 @@ static const short yypgoto[] = #define YYTABLE_NINF -1 static const unsigned char yytable[] = { - 29, 115, 115, 47, 14, 34, 34, 36, 37, 115, - 39, 58, 15, 29, 116, 116, 115, 29, 47, 16, - 83, 59, 116, 83, 24, 117, 118, 90, 119, 116, - 91, 126, 29, 117, 118, 24, 119, 59, 25, 138, - 117, 118, 74, 119, 43, 24, 139, 65, 25, 43, - 44, 24, 97, 110, 25, 44, 115, 115, 98, 24, - 71, 115, 25, 26, 64, 99, 17, 100, 23, 116, - 116, 101, 70, 26, 116, 68, 68, 89, 106, 107, - 102, 117, 118, 119, 119, 58, 118, 71, 119, 58, - 24, 24, 21, 90, 25, 59, 91, 50, 86, 59, - 53, 86, 51, 59, 43, 51, 22, 135, 92, 18, - 44, 82, 1, 65, 65, 85, 2, 19, 3, 4, - 20, 136, 92, 30, 140, 5, 6, 32, 7, 8, - 1, 38, 9, 10, 2, 40, 3, 4, 41, 78, - 79, 114, 80, 5, 6, 48, 7, 8, 49, 54, - 9, 55, 125, 56, 127, 128, 129, 130, 131, 132, - 57, 104, 73, 75, 76, 77, 81, 84, 123, 87, - 88, 105, 108, 109, 112, 80, 113, 121, 120, 133, - 134, 141, 144, 142, 122, 143, 145, 31, 63, 35, - 42, 111, 0, 72, 0, 0, 0, 0, 69 + 31, 39, 40, 127, 37, 79, 37, 37, 41, 42, + 26, 44, 26, 27, 31, 27, 66, 128, 31, 34, + 66, 15, 26, 127, 35, 27, 67, 127, 129, 130, + 67, 131, 16, 73, 138, 79, 31, 128, 81, 82, + 28, 128, 92, 37, 37, 76, 76, 83, 129, 130, + 109, 131, 129, 130, 150, 131, 56, 110, 151, 17, + 52, 57, 26, 18, 111, 102, 112, 127, 103, 26, + 113, 96, 27, 127, 96, 67, 48, 48, 52, 114, + 127, 128, 49, 49, 19, 73, 26, 128, 119, 27, + 66, 122, 129, 130, 128, 131, 48, 28, 72, 130, + 67, 131, 49, 32, 78, 99, 26, 104, 131, 102, + 1, 2, 103, 118, 20, 3, 95, 4, 5, 67, + 25, 23, 21, 104, 6, 7, 22, 8, 9, 73, + 147, 10, 11, 1, 2, 152, 24, 38, 3, 43, + 4, 5, 126, 26, 148, 45, 27, 6, 7, 127, + 8, 9, 46, 137, 10, 139, 140, 141, 142, 143, + 144, 60, 54, 128, 61, 100, 57, 101, 93, 57, + 57, 93, 57, 88, 89, 53, 90, 55, 84, 59, + 116, 62, 63, 64, 65, 135, 85, 86, 87, 91, + 94, 156, 97, 98, 117, 120, 121, 124, 90, 125, + 133, 132, 145, 146, 153, 33, 154, 155, 157, 123, + 134, 47, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 77, 0, 0, 80 }; -static const short yycheck[] = +static const short int yycheck[] = { - 10, 3, 3, 27, 32, 15, 16, 17, 18, 3, - 20, 10, 32, 23, 16, 16, 3, 27, 42, 32, - 60, 20, 16, 63, 7, 27, 28, 10, 30, 16, - 13, 33, 42, 27, 28, 7, 30, 20, 10, 33, - 27, 28, 52, 30, 8, 7, 33, 30, 10, 8, - 14, 7, 4, 36, 10, 14, 3, 3, 10, 7, - 45, 3, 10, 35, 36, 17, 32, 19, 35, 16, - 16, 23, 36, 35, 16, 43, 44, 36, 34, 89, - 32, 27, 28, 30, 30, 10, 28, 72, 30, 10, - 7, 7, 1, 10, 10, 20, 13, 33, 66, 20, - 33, 69, 38, 20, 8, 38, 15, 10, 79, 32, - 14, 36, 5, 30, 30, 36, 9, 32, 11, 12, - 32, 24, 93, 0, 134, 18, 19, 10, 21, 22, - 5, 17, 25, 26, 9, 35, 11, 12, 35, 34, - 35, 102, 37, 18, 19, 35, 21, 22, 33, 33, - 25, 33, 113, 33, 115, 116, 117, 118, 119, 120, - 33, 10, 34, 34, 34, 34, 32, 34, 6, 34, - 34, 34, 32, 34, 32, 37, 32, 34, 37, 33, - 32, 32, 10, 33, 108, 33, 33, 12, 41, 16, - 23, 93, -1, 48, -1, -1, -1, -1, 44 + 11, 17, 18, 3, 15, 50, 17, 18, 19, 20, + 8, 22, 8, 11, 25, 11, 11, 17, 29, 5, + 11, 33, 8, 3, 10, 11, 21, 3, 28, 29, + 21, 31, 33, 31, 34, 80, 47, 17, 54, 55, + 36, 17, 37, 54, 55, 48, 49, 58, 28, 29, + 4, 31, 28, 29, 34, 31, 34, 11, 34, 33, + 29, 39, 8, 33, 18, 11, 20, 3, 14, 8, + 24, 74, 11, 3, 77, 21, 9, 9, 47, 33, + 3, 17, 15, 15, 33, 31, 8, 17, 99, 11, + 11, 37, 28, 29, 17, 31, 9, 36, 37, 29, + 21, 31, 15, 0, 37, 37, 8, 89, 31, 11, + 5, 6, 14, 35, 33, 10, 37, 12, 13, 21, + 36, 1, 33, 105, 19, 20, 33, 22, 23, 31, + 11, 26, 27, 5, 6, 146, 16, 11, 10, 18, + 12, 13, 114, 8, 25, 36, 11, 19, 20, 3, + 22, 23, 36, 125, 26, 127, 128, 129, 130, 131, + 132, 34, 33, 17, 34, 34, 39, 34, 68, 39, + 39, 71, 39, 35, 36, 36, 38, 33, 35, 34, + 11, 34, 34, 34, 34, 7, 35, 35, 35, 33, + 35, 11, 35, 35, 35, 33, 35, 33, 38, 33, + 35, 38, 34, 33, 33, 13, 34, 34, 34, 105, + 120, 25, -1, 46, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 49, -1, -1, 53 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 5, 9, 11, 12, 18, 19, 21, 22, 25, - 26, 40, 41, 42, 32, 32, 32, 32, 32, 32, - 32, 1, 15, 35, 7, 10, 35, 54, 55, 59, - 0, 42, 10, 52, 59, 52, 59, 59, 17, 59, - 35, 35, 54, 8, 14, 56, 57, 55, 35, 33, - 33, 38, 53, 33, 33, 33, 33, 33, 10, 20, - 43, 44, 45, 43, 36, 30, 58, 59, 60, 58, - 36, 57, 56, 34, 59, 34, 34, 34, 34, 35, - 37, 32, 36, 44, 34, 36, 60, 34, 34, 36, - 10, 13, 45, 46, 47, 48, 60, 4, 10, 17, - 19, 23, 32, 51, 10, 34, 34, 59, 32, 34, - 36, 47, 32, 32, 51, 3, 16, 27, 28, 30, - 37, 34, 48, 6, 50, 51, 33, 51, 51, 51, - 51, 51, 51, 33, 32, 10, 24, 49, 33, 33, - 59, 32, 33, 33, 10, 33 + 0, 5, 6, 10, 12, 13, 19, 20, 22, 23, + 26, 27, 41, 42, 43, 33, 33, 33, 33, 33, + 33, 33, 33, 1, 16, 36, 8, 11, 36, 55, + 56, 60, 0, 43, 5, 10, 53, 60, 11, 53, + 53, 60, 60, 18, 60, 36, 36, 55, 9, 15, + 57, 58, 56, 36, 33, 33, 34, 39, 54, 34, + 34, 34, 34, 34, 34, 34, 11, 21, 44, 45, + 46, 44, 37, 31, 59, 60, 61, 59, 37, 58, + 57, 53, 53, 60, 35, 35, 35, 35, 35, 36, + 38, 33, 37, 45, 35, 37, 61, 35, 35, 37, + 34, 34, 11, 14, 46, 47, 48, 49, 61, 4, + 11, 18, 20, 24, 33, 52, 11, 35, 35, 60, + 33, 35, 37, 48, 33, 33, 52, 3, 17, 28, + 29, 31, 38, 35, 49, 7, 51, 52, 34, 52, + 52, 52, 52, 52, 52, 34, 33, 11, 25, 50, + 34, 34, 60, 33, 34, 34, 11, 34 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) @@ -675,20 +683,53 @@ do \ } \ while (0) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -711,19 +752,13 @@ do { \ YYFPRINTF Args; \ } while (0) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ - Token, Value); \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -735,12 +770,12 @@ do { \ #if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); @@ -790,8 +825,7 @@ do { \ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -809,10 +843,6 @@ int yydebug; SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -894,15 +924,15 @@ yysymprint (yyoutput, yytype, yyvaluep) (void) yyvaluep; if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif switch (yytype) { default: @@ -918,10 +948,11 @@ yysymprint (yyoutput, yytype, yyvaluep) #if defined (__STDC__) || defined (__cplusplus) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif @@ -929,6 +960,10 @@ yydestruct (yytype, yyvaluep) /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + switch (yytype) { @@ -956,10 +991,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -995,7 +1030,7 @@ yyparse () int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: @@ -1007,9 +1042,9 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -1046,6 +1081,9 @@ yyparse () yyssp = yyss; yyvsp = yyvs; + + yyvsp[0] = yylval; + goto yysetstate; /*------------------------------------------------------------. @@ -1071,7 +1109,7 @@ yyparse () these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -1099,7 +1137,7 @@ yyparse () yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -1135,18 +1173,18 @@ yyparse () yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1161,7 +1199,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1181,8 +1219,8 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) @@ -1232,425 +1270,449 @@ yyreduce: switch (yyn) { case 3: -#line 130 "/home/drepper/gnu/elfutils/src/ldscript.y" - { add_versions (yyvsp[0].version); } +#line 132 "/home/drepper/devel/elfutils/src/ldscript.y" + { add_versions ((yyvsp[0].version)); } break; case 6: -#line 138 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 140 "/home/drepper/devel/elfutils/src/ldscript.y" { if (likely (ld_state.entry == NULL)) - ld_state.entry = yyvsp[-2].str; + ld_state.entry = (yyvsp[-2].str); } break; case 7: -#line 143 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 145 "/home/drepper/devel/elfutils/src/ldscript.y" { - ld_new_searchdir (yyvsp[-2].str); + ld_new_searchdir ((yyvsp[-2].str)); } break; case 8: -#line 147 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 149 "/home/drepper/devel/elfutils/src/ldscript.y" { if (likely (ld_state.pagesize == 0)) - ld_state.pagesize = yyvsp[-2].num; + ld_state.pagesize = (yyvsp[-2].num); } break; case 9: -#line 152 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 154 "/home/drepper/devel/elfutils/src/ldscript.y" { if (likely (ld_state.interp == NULL)) - ld_state.interp = yyvsp[-2].str; + ld_state.interp = (yyvsp[-2].str); } break; case 10: -#line 157 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 159 "/home/drepper/devel/elfutils/src/ldscript.y" { - new_segment (yyvsp[-3].num, yyvsp[-1].output_rule); + new_segment ((yyvsp[-3].num), (yyvsp[-1].output_rule)); } break; case 11: -#line 161 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 163 "/home/drepper/devel/elfutils/src/ldscript.y" { fputs_unlocked (gettext ("mode for segment invalid\n"), stderr); - new_segment (0, yyvsp[-1].output_rule); + new_segment (0, (yyvsp[-1].output_rule)); } break; case 12: -#line 167 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 169 "/home/drepper/devel/elfutils/src/ldscript.y" { /* First little optimization. If there is only one file in the group don't do anything. */ - if (yyvsp[-1].filename_list != yyvsp[-1].filename_list->next) + if ((yyvsp[-1].filename_list) != (yyvsp[-1].filename_list)->next) { - yyvsp[-1].filename_list->next->group_start = 1; - yyvsp[-1].filename_list->group_end = 1; + (yyvsp[-1].filename_list)->next->group_start = 1; + (yyvsp[-1].filename_list)->group_end = 1; } - add_inputfiles (yyvsp[-1].filename_list); + add_inputfiles ((yyvsp[-1].filename_list)); } break; case 13: -#line 178 "/home/drepper/gnu/elfutils/src/ldscript.y" - { add_inputfiles (yyvsp[-1].filename_list); } +#line 180 "/home/drepper/devel/elfutils/src/ldscript.y" + { add_inputfiles ((yyvsp[-1].filename_list)); } break; case 14: -#line 180 "/home/drepper/gnu/elfutils/src/ldscript.y" - { add_versions (yyvsp[-1].version); } +#line 182 "/home/drepper/devel/elfutils/src/ldscript.y" + { add_inputfiles (mark_as_needed ((yyvsp[-1].filename_list))); } break; case 15: -#line 182 "/home/drepper/gnu/elfutils/src/ldscript.y" - { /* XXX TODO */ } +#line 184 "/home/drepper/devel/elfutils/src/ldscript.y" + { add_versions ((yyvsp[-1].version)); } break; case 16: -#line 186 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyvsp[0].output_rule->next = yyvsp[-1].output_rule->next; - yyval.output_rule = yyvsp[-1].output_rule->next = yyvsp[0].output_rule; - } +#line 186 "/home/drepper/devel/elfutils/src/ldscript.y" + { /* XXX TODO */ } break; case 17: -#line 191 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.output_rule = yyvsp[0].output_rule; } +#line 190 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyvsp[0].output_rule)->next = (yyvsp[-1].output_rule)->next; + (yyval.output_rule) = (yyvsp[-1].output_rule)->next = (yyvsp[0].output_rule); + } break; case 18: -#line 195 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 195 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.output_rule) = (yyvsp[0].output_rule); } + break; + + case 19: +#line 199 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.output_rule = new_output_rule (output_assignment); - yyval.output_rule->val.assignment = yyvsp[-1].assignment; + (yyval.output_rule) = new_output_rule (output_assignment); + (yyval.output_rule)->val.assignment = (yyvsp[-1].assignment); } break; - case 19: -#line 200 "/home/drepper/gnu/elfutils/src/ldscript.y" + case 20: +#line 204 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.output_rule = new_output_rule (output_section); - yyval.output_rule->val.section.name = yyvsp[-3].str; - yyval.output_rule->val.section.input = yyvsp[-1].input_rule->next; + (yyval.output_rule) = new_output_rule (output_section); + (yyval.output_rule)->val.section.name = (yyvsp[-3].str); + (yyval.output_rule)->val.section.input = (yyvsp[-1].input_rule)->next; if (ld_state.strip == strip_debug - && ebl_debugscn_p (ld_state.ebl, yyvsp[-3].str)) - yyval.output_rule->val.section.ignored = true; + && ebl_debugscn_p (ld_state.ebl, (yyvsp[-3].str))) + (yyval.output_rule)->val.section.ignored = true; else - yyval.output_rule->val.section.ignored = false; - yyvsp[-1].input_rule->next = NULL; + (yyval.output_rule)->val.section.ignored = false; + (yyvsp[-1].input_rule)->next = NULL; } break; - case 20: -#line 212 "/home/drepper/gnu/elfutils/src/ldscript.y" + case 21: +#line 216 "/home/drepper/devel/elfutils/src/ldscript.y" { /* This is a short cut for "ID { *(ID) }". */ - yyval.output_rule = new_output_rule (output_section); - yyval.output_rule->val.section.name = yyvsp[-1].str; - yyval.output_rule->val.section.input = new_input_rule (input_section); - yyval.output_rule->val.section.input->next = NULL; - yyval.output_rule->val.section.input->val.section = + (yyval.output_rule) = new_output_rule (output_section); + (yyval.output_rule)->val.section.name = (yyvsp[-1].str); + (yyval.output_rule)->val.section.input = new_input_rule (input_section); + (yyval.output_rule)->val.section.input->next = NULL; + (yyval.output_rule)->val.section.input->val.section = (struct filemask_section_name *) obstack_alloc (&ld_state.smem, sizeof (struct filemask_section_name)); - yyval.output_rule->val.section.input->val.section->filemask = NULL; - yyval.output_rule->val.section.input->val.section->excludemask = NULL; - yyval.output_rule->val.section.input->val.section->section_name = - new_input_section_name (yyvsp[-1].str, false); - yyval.output_rule->val.section.input->val.section->keep_flag = false; + (yyval.output_rule)->val.section.input->val.section->filemask = NULL; + (yyval.output_rule)->val.section.input->val.section->excludemask = NULL; + (yyval.output_rule)->val.section.input->val.section->section_name = + new_input_section_name ((yyvsp[-1].str), false); + (yyval.output_rule)->val.section.input->val.section->keep_flag = false; if (ld_state.strip == strip_debug - && ebl_debugscn_p (ld_state.ebl, yyvsp[-1].str)) - yyval.output_rule->val.section.ignored = true; + && ebl_debugscn_p (ld_state.ebl, (yyvsp[-1].str))) + (yyval.output_rule)->val.section.ignored = true; else - yyval.output_rule->val.section.ignored = false; + (yyval.output_rule)->val.section.ignored = false; } break; - case 21: -#line 236 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.assignment = new_assignment (yyvsp[-2].str, yyvsp[0].expr, false); } - break; - case 22: -#line 238 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.assignment = new_assignment (yyvsp[-3].str, yyvsp[-1].expr, true); } +#line 240 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.assignment) = new_assignment ((yyvsp[-2].str), (yyvsp[0].expr), false); } break; case 23: -#line 242 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyvsp[0].input_rule->next = yyvsp[-1].input_rule->next; - yyval.input_rule = yyvsp[-1].input_rule->next = yyvsp[0].input_rule; - } +#line 242 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.assignment) = new_assignment ((yyvsp[-3].str), (yyvsp[-1].expr), true); } break; case 24: -#line 247 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.input_rule = yyvsp[0].input_rule; } +#line 246 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyvsp[0].input_rule)->next = (yyvsp[-1].input_rule)->next; + (yyval.input_rule) = (yyvsp[-1].input_rule)->next = (yyvsp[0].input_rule); + } break; case 25: -#line 251 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyval.input_rule = new_input_rule (input_section); - yyval.input_rule->val.section = yyvsp[0].filemask_section_name; - } +#line 251 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.input_rule) = (yyvsp[0].input_rule); } break; case 26: -#line 256 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 255 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyvsp[-1].filemask_section_name->keep_flag = true; - - yyval.input_rule = new_input_rule (input_section); - yyval.input_rule->val.section = yyvsp[-1].filemask_section_name; + (yyval.input_rule) = new_input_rule (input_section); + (yyval.input_rule)->val.section = (yyvsp[0].filemask_section_name); } break; case 27: -#line 263 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 260 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.input_rule = new_input_rule (input_assignment); - yyval.input_rule->val.assignment = yyvsp[-1].assignment; + (yyvsp[-1].filemask_section_name)->keep_flag = true; + + (yyval.input_rule) = new_input_rule (input_section); + (yyval.input_rule)->val.section = (yyvsp[-1].filemask_section_name); } break; case 28: -#line 270 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 267 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.filemask_section_name = (struct filemask_section_name *) - obstack_alloc (&ld_state.smem, sizeof (*yyval.filemask_section_name)); - yyval.filemask_section_name->filemask = yyvsp[-4].str; - yyval.filemask_section_name->excludemask = yyvsp[-2].str; - yyval.filemask_section_name->section_name = yyvsp[-1].sectionname; - yyval.filemask_section_name->keep_flag = false; + (yyval.input_rule) = new_input_rule (input_assignment); + (yyval.input_rule)->val.assignment = (yyvsp[-1].assignment); } break; case 29: -#line 281 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.sectionname = new_input_section_name (yyvsp[0].str, false); } +#line 274 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyval.filemask_section_name) = (struct filemask_section_name *) + obstack_alloc (&ld_state.smem, sizeof (*(yyval.filemask_section_name))); + (yyval.filemask_section_name)->filemask = (yyvsp[-4].str); + (yyval.filemask_section_name)->excludemask = (yyvsp[-2].str); + (yyval.filemask_section_name)->section_name = (yyvsp[-1].sectionname); + (yyval.filemask_section_name)->keep_flag = false; + } break; case 30: -#line 283 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.sectionname = new_input_section_name (yyvsp[-1].str, true); } +#line 285 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.sectionname) = new_input_section_name ((yyvsp[0].str), false); } break; case 31: -#line 287 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = yyvsp[-1].str; } +#line 287 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.sectionname) = new_input_section_name ((yyvsp[-1].str), true); } break; case 32: -#line 289 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = NULL; } +#line 291 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = (yyvsp[-1].str); } break; case 33: -#line 293 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyval.expr = new_expr (exp_align); - yyval.expr->val.child = yyvsp[-1].expr; - } +#line 293 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = NULL; } break; case 34: -#line 298 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.expr = yyvsp[-1].expr; } +#line 297 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyval.expr) = new_expr (exp_align); + (yyval.expr)->val.child = (yyvsp[-1].expr); + } break; case 35: -#line 300 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyval.expr = new_expr (exp_mult); - yyval.expr->val.binary.left = yyvsp[-2].expr; - yyval.expr->val.binary.right = yyvsp[0].expr; - } +#line 302 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.expr) = (yyvsp[-1].expr); } break; case 36: -#line 306 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 304 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (yyvsp[-1].op); - yyval.expr->val.binary.left = yyvsp[-2].expr; - yyval.expr->val.binary.right = yyvsp[0].expr; + (yyval.expr) = new_expr (exp_mult); + (yyval.expr)->val.binary.left = (yyvsp[-2].expr); + (yyval.expr)->val.binary.right = (yyvsp[0].expr); } break; case 37: -#line 312 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 310 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (yyvsp[-1].op); - yyval.expr->val.binary.left = yyvsp[-2].expr; - yyval.expr->val.binary.right = yyvsp[0].expr; + (yyval.expr) = new_expr ((yyvsp[-1].op)); + (yyval.expr)->val.binary.left = (yyvsp[-2].expr); + (yyval.expr)->val.binary.right = (yyvsp[0].expr); } break; case 38: -#line 318 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 316 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (exp_and); - yyval.expr->val.binary.left = yyvsp[-2].expr; - yyval.expr->val.binary.right = yyvsp[0].expr; + (yyval.expr) = new_expr ((yyvsp[-1].op)); + (yyval.expr)->val.binary.left = (yyvsp[-2].expr); + (yyval.expr)->val.binary.right = (yyvsp[0].expr); } break; case 39: -#line 324 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 322 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (exp_or); - yyval.expr->val.binary.left = yyvsp[-2].expr; - yyval.expr->val.binary.right = yyvsp[0].expr; + (yyval.expr) = new_expr (exp_and); + (yyval.expr)->val.binary.left = (yyvsp[-2].expr); + (yyval.expr)->val.binary.right = (yyvsp[0].expr); } break; case 40: -#line 330 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 328 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (exp_num); - yyval.expr->val.num = yyvsp[0].num; + (yyval.expr) = new_expr (exp_or); + (yyval.expr)->val.binary.left = (yyvsp[-2].expr); + (yyval.expr)->val.binary.right = (yyvsp[0].expr); } break; case 41: -#line 335 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 334 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyval.expr = new_expr (exp_id); - yyval.expr->val.str = yyvsp[0].str; + (yyval.expr) = new_expr (exp_num); + (yyval.expr)->val.num = (yyvsp[0].num); } break; case 42: -#line 340 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.expr = new_expr (exp_sizeof_headers); } +#line 339 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyval.expr) = new_expr (exp_id); + (yyval.expr)->val.str = (yyvsp[0].str); + } break; case 43: -#line 342 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.expr = new_expr (exp_pagesize); } +#line 344 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.expr) = new_expr (exp_sizeof_headers); } break; case 44: -#line 346 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - struct filename_list *newp = new_filename_listelem (yyvsp[0].str); - newp->next = yyvsp[-2].filename_list->next; - yyval.filename_list = yyvsp[-2].filename_list->next = newp; - } +#line 346 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.expr) = new_expr (exp_pagesize); } break; case 45: -#line 352 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.filename_list = new_filename_listelem (yyvsp[0].str); } - break; - - case 48: -#line 360 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 350 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyvsp[0].version->next = yyvsp[-1].version->next; - yyval.version = yyvsp[-1].version->next = yyvsp[0].version; + /* First little optimization. If there is only one + file in the group don't do anything. */ + if ((yyvsp[-1].filename_list) != (yyvsp[-1].filename_list)->next) + { + (yyvsp[-1].filename_list)->next->group_start = 1; + (yyvsp[-1].filename_list)->group_end = 1; + } + (yyval.filename_list) = (yyvsp[-1].filename_list); } break; - case 49: -#line 365 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.version = yyvsp[0].version; } + case 46: +#line 361 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.filename_list) = mark_as_needed ((yyvsp[-1].filename_list)); } break; - case 50: -#line 369 "/home/drepper/gnu/elfutils/src/ldscript.y" + case 47: +#line 363 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyvsp[-2].version->versionname = ""; - yyvsp[-2].version->parentname = NULL; - yyval.version = yyvsp[-2].version; + struct filename_list *newp = new_filename_listelem ((yyvsp[0].str)); + newp->next = (yyvsp[-2].filename_list)->next; + (yyval.filename_list) = (yyvsp[-2].filename_list)->next = newp; } break; + case 48: +#line 369 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.filename_list) = new_filename_listelem ((yyvsp[0].str)); } + break; + case 51: -#line 375 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 377 "/home/drepper/devel/elfutils/src/ldscript.y" { - yyvsp[-2].version->versionname = yyvsp[-4].str; - yyvsp[-2].version->parentname = NULL; - yyval.version = yyvsp[-2].version; + (yyvsp[0].version)->next = (yyvsp[-1].version)->next; + (yyval.version) = (yyvsp[-1].version)->next = (yyvsp[0].version); } break; case 52: -#line 381 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - yyvsp[-3].version->versionname = yyvsp[-5].str; - yyvsp[-3].version->parentname = yyvsp[-1].str; - yyval.version = yyvsp[-3].version; - } +#line 382 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.version) = (yyvsp[0].version); } break; case 53: -#line 390 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.version = merge_versions (yyvsp[-1].version, yyvsp[0].version); } +#line 386 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyvsp[-2].version)->versionname = ""; + (yyvsp[-2].version)->parentname = NULL; + (yyval.version) = (yyvsp[-2].version); + } break; case 54: -#line 392 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.version = yyvsp[0].version; } +#line 392 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyvsp[-2].version)->versionname = (yyvsp[-4].str); + (yyvsp[-2].version)->parentname = NULL; + (yyval.version) = (yyvsp[-2].version); + } break; case 55: -#line 396 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.version = new_version (NULL, yyvsp[0].id_list); } +#line 398 "/home/drepper/devel/elfutils/src/ldscript.y" + { + (yyvsp[-3].version)->versionname = (yyvsp[-5].str); + (yyvsp[-3].version)->parentname = (yyvsp[-1].str); + (yyval.version) = (yyvsp[-3].version); + } break; case 56: -#line 398 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.version = new_version (yyvsp[0].id_list, NULL); } +#line 407 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.version) = merge_versions ((yyvsp[-1].version), (yyvsp[0].version)); } break; case 57: -#line 403 "/home/drepper/gnu/elfutils/src/ldscript.y" - { - struct id_list *newp = new_id_listelem (yyvsp[-1].str); - newp->next = yyvsp[-2].id_list->next; - yyval.id_list = yyvsp[-2].id_list->next = newp; - } +#line 409 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.version) = (yyvsp[0].version); } break; case 58: -#line 409 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.id_list = new_id_listelem (yyvsp[-1].str); } +#line 413 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.version) = new_version (NULL, (yyvsp[0].id_list)); } break; case 59: -#line 413 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = yyvsp[0].str; } +#line 415 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.version) = new_version ((yyvsp[0].id_list), NULL); } break; case 60: -#line 415 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = yyvsp[0].str; } +#line 420 "/home/drepper/devel/elfutils/src/ldscript.y" + { + struct id_list *newp = new_id_listelem ((yyvsp[-1].str)); + newp->next = (yyvsp[-2].id_list)->next; + (yyval.id_list) = (yyvsp[-2].id_list)->next = newp; + } break; case 61: -#line 419 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = yyvsp[0].str; } +#line 426 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.id_list) = new_id_listelem ((yyvsp[-1].str)); } break; case 62: -#line 421 "/home/drepper/gnu/elfutils/src/ldscript.y" - { yyval.str = NULL; } +#line 430 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = (yyvsp[0].str); } + break; + + case 63: +#line 432 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = (yyvsp[0].str); } + break; + + case 64: +#line 436 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = (yyvsp[0].str); } + break; + + case 65: +#line 438 "/home/drepper/devel/elfutils/src/ldscript.y" + { (yyval.str) = NULL; } break; } -/* Line 1000 of yacc.c. */ -#line 1654 "ldscript.c" +/* Line 1037 of yacc.c. */ +#line 1716 "ldscript.c" yyvsp -= yylen; yyssp -= yylen; @@ -1750,7 +1812,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1760,23 +1822,22 @@ yyerrlab: if (yychar == YYEOF) for (;;) { + YYPOPSTACK; if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); + yydestruct ("Error: popping", + yystos[*yyssp], yyvsp); } } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; - } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -1793,7 +1854,7 @@ yyerrorlab: goto yyerrorlab; #endif - yyvsp -= yylen; +yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -1823,8 +1884,8 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); + + yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1833,11 +1894,12 @@ yyerrlab1: if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1853,6 +1915,9 @@ yyacceptlab: | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: + yydestruct ("Error: discarding lookahead", + yytoken, &yylval); + yychar = YYEMPTY; yyresult = 1; goto yyreturn; @@ -1875,7 +1940,7 @@ yyreturn: } -#line 424 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 441 "/home/drepper/devel/elfutils/src/ldscript.y" static void @@ -2001,6 +2066,20 @@ new_filename_listelem (const char *string) } +static struct filename_list * +mark_as_needed (struct filename_list *listp) +{ + struct filename_list *runp = listp; + while (runp != NULL) + { + runp->as_needed = true; + runp = runp->next; + } + + return listp; +} + + static void add_inputfiles (struct filename_list *fnames) { diff --git a/elfutils/src/ldscript.h b/elfutils/src/ldscript.h index 6464d8da..64ba54f4 100644 --- a/elfutils/src/ldscript.h +++ b/elfutils/src/ldscript.h @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 2.0. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 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 @@ -31,64 +31,66 @@ enum yytokentype { kADD_OP = 258, kALIGN = 259, - kENTRY = 260, - kEXCLUDE_FILE = 261, - kFILENAME = 262, - kGLOBAL = 263, - kGROUP = 264, - kID = 265, - kINPUT = 266, - kINTERP = 267, - kKEEP = 268, - kLOCAL = 269, - kMODE = 270, - kMUL_OP = 271, - kNUM = 272, - kOUTPUT_FORMAT = 273, - kPAGESIZE = 274, - kPROVIDE = 275, - kSEARCH_DIR = 276, - kSEGMENT = 277, - kSIZEOF_HEADERS = 278, - kSORT = 279, - kVERSION = 280, - kVERSION_SCRIPT = 281, - ADD_OP = 282, - MUL_OP = 283 + kAS_NEEDED = 260, + kENTRY = 261, + kEXCLUDE_FILE = 262, + kFILENAME = 263, + kGLOBAL = 264, + kGROUP = 265, + kID = 266, + kINPUT = 267, + kINTERP = 268, + kKEEP = 269, + kLOCAL = 270, + kMODE = 271, + kMUL_OP = 272, + kNUM = 273, + kOUTPUT_FORMAT = 274, + kPAGESIZE = 275, + kPROVIDE = 276, + kSEARCH_DIR = 277, + kSEGMENT = 278, + kSIZEOF_HEADERS = 279, + kSORT = 280, + kVERSION = 281, + kVERSION_SCRIPT = 282, + ADD_OP = 283, + MUL_OP = 284 }; #endif #define kADD_OP 258 #define kALIGN 259 -#define kENTRY 260 -#define kEXCLUDE_FILE 261 -#define kFILENAME 262 -#define kGLOBAL 263 -#define kGROUP 264 -#define kID 265 -#define kINPUT 266 -#define kINTERP 267 -#define kKEEP 268 -#define kLOCAL 269 -#define kMODE 270 -#define kMUL_OP 271 -#define kNUM 272 -#define kOUTPUT_FORMAT 273 -#define kPAGESIZE 274 -#define kPROVIDE 275 -#define kSEARCH_DIR 276 -#define kSEGMENT 277 -#define kSIZEOF_HEADERS 278 -#define kSORT 279 -#define kVERSION 280 -#define kVERSION_SCRIPT 281 -#define ADD_OP 282 -#define MUL_OP 283 +#define kAS_NEEDED 260 +#define kENTRY 261 +#define kEXCLUDE_FILE 262 +#define kFILENAME 263 +#define kGLOBAL 264 +#define kGROUP 265 +#define kID 266 +#define kINPUT 267 +#define kINTERP 268 +#define kKEEP 269 +#define kLOCAL 270 +#define kMODE 271 +#define kMUL_OP 272 +#define kNUM 273 +#define kOUTPUT_FORMAT 274 +#define kPAGESIZE 275 +#define kPROVIDE 276 +#define kSEARCH_DIR 277 +#define kSEGMENT 278 +#define kSIZEOF_HEADERS 279 +#define kSORT 280 +#define kVERSION 281 +#define kVERSION_SCRIPT 282 +#define ADD_OP 283 +#define MUL_OP 284 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 58 "/home/drepper/gnu/elfutils/src/ldscript.y" +#line 59 "/home/drepper/devel/elfutils/src/ldscript.y" typedef union YYSTYPE { uintmax_t num; enum expression_tag op; @@ -103,8 +105,8 @@ typedef union YYSTYPE { struct version *version; struct id_list *id_list; } YYSTYPE; -/* Line 1275 of yacc.c. */ -#line 108 "ldscript.h" +/* Line 1318 of yacc.c. */ +#line 110 "ldscript.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 diff --git a/elfutils/src/ldscript.y b/elfutils/src/ldscript.y index 8f68078d..23741b7d 100644 --- a/elfutils/src/ldscript.y +++ b/elfutils/src/ldscript.y @@ -1,6 +1,6 @@ %{ /* Parser for linker scripts. - Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -46,6 +46,7 @@ static void new_segment (int mode, struct output_rule *output_rule); static struct filename_list *new_filename_listelem (const char *string); static void add_inputfiles (struct filename_list *fnames); static struct id_list *new_id_listelem (const char *str); + static struct filename_list *mark_as_needed (struct filename_list *listp); static struct version *new_version (struct id_list *local, struct id_list *global); static struct version *merge_versions (struct version *one, @@ -72,6 +73,7 @@ extern int yylex (void); %token kADD_OP %token kALIGN +%token kAS_NEEDED %token kENTRY %token kEXCLUDE_FILE %token <str> kFILENAME @@ -176,6 +178,8 @@ content: kENTRY '(' kID ')' ';' } | kINPUT '(' filename_id_list ')' { add_inputfiles ($3); } + | kAS_NEEDED '(' filename_id_list ')' + { add_inputfiles (mark_as_needed ($3)); } | kVERSION '{' versionlist '}' { add_versions ($3); } | kOUTPUT_FORMAT '(' filename_id ')' @@ -342,7 +346,20 @@ expr: kALIGN '(' expr ')' { $$ = new_expr (exp_pagesize); } ; -filename_id_list: filename_id_list comma_opt filename_id +filename_id_list: kGROUP '(' filename_id_list ')' + { + /* First little optimization. If there is only one + file in the group don't do anything. */ + if ($3 != $3->next) + { + $3->next->group_start = 1; + $3->group_end = 1; + } + $$ = $3; + } + | kAS_NEEDED '(' filename_id_list ')' + { $$ = mark_as_needed ($3); } + | filename_id_list comma_opt filename_id { struct filename_list *newp = new_filename_listelem ($3); newp->next = $1->next; @@ -546,6 +563,20 @@ new_filename_listelem (const char *string) } +static struct filename_list * +mark_as_needed (struct filename_list *listp) +{ + struct filename_list *runp = listp; + while (runp != NULL) + { + runp->as_needed = true; + runp = runp->next; + } + + return listp; +} + + static void add_inputfiles (struct filename_list *fnames) { diff --git a/elfutils/src/nm.c b/elfutils/src/nm.c index 1a297054..9d7dd070 100644 --- a/elfutils/src/nm.c +++ b/elfutils/src/nm.c @@ -1,5 +1,5 @@ -/* Print information from ELF file in human-readable form. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Print symbol information from ELF file in human-readable form. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -48,6 +48,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Values for the parameters which have no short form. */ #define OPT_DEFINED 0x100 @@ -98,13 +101,10 @@ static const char args_doc[] = N_("[FILE...]"); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc, NULL, more_help, NULL + options, parse_opt, args_doc, doc, NULL, NULL, NULL }; @@ -235,21 +235,22 @@ main (int argc, char *argv[]) /* Print the version information. */ static void -print_version (FILE *stream, /*@unused@*/ struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "nm (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } /* Handle program arguments. */ static error_t -parse_opt (int key, char *arg, /*@unused@*/ struct argp_state *state) +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { switch (key) { @@ -339,27 +340,6 @@ parse_opt (int key, char *arg, /*@unused@*/ struct argp_state *state) } -static char * -more_help (int key, const char *text, /*@unused@*/ void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - /* Open the file and determine the type. */ static int process_file (const char *fname, bool more_than_one) @@ -368,7 +348,7 @@ process_file (const char *fname, bool more_than_one) int fd = open (fname, O_RDONLY); if (fd == -1) { - error (0, errno, fname); + error (0, errno, gettext ("cannot open '%s'"), fname); return 1; } @@ -385,7 +365,7 @@ process_file (const char *fname, bool more_than_one) INTERNAL_ERROR (fname); if (close (fd) != 0) - error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname); + error (EXIT_FAILURE, errno, gettext ("while close '%s'"), fname); return result; } @@ -397,7 +377,7 @@ process_file (const char *fname, bool more_than_one) INTERNAL_ERROR (fname); if (close (fd) != 0) - error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname); + error (EXIT_FAILURE, errno, gettext ("while close '%s'"), fname); return result; } @@ -548,7 +528,8 @@ static void *global_root; static int -get_global (Dwarf *dbg, Dwarf_Global *global, void *arg) +get_global (Dwarf *dbg __attribute__ ((unused)), Dwarf_Global *global, + void *arg __attribute__ ((unused))) { tsearch (memcpy (xmalloc (sizeof (Dwarf_Global)), global, sizeof (Dwarf_Global)), @@ -630,7 +611,7 @@ static void *local_root; static void -get_local_names (Ebl *ebl, Dwarf *dbg) +get_local_names (Dwarf *dbg) { Dwarf_Off offset = 0; Dwarf_Off old_offset; @@ -839,7 +820,7 @@ class_type_char (GElf_Sym *sym) static void -show_symbols_bsd (Elf *elf, GElf_Ehdr *ehdr, GElf_Word strndx, +show_symbols_bsd (Elf *elf, GElf_Word strndx, const char *prefix, const char *fname, const char *fullname, GElf_SymX *syms, size_t nsyms) { @@ -902,8 +883,7 @@ show_symbols_bsd (Elf *elf, GElf_Ehdr *ehdr, GElf_Word strndx, static void -show_symbols_posix (Elf *elf, GElf_Ehdr *ehdr, GElf_Word strndx, - const char *prefix, const char *fname, +show_symbols_posix (Elf *elf, GElf_Word strndx, const char *prefix, const char *fullname, GElf_SymX *syms, size_t nsyms) { if (prefix != NULL && ! print_file_name) @@ -1021,7 +1001,7 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn, { (void) dwarf_getpubnames (dbg, get_global, NULL, 0); - get_local_names (ebl, dbg); + get_local_names (dbg); } } @@ -1171,15 +1151,15 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn, break; case format_bsd: - show_symbols_bsd (ebl->elf, ehdr, shdr->sh_link, prefix, fname, - fullname, sym_mem, nentries); + show_symbols_bsd (ebl->elf, shdr->sh_link, prefix, fname, fullname, + sym_mem, nentries); break; case format_posix: default: assert (format == format_posix); - show_symbols_posix (ebl->elf, ehdr, shdr->sh_link, prefix, fname, - fullname, sym_mem, nentries); + show_symbols_posix (ebl->elf, shdr->sh_link, prefix, fullname, sym_mem, + nentries); break; } diff --git a/elfutils/src/readelf.c b/elfutils/src/readelf.c index 6129e29d..8386a397 100644 --- a/elfutils/src/readelf.c +++ b/elfutils/src/readelf.c @@ -1,5 +1,5 @@ /* Print information from ELF file in human-readable form. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1999. This program is Open Source software; you can redistribute it and/or @@ -45,30 +45,33 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { - { NULL, 0, NULL, 0, N_("Output selection:") }, - { "all", 'a', NULL, 0, N_("Equivalent to: -h -l") }, - { "dynamic", 'd', NULL, 0, N_("Display the dynamic segment") }, - { "file-header", 'h', NULL, 0, N_("Display the ELF file header") }, + { NULL, 0, NULL, 0, N_("Output selection:"), 0 }, + { "all", 'a', NULL, 0, N_("Equivalent to: -h -l"), 0 }, + { "dynamic", 'd', NULL, 0, N_("Display the dynamic segment"), 0 }, + { "file-header", 'h', NULL, 0, N_("Display the ELF file header"), 0 }, { "histogram", 'I', NULL, 0, - N_("Display histogram of bucket list lengths") }, - { "program-headers", 'l', NULL, 0, N_("Display the program headers") }, - { "relocs", 'r', NULL, 0, N_("Display relocations") }, - { "section-headers", 'S', NULL, 0, N_("Display the sections' header") }, - { "symbols", 's', NULL, 0, N_("Display the symbol table") }, - { "version-info", 'V', NULL, 0, N_("Display versioning information") }, + N_("Display histogram of bucket list lengths"), 0 }, + { "program-headers", 'l', NULL, 0, N_("Display the program headers"), 0 }, + { "relocs", 'r', NULL, 0, N_("Display relocations"), 0 }, + { "section-headers", 'S', NULL, 0, N_("Display the sections' header"), 0 }, + { "symbols", 's', NULL, 0, N_("Display the symbol table"), 0 }, + { "version-info", 'V', NULL, 0, N_("Display versioning information"), 0 }, { "debug-dump", 'w', "SECTION", OPTION_ARG_OPTIONAL, N_("Display DWARF section content. SECTION can be one of abbrev, " - "aranges, frame, info, loc, line, pubnames, str, or macinfo.") }, - { "notes", 'n', NULL, 0, N_("Display the core notes") }, + "aranges, frame, info, loc, line, pubnames, str, or macinfo."), 0 }, + { "notes", 'n', NULL, 0, N_("Display the core notes"), 0 }, { "arch-specific", 'A', NULL, 0, - N_("Display architecture specific information (if any)") }, + N_("Display architecture specific information (if any)"), 0 }, - { NULL, 0, NULL, 0, N_("Output control:") }, + { NULL, 0, NULL, 0, N_("Output control:"), 0 }, - { NULL, 0, NULL, 0, NULL } + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -81,21 +84,15 @@ static const char args_doc[] = N_("FILE..."); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc, NULL, more_help + options, parse_opt, args_doc, doc, NULL, NULL, NULL }; /* Flags set by the option controlling the output. */ -/* True if any of the control options is set. */ -static bool any_control_option; - /* True if dynamic segment should be printed. */ static bool print_dynamic_table; @@ -158,35 +155,27 @@ static void process_elf_file (Elf *elf, const char *prefix, const char *fname, static void print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr); static void print_shdr (Ebl *ebl, GElf_Ehdr *ehdr); static void print_phdr (Ebl *ebl, GElf_Ehdr *ehdr); -static void print_scngrp (Ebl *ebl, GElf_Ehdr *ehdr); -static void print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr); -static void print_relocs (Ebl *ebl, GElf_Ehdr *ehdr); -static void handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr); -static void handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr); -static void print_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int type); -static void handle_symtab (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr); -static void print_verinfo (Ebl *ebl, GElf_Ehdr *ehdr); -static void handle_verneed (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr); -static void handle_verdef (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr); -static void handle_versym (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +static void print_scngrp (Ebl *ebl); +static void print_dynamic (Ebl *ebl); +static void print_relocs (Ebl *ebl); +static void handle_relocs_rel (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); +static void handle_relocs_rela (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); +static void print_symtab (Ebl *ebl, int type); +static void handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); +static void print_verinfo (Ebl *ebl); +static void handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); +static void handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); +static void handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr); static void print_debug (Ebl *ebl, GElf_Ehdr *ehdr); -static void handle_hash (Ebl *ebl, GElf_Ehdr *ehdr); +static void handle_hash (Ebl *ebl); static void handle_notes (Ebl *ebl, GElf_Ehdr *ehdr); -static void print_liblist (Ebl *ebl, GElf_Ehdr *ehdr); +static void print_liblist (Ebl *ebl); int main (int argc, char *argv[]) { - int remaining; - bool only_one; - /* Set locale. */ setlocale (LC_ALL, ""); @@ -194,29 +183,18 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* Parse and process arguments. */ + int remaining; argp_parse (&argp, argc, argv, 0, &remaining, NULL); - /* If no control option or no ELF file is given punt. */ - if ((any_control_option == 0 && print_debug_sections == 0) - || remaining >= argc) - { - argp_help (&argp, stdout, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, - program_invocation_short_name); - exit (1); - } - /* Before we start tell the ELF library which version we are using. */ elf_version (EV_CURRENT); /* Now process all the files given at the command line. */ - only_one = remaining + 1 == argc; + bool only_one = remaining + 1 == argc; do { - int fd; - Elf *elf; - /* Open the file. */ - fd = open (argv[remaining], O_RDONLY); + int fd = open (argv[remaining], O_RDONLY); if (fd == -1) { error (0, errno, gettext ("cannot open input file")); @@ -224,7 +202,7 @@ main (int argc, char *argv[]) } /* Create an `Elf' descriptor. */ - elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); if (elf == NULL) error (0, 0, gettext ("cannot generate Elf descriptor: %s\n"), elf_errmsg (-1)); @@ -248,8 +226,12 @@ main (int argc, char *argv[]) /* Handle program arguments. */ static error_t -parse_opt (int key, char *arg, struct argp_state *state) +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { + /* True if any of the control options is set. */ + static bool any_control_option; + switch (key) { case 'a': @@ -339,6 +321,20 @@ parse_opt (int key, char *arg, struct argp_state *state) program_invocation_short_name); exit (1); } + any_control_option = true; + break; + case ARGP_KEY_NO_ARGS: + fputs (gettext ("Missing file name.\n"), stderr); + goto do_argp_help; + case ARGP_KEY_FINI: + if (! any_control_option) + { + fputs (gettext ("No operation specified.\n"), stderr); + do_argp_help: + argp_help (&argp, stderr, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, + program_invocation_short_name); + exit (1); + } break; default: return ARGP_ERR_UNKNOWN; @@ -347,37 +343,16 @@ parse_opt (int key, char *arg, struct argp_state *state) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "readelf (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } @@ -497,21 +472,21 @@ process_elf_file (Elf *elf, const char *prefix, const char *fname, if (print_program_header) print_phdr (ebl, ehdr); if (print_section_groups) - print_scngrp (ebl, ehdr); + print_scngrp (ebl); if (print_dynamic_table) - print_dynamic (ebl, ehdr); + print_dynamic (ebl); if (print_relocations) - print_relocs (ebl, ehdr); + print_relocs (ebl); if (print_histogram) - handle_hash (ebl, ehdr); + handle_hash (ebl); if (print_symbol_table) - print_symtab (ebl, ehdr, SHT_DYNSYM); + print_symtab (ebl, SHT_DYNSYM); if (print_version_info) - print_verinfo (ebl, ehdr); + print_verinfo (ebl); if (print_symbol_table) - print_symtab (ebl, ehdr, SHT_SYMTAB); + print_symtab (ebl, SHT_SYMTAB); if (print_arch) - print_liblist (ebl, ehdr); + print_liblist (ebl); if (print_debug_sections != 0) print_debug (ebl, ehdr); if (print_notes) @@ -851,6 +826,7 @@ print_phdr (Ebl *ebl, GElf_Ehdr *ehdr) /* Iterate over the sections. */ bool in_relro = false; + bool in_ro = false; for (inner = 1; inner < shnum; ++inner) { Elf_Scn *scn = elf_getscn (ebl->elf, inner); @@ -895,6 +871,45 @@ print_phdr (Ebl *ebl, GElf_Ehdr *ehdr) else if (has_relro && in_relro && shdr->sh_addr + shdr->sh_size > relro_to) fputs_unlocked ("] <RELRO:", stdout); + else if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_W) == 0) + { + if (!in_ro) + { + fputs_unlocked (" [RO:", stdout); + in_ro = true; + } + } + else + { + /* Determine the segment this section is part of. */ + size_t cnt2; + GElf_Phdr *phdr2 = NULL; + for (cnt2 = 0; cnt2 < ehdr->e_phnum; ++cnt2) + { + GElf_Phdr phdr2_mem; + phdr2 = gelf_getphdr (ebl->elf, cnt2, &phdr2_mem); + + if (phdr2 != NULL && phdr2->p_type == PT_LOAD + && shdr->sh_addr >= phdr2->p_vaddr + && (shdr->sh_addr + shdr->sh_size + <= phdr2->p_vaddr + phdr2->p_memsz)) + break; + } + + if (cnt2 < ehdr->e_phnum) + { + if ((phdr2->p_flags & PF_W) == 0 && !in_ro) + { + fputs_unlocked (" [RO:", stdout); + in_ro = true; + } + else if ((phdr2->p_flags & PF_W) != 0 && in_ro) + { + fputs_unlocked ("]", stdout); + in_ro = false; + } + } + } printf (" %s", elf_strptr (ebl->elf, shstrndx, shdr->sh_name)); @@ -908,7 +923,7 @@ print_phdr (Ebl *ebl, GElf_Ehdr *ehdr) } } } - if (in_relro) + if (in_relro || in_ro) fputs_unlocked ("]", stdout); /* Finish the line. */ @@ -918,7 +933,7 @@ print_phdr (Ebl *ebl, GElf_Ehdr *ehdr) static void -handle_scngrp (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_scngrp (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { Elf_Data *data; Elf32_Word *grpref; @@ -985,7 +1000,7 @@ handle_scngrp (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) static void -print_scngrp (Ebl *ebl, GElf_Ehdr *ehdr) +print_scngrp (Ebl *ebl) { /* Find all relocation sections and handle them. */ Elf_Scn *scn = NULL; @@ -997,7 +1012,7 @@ print_scngrp (Ebl *ebl, GElf_Ehdr *ehdr) GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); if (shdr != NULL && shdr->sh_type == SHT_GROUP) - handle_scngrp (ebl, ehdr, scn, shdr); + handle_scngrp (ebl, scn, shdr); } } @@ -1112,7 +1127,7 @@ print_dt_posflag_1 (int class, GElf_Xword d_val) static void -handle_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); GElf_Shdr glink; @@ -1244,7 +1259,7 @@ handle_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) /* Print the dynamic segment. */ static void -print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr) +print_dynamic (Ebl *ebl) { /* Find all relocation sections and handle them. */ Elf_Scn *scn = NULL; @@ -1257,7 +1272,7 @@ print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr) if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC) { - handle_dynamic (ebl, ehdr, scn, shdr); + handle_dynamic (ebl, scn, shdr); break; } } @@ -1266,7 +1281,7 @@ print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr) /* Print relocations. */ static void -print_relocs (Ebl *ebl, GElf_Ehdr *ehdr) +print_relocs (Ebl *ebl) { /* Find all relocation sections and handle them. */ Elf_Scn *scn = NULL; @@ -1280,9 +1295,9 @@ print_relocs (Ebl *ebl, GElf_Ehdr *ehdr) if (shdr != NULL) { if (shdr->sh_type == SHT_REL) - handle_relocs_rel (ebl, ehdr, scn, shdr); + handle_relocs_rel (ebl, scn, shdr); else if (shdr->sh_type == SHT_RELA) - handle_relocs_rela (ebl, ehdr, scn, shdr); + handle_relocs_rela (ebl, scn, shdr); } } } @@ -1290,7 +1305,7 @@ print_relocs (Ebl *ebl, GElf_Ehdr *ehdr) /* Handle a relocation section. */ static void -handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_relocs_rel (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); int nentries = shdr->sh_size / shdr->sh_entsize; @@ -1456,7 +1471,7 @@ handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) /* Handle a relocation section. */ static void -handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_relocs_rela (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); int nentries = shdr->sh_size / shdr->sh_entsize; @@ -1604,7 +1619,7 @@ handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) /* Print the program header. */ static void -print_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int type) +print_symtab (Ebl *ebl, int type) { /* Find the symbol table(s). For this we have to search through the section table. */ @@ -1617,13 +1632,13 @@ print_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int type) GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); if (shdr != NULL && shdr->sh_type == (GElf_Word) type) - handle_symtab (ebl, ehdr, scn, shdr); + handle_symtab (ebl, scn, shdr); } } static void -handle_symtab (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { Elf_Data *versym_data = NULL; Elf_Data *verneed_data = NULL; @@ -1863,7 +1878,7 @@ handle_symtab (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) /* Print version information. */ static void -print_verinfo (Ebl *ebl, GElf_Ehdr *ehdr) +print_verinfo (Ebl *ebl) { /* Find the version information sections. For this we have to search through the section table. */ @@ -1878,11 +1893,11 @@ print_verinfo (Ebl *ebl, GElf_Ehdr *ehdr) if (shdr != NULL) { if (shdr->sh_type == SHT_GNU_verneed) - handle_verneed (ebl, ehdr, scn, shdr); + handle_verneed (ebl, scn, shdr); else if (shdr->sh_type == SHT_GNU_verdef) - handle_verdef (ebl, ehdr, scn, shdr); + handle_verdef (ebl, scn, shdr); else if (shdr->sh_type == SHT_GNU_versym) - handle_versym (ebl, ehdr, scn, shdr); + handle_versym (ebl, scn, shdr); } } } @@ -1921,7 +1936,7 @@ get_ver_flags (unsigned int flags) static void -handle_verneed (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { Elf_Data *data; int class = gelf_getclass (ebl->elf); @@ -1998,7 +2013,7 @@ handle_verneed (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) static void -handle_verdef (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { Elf_Data *data; int class = gelf_getclass (ebl->elf); @@ -2081,7 +2096,7 @@ handle_verdef (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) static void -handle_versym (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) +handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { Elf_Data *data; int class = gelf_getclass (ebl->elf); @@ -2374,7 +2389,7 @@ handle_versym (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) static void -handle_hash (Ebl *ebl, GElf_Ehdr *ehdr) +handle_hash (Ebl *ebl) { /* Find the symbol table(s). For this we have to search through the section table. */ @@ -2500,7 +2515,7 @@ handle_hash (Ebl *ebl, GElf_Ehdr *ehdr) static void -print_liblist (Ebl *ebl, GElf_Ehdr *ehdr) +print_liblist (Ebl *ebl) { /* Find the library list sections. For this we have to search through the section table. */ @@ -2916,7 +2931,7 @@ dwarf_lang_string (unsigned int lang) if (lang >= DW_LANG_lo_user && lang <= DW_LANG_hi_user) { - static char buf[100]; + static char buf[30]; snprintf (buf, sizeof (buf), "lo_user+%u", lang - DW_LANG_lo_user); return buf; } @@ -2925,6 +2940,180 @@ dwarf_lang_string (unsigned int lang) } +static const char * +dwarf_inline_string (unsigned int code) +{ + static const char *known[] = + { + [DW_INL_not_inlined] = "not_inlined", + [DW_INL_inlined] = "inlined", + [DW_INL_declared_not_inlined] = "declared_not_inlined", + [DW_INL_declared_inlined] = "declared_inlined" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_encoding_string (unsigned int code) +{ + static const char *known[] = + { + [DW_ATE_void] = "void", + [DW_ATE_address] = "address", + [DW_ATE_boolean] = "boolean", + [DW_ATE_complex_float] = "complex_float", + [DW_ATE_float] = "float", + [DW_ATE_signed] = "signed", + [DW_ATE_signed_char] = "signed_char", + [DW_ATE_unsigned] = "unsigned", + [DW_ATE_unsigned_char] = "unsigned_char", + [DW_ATE_imaginary_float] = "imaginary_float" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + if (code >= DW_ATE_lo_user && code <= DW_ATE_hi_user) + { + static char buf[30]; + snprintf (buf, sizeof (buf), "lo_user+%u", code - DW_ATE_lo_user); + return buf; + } + + return "???"; +} + + +static const char * +dwarf_access_string (unsigned int code) +{ + static const char *known[] = + { + [DW_ACCESS_public] = "public", + [DW_ACCESS_protected] = "protected", + [DW_ACCESS_private] = "private" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_visibility_string (unsigned int code) +{ + static const char *known[] = + { + [DW_VIS_local] = "local", + [DW_VIS_exported] = "exported", + [DW_VIS_qualified] = "qualified" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_virtuality_string (unsigned int code) +{ + static const char *known[] = + { + [DW_VIRTUALITY_none] = "none", + [DW_VIRTUALITY_virtual] = "virtual", + [DW_VIRTUALITY_pure_virtual] = "pure_virtual" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_identifier_case_string (unsigned int code) +{ + static const char *known[] = + { + [DW_ID_case_sensitive] = "sensitive", + [DW_ID_up_case] = "up_case", + [DW_ID_down_case] = "down_case", + [DW_ID_case_insensitive] = "insensitive" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_calling_convention_string (unsigned int code) +{ + static const char *known[] = + { + [DW_CC_normal] = "normal", + [DW_CC_program] = "program", + [DW_CC_nocall] = "nocall", + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + if (code >= DW_CC_lo_user && code <= DW_CC_hi_user) + { + static char buf[30]; + snprintf (buf, sizeof (buf), "lo_user+%u", code - DW_CC_lo_user); + return buf; + } + + return "???"; +} + + +static const char * +dwarf_ordering_string (unsigned int code) +{ + static const char *known[] = + { + [DW_ORD_row_major] = "row_major", + [DW_ORD_col_major] = "col_major" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + +static const char * +dwarf_discr_list_string (unsigned int code) +{ + static const char *known[] = + { + [DW_DSC_label] = "label", + [DW_DSC_range] = "range" + }; + + if (code < sizeof (known) / sizeof (known[0])) + return known[code]; + + return "???"; +} + + static void print_ops (Dwarf *dbg, int level, unsigned int addrsize, Dwarf_Word len, unsigned char *data) @@ -3249,7 +3438,9 @@ print_ops (Dwarf *dbg, int level, unsigned int addrsize, Dwarf_Word len, static void -print_debug_abbrev_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +print_debug_abbrev_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), GElf_Shdr *shdr, Dwarf *dbg) { printf (gettext ("\nDWARF section '%s' at offset %#" PRIx64 ":\n" @@ -3262,10 +3453,12 @@ print_debug_abbrev_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, size_t length; Dwarf_Abbrev abbrev; - if (dwarf_offabbrev (dbg, offset, &length, &abbrev) != 0) + int res = dwarf_offabbrev (dbg, offset, &length, &abbrev); + if (res != 0) { - printf (gettext (" *** error while reading abbreviation: %s\n"), - dwarf_errmsg (-1)); + if (res < 0) + printf (gettext (" *** error while reading abbreviation: %s\n"), + dwarf_errmsg (-1)); break; } @@ -3306,7 +3499,9 @@ print_debug_abbrev_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, not have to know a bit about the structure of the section, libdwarf takes care of it. */ static void -print_debug_aranges_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +print_debug_aranges_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), GElf_Shdr *shdr, Dwarf *dbg) { Dwarf_Aranges *aranges; @@ -3360,8 +3555,11 @@ print_debug_aranges_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, static void -print_debug_frame_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr, Dwarf *dbg) +print_debug_frame_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), + GElf_Shdr *shdr __attribute__ ((unused)), + Dwarf *dbg __attribute__ ((unused))) { } @@ -3448,17 +3646,52 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) if (unlikely (dwarf_formudata (attrp, &num) != 0)) goto attrval_out; - if (attr == DW_AT_language) + const char *valuestr = NULL; + switch (attr) { - printf (" %*s%-20s %s (%d)\n", - (int) (level * 2), "", dwarf_attr_string (attr), - dwarf_lang_string (num), (int) num); + case DW_AT_language: + valuestr = dwarf_lang_string (num); + break; + case DW_AT_encoding: + valuestr = dwarf_encoding_string (num); + break; + case DW_AT_accessibility: + valuestr = dwarf_access_string (num); + break; + case DW_AT_visibility: + valuestr = dwarf_visibility_string (num); + break; + case DW_AT_virtuality: + valuestr = dwarf_virtuality_string (num); + break; + case DW_AT_identifier_case: + valuestr = dwarf_identifier_case_string (num); + break; + case DW_AT_calling_convention: + valuestr = dwarf_calling_convention_string (num); + break; + case DW_AT_inline: + valuestr = dwarf_inline_string (num); + break; + case DW_AT_ordering: + valuestr = dwarf_ordering_string (num); + break; + case DW_AT_discr_list: + valuestr = dwarf_discr_list_string (num); + break; + default: + /* Noting. */ break; } - printf (" %*s%-20s %" PRIuMAX "\n", - (int) (level * 2), "", dwarf_attr_string (attr), - (uintmax_t) num); + if (valuestr == NULL) + printf (" %*s%-20s %" PRIuMAX "\n", + (int) (level * 2), "", dwarf_attr_string (attr), + (uintmax_t) num); + else + printf (" %*s%-20s %s (%" PRIuMAX ")\n", + (int) (level * 2), "", dwarf_attr_string (attr), + valuestr, (uintmax_t) num); break; case DW_FORM_flag:; @@ -3500,7 +3733,9 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) static void -print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +print_debug_info_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), GElf_Shdr *shdr, Dwarf *dbg) { printf (gettext ("\ @@ -3511,7 +3746,7 @@ print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, if (shdr->sh_size == 0) return; - size_t maxdies = 20; + int maxdies = 20; Dwarf_Die *dies = (Dwarf_Die *) xmalloc (maxdies * sizeof (Dwarf_Die)); Dwarf_Off offset = 0; @@ -3554,7 +3789,7 @@ print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, do { offset = dwarf_dieoffset (&dies[level]); - if (offset == -1l) + if (offset == ~0ul) { error (0, 0, gettext ("cannot get DIE offset: %s"), dwarf_errmsg (-1)); @@ -3648,7 +3883,7 @@ print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, break; default: - if (tag < sizeof (lowtags) / sizeof (lowtags[0])) + if (tag < (int) (sizeof (lowtags) / sizeof (lowtags[0]))) tagstr = lowtags[tag]; else tagstr = "???"; @@ -3703,8 +3938,8 @@ print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, static void -print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr, Dwarf *dbg) +print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg) { printf (gettext ("\ \nDWARF section '%s' at offset %#" PRIx64 ":\n"), @@ -4114,8 +4349,11 @@ define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"), static void -print_debug_loc_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr, Dwarf *dbg) +print_debug_loc_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), + GElf_Shdr *shdr, + Dwarf *dbg __attribute__ ((unused))) { printf (gettext ("\ \nDWARF section '%s' at offset %#" PRIx64 ":\n"), @@ -4149,8 +4387,9 @@ mac_compare (const void *p1, const void *p2) static void -print_debug_macinfo_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, - GElf_Shdr *shdr, Dwarf *dbg) +print_debug_macinfo_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg) { printf (gettext ("\ \nDWARF section '%s' at offset %#" PRIx64 ":\n"), @@ -4265,7 +4504,7 @@ print_debug_macinfo_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, get_uleb128 (u128_2, readp); /* Find the CU DIE for this file. */ - ptrdiff_t macoff = readp - (const unsigned char *) data->d_buf; + size_t macoff = readp - (const unsigned char *) data->d_buf; const char *fname = "???"; if (macoff >= cus[0].offset) { @@ -4304,7 +4543,8 @@ print_debug_macinfo_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, /* Callback for printing global names. */ static int -print_pubnames (Dwarf *dbg, Dwarf_Global *global, void *arg) +print_pubnames (Dwarf *dbg __attribute__ ((unused)), Dwarf_Global *global, + void *arg) { int *np = (int *) arg; @@ -4318,7 +4558,9 @@ print_pubnames (Dwarf *dbg, Dwarf_Global *global, void *arg) /* Print the known exported symbols in the DWARF section '.debug_pubnames'. */ static void -print_debug_pubnames_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +print_debug_pubnames_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), GElf_Shdr *shdr, Dwarf *dbg) { printf (gettext ("\nDWARF section '%s' at offset %#" PRIx64 ":\n"), @@ -4330,7 +4572,9 @@ print_debug_pubnames_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, /* Print the content of the DWARF string section '.debug_str'. */ static void -print_debug_str_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, +print_debug_str_section (Ebl *ebl __attribute__ ((unused)), + GElf_Ehdr *ehdr __attribute__ ((unused)), + Elf_Scn *scn __attribute__ ((unused)), GElf_Shdr *shdr, Dwarf *dbg) { /* Compute floor(log16(shdr->sh_size)). */ diff --git a/elfutils/src/sectionhash.c b/elfutils/src/sectionhash.c index dc559409..4641c7cb 100644 --- a/elfutils/src/sectionhash.c +++ b/elfutils/src/sectionhash.c @@ -1,5 +1,5 @@ /* Section hash table implementation. - Copyright (C) 2001, 2002 Red Hat, Inc. + Copyright (C) 2001, 2002, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -34,7 +34,7 @@ scnhead_compare (struct scnhead *one, struct scnhead *two) if (result == 0) { - GElf_Xword diff = (SH_FLAGS_IMPORTANT (one->flags) + GElf_Sxword diff = (SH_FLAGS_IMPORTANT (one->flags) - SH_FLAGS_IMPORTANT (two->flags)); result = diff < 0 ? -1 : diff == 0 ? 0 : 1; diff --git a/elfutils/src/size.c b/elfutils/src/size.c index e9edb677..4dc7baf3 100644 --- a/elfutils/src/size.c +++ b/elfutils/src/size.c @@ -1,5 +1,5 @@ /* Print size information from ELF file. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -40,6 +40,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Values for the parameters which have no short form. */ #define OPT_FORMAT 0x100 @@ -48,20 +51,25 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { - { NULL, 0, NULL, 0, N_("Output format:") }, - { "format", OPT_FORMAT, "FORMAT", 0, N_("Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default is `bsd'") }, - { NULL, 'A', NULL, 0, N_("Same as `--format=sysv'") }, - { NULL, 'B', NULL, 0, N_("Same as `--format=bsd'") }, - { "radix", OPT_RADIX, "RADIX", 0, N_("Use RADIX for printing symbol values") }, - { NULL, 'd', NULL, 0, N_("Same as `--radix=10'") }, - { NULL, 'o', NULL, 0, N_("Same as `--radix=8'") }, - { NULL, 'x', NULL, 0, N_("Same as `--radix=16'") }, - { NULL, 'f', NULL, 0, N_("Similar to `--format=sysv' output but in one line") }, - - { NULL, 0, NULL, 0, N_("Output options:") }, - { NULL, 'F', NULL, 0, N_("Print size and permission flags for loadable segments") }, - { "totals", 't', NULL, 0, N_("Display the total sizes (bsd only)") }, - { NULL, 0, NULL, 0, NULL } + { NULL, 0, NULL, 0, N_("Output format:"), 0 }, + { "format", OPT_FORMAT, "FORMAT", 0, + N_("Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. " + "The default is `bsd'"), 0 }, + { NULL, 'A', NULL, 0, N_("Same as `--format=sysv'"), 0 }, + { NULL, 'B', NULL, 0, N_("Same as `--format=bsd'"), 0 }, + { "radix", OPT_RADIX, "RADIX", 0, N_("Use RADIX for printing symbol values"), + 0}, + { NULL, 'd', NULL, 0, N_("Same as `--radix=10'"), 0 }, + { NULL, 'o', NULL, 0, N_("Same as `--radix=8'"), 0 }, + { NULL, 'x', NULL, 0, N_("Same as `--radix=16'"), 0 }, + { NULL, 'f', NULL, 0, + N_("Similar to `--format=sysv' output but in one line"), 0 }, + + { NULL, 0, NULL, 0, N_("Output options:"), 0 }, + { NULL, 'F', NULL, 0, + N_("Print size and permission flags for loadable segments"), 0 }, + { "totals", 't', NULL, 0, N_("Display the total sizes (bsd only)"), 0 }, + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -74,13 +82,10 @@ static const char args_doc[] = N_("[FILE...]"); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc, NULL, more_help + options, parse_opt, args_doc, doc, NULL, NULL, NULL }; @@ -196,21 +201,22 @@ main (int argc, char *argv[]) /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "size (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } /* Handle program arguments. */ static error_t -parse_opt (int key, char *arg, struct argp_state *state) +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { switch (key) { @@ -273,27 +279,6 @@ parse_opt (int key, char *arg, struct argp_state *state) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - static int process_file (const char *fname) { @@ -305,7 +290,7 @@ process_file (const char *fname) fd = open (fname, O_RDONLY); if (fd == -1) { - error (0, errno, fname); + error (0, errno, gettext ("cannot open '%s"), fname); return 1; } @@ -321,7 +306,7 @@ process_file (const char *fname) INTERNAL_ERROR (fname); if (close (fd) != 0) - error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname); + error (EXIT_FAILURE, errno, gettext ("while close '%s'"), fname); return 0; } @@ -439,7 +424,8 @@ show_sysv (Elf *elf, const char *prefix, const char *fname, /* Ignore all sections which are not used at runtime. */ if ((shdr->sh_flags & SHF_ALLOC) != 0) maxlen = MAX (maxlen, - strlen (elf_strptr (elf, shstrndx, shdr->sh_name))); + (int) strlen (elf_strptr (elf, shstrndx, + shdr->sh_name))); } fputs_unlocked (fname, stdout); @@ -488,8 +474,7 @@ show_sysv (Elf *elf, const char *prefix, const char *fname, /* Show sizes in SysV format in one line. */ static void -show_sysv_one_line (Elf *elf, const char *prefix, const char *fname, - const char *fullname) +show_sysv_one_line (Elf *elf) { size_t shstrndx; Elf_Scn *scn = NULL; @@ -617,8 +602,7 @@ show_bsd_totals (void) /* Show size and permission of loadable segments. */ static void -show_segments (Elf *elf, const char *prefix, const char *fname, - const char *fullname) +show_segments (Elf *elf, const char *fullname) { GElf_Ehdr ehdr_mem; GElf_Ehdr *ehdr; @@ -686,9 +670,9 @@ handle_elf (Elf *elf, const char *prefix, const char *fname) if (format == format_sysv) show_sysv (elf, prefix, fname, fullname); else if (format == format_sysv_one_line) - show_sysv_one_line (elf, prefix, fname, fullname); + show_sysv_one_line (elf); else if (format == format_segments) - show_segments (elf, prefix, fname, fullname); + show_segments (elf, fullname); else { print_header (elf); diff --git a/elfutils/src/strip.c b/elfutils/src/strip.c index e5c4289c..0502d944 100644 --- a/elfutils/src/strip.c +++ b/elfutils/src/strip.c @@ -1,5 +1,5 @@ /* Discard section not used at runtime from object files. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2000. This program is Open Source software; you can redistribute it and/or @@ -45,6 +45,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Values for the parameters which have no short form. */ #define OPT_REMOVE_COMMENT 0x100 @@ -54,19 +57,20 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { - { NULL, 0, NULL, 0, N_("Output selection:") }, - { NULL, 'o', "FILE", 0, N_("Place stripped output into FILE") }, - { NULL, 'f', "FILE", 0, N_("Extract the removed sections into FILE") }, + { NULL, 0, NULL, 0, N_("Output selection:"), 0 }, + { NULL, 'o', "FILE", 0, N_("Place stripped output into FILE"), 0 }, + { NULL, 'f', "FILE", 0, N_("Extract the removed sections into FILE"), 0 }, + { NULL, 'F', "FILE", 0, N_("Embed name FILE instead of -f argument"), 0 }, - { NULL, 0, NULL, 0, N_("Output options:") }, - { "strip-debug", 'g', NULL, 0, N_("Remove all debugging symbols") }, + { NULL, 0, NULL, 0, N_("Output options:"), 0 }, + { "strip-debug", 'g', NULL, 0, N_("Remove all debugging symbols"), 0 }, { "preserve-dates", 'p', NULL, 0, - N_("Copy modified/access timestamps to the output") }, + N_("Copy modified/access timestamps to the output"), 0 }, { "remove-comment", OPT_REMOVE_COMMENT, NULL, 0, - N_("Remove .comment section") }, + N_("Remove .comment section"), 0 }, { "permissive", OPT_PERMISSIVE, NULL, 0, - N_("Relax a few rules to handle slightly broken ELF files") }, - { NULL, 0, NULL, 0, NULL } + N_("Relax a few rules to handle slightly broken ELF files"), 0 }, + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -78,13 +82,10 @@ static const char args_doc[] = N_("[FILE...]"); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc, NULL, more_help + options, parse_opt, args_doc, doc, NULL, NULL, NULL }; @@ -110,6 +111,9 @@ static const char *output_fname; /* Name of the debug output file. */ static const char *debug_fname; +/* Name to pretend the debug output file has. */ +static const char *debug_fname_embed; + /* If true output files shall have same date as the input file. */ static bool preserve_dates; @@ -147,7 +151,8 @@ main (int argc, char *argv[]) textdomain (PACKAGE); /* Parse and process arguments. */ - argp_parse (&argp, argc, argv, 0, &remaining, NULL); + if (argp_parse (&argp, argc, argv, 0, &remaining, NULL) != 0) + return EXIT_FAILURE; /* Tell the library which version we are expecting. */ elf_version (EV_CURRENT); @@ -157,7 +162,7 @@ main (int argc, char *argv[]) result = process_file ("a.out"); else { - /* If we have seen the `-o' or '-f' option there must be exactly one + /* If we have seen the '-o' or '-f' option there must be exactly one input file. */ if ((output_fname != NULL || debug_fname != NULL) && remaining + 1 < argc) @@ -176,29 +181,49 @@ Only one input file allowed together with '-o' and '-f'")); /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "strip (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } /* Handle program arguments. */ static error_t -parse_opt (int key, char *arg, struct argp_state *state) +parse_opt (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { switch (key) { case 'f': + if (debug_fname != NULL) + { + error (0, 0, gettext ("-f option specified twice")); + return EINVAL; + } debug_fname = arg; break; + case 'F': + if (debug_fname_embed != NULL) + { + error (0, 0, gettext ("-F option specified twice")); + return EINVAL; + } + debug_fname_embed = arg; + break; + case 'o': + if (output_fname != NULL) + { + error (0, 0, gettext ("-o option specified twice")); + return EINVAL; + } output_fname = arg; break; @@ -225,27 +250,6 @@ parse_opt (int key, char *arg, struct argp_state *state) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - static int process_file (const char *fname) { @@ -336,27 +340,6 @@ process_file (const char *fname) /* Maximum size of array allocated on stack. */ #define MAX_STACK_ALLOC (400 * 1024) - -static uint32_t -crc32_file (int fd, uint32_t *resp) -{ - unsigned char buffer[1024 * 8]; - uint32_t crc = 0; - ssize_t count; - - /* We have to rewind. */ - if (lseek (fd, 0, SEEK_SET) < 0) - return 1; - - while ((count = TEMP_FAILURE_RETRY (read (fd, buffer, sizeof (buffer)))) > 0) - crc = crc32 (crc, buffer, count); - - *resp = crc; - - return count != 0; -} - - static int handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, mode_t mode, struct timeval tvp[2]) @@ -398,7 +381,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, GElf_Ehdr debugehdr_mem; GElf_Ehdr *debugehdr; struct Ebl_Strtab *shst = NULL; - uint32_t debug_crc; + Elf_Data debuglink_crc_data; bool any_symtab_changes = false; Elf_Data *shstrtab_data = NULL; @@ -416,7 +399,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, fd = open (output_fname, O_RDWR | O_CREAT, mode); if (unlikely (fd == -1)) { - error (0, errno, gettext ("cannot open `%s'"), output_fname); + error (0, errno, gettext ("cannot open '%s'"), output_fname); return 1; } } @@ -451,7 +434,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, debug_fd = mkstemp (tmp_debug_fname); if (unlikely (debug_fd == -1)) { - error (0, errno, gettext ("cannot open `%s'"), debug_fname); + error (0, errno, gettext ("cannot open '%s'"), debug_fname); result = 1; goto fail; } @@ -479,7 +462,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, || (ehdr->e_type != ET_REL && unlikely (gelf_newphdr (newelf, ehdr->e_phnum) == 0))) { - error (0, 0, gettext ("cannot create new file `%s': %s"), + error (0, 0, gettext ("cannot create new file '%s': %s"), output_fname, elf_errmsg (-1)); goto fail; } @@ -505,7 +488,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, || (ehdr->e_type != ET_REL && unlikely (gelf_newphdr (debugelf, ehdr->e_phnum) == 0))) { - error (0, 0, gettext ("cannot create new file `%s': %s"), + error (0, 0, gettext ("cannot create new file '%s': %s"), debug_fname, elf_errmsg (-1)); goto fail_close; } @@ -566,7 +549,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, shdr_info[cnt].shdr.sh_name); if (shdr_info[cnt].name == NULL) { - error (0, 0, gettext ("illformed file `%s'"), fname); + error (0, 0, gettext ("illformed file '%s'"), fname); goto fail_close; } @@ -785,14 +768,14 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, /* Cross referencing happens: - for the cases the ELF specification says. That are - + SHT_DYNAMIC in sh_link to string table - + SHT_HASH in sh_link to symbol table - + SHT_REL and SHT_RELA in sh_link to symbol table - + SHT_SYMTAB and SHT_DYNSYM in sh_link to string table - + SHT_GROUP in sh_link to symbol table - + SHT_SYMTAB_SHNDX in sh_link to symbol table - Other (OS or architecture-specific) sections might as - well use this field so we process it unconditionally. + + SHT_DYNAMIC in sh_link to string table + + SHT_HASH in sh_link to symbol table + + SHT_REL and SHT_RELA in sh_link to symbol table + + SHT_SYMTAB and SHT_DYNSYM in sh_link to string table + + SHT_GROUP in sh_link to symbol table + + SHT_SYMTAB_SHNDX in sh_link to symbol table + Other (OS or architecture-specific) sections might as + well use this field so we process it unconditionally. - references inside section groups - specially marked references in sh_info if the SHF_INFO_LINK flag is set @@ -819,15 +802,15 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, } while (changes); - /* Write out a copy of all the sections to the debug output file. - The ones that are not removed in the stripped file are SHT_NOBITS */ + /* Copy the removed sections to the debug output file. + The ones that are not removed in the stripped file are SHT_NOBITS. */ if (debug_fname != NULL) { for (cnt = 1; cnt < shnum; ++cnt) { Elf_Data *debugdata; GElf_Shdr debugshdr; - int discard_section; + bool discard_section; scn = elf_newscn (debugelf); if (scn == NULL) @@ -859,7 +842,8 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (debugdata == NULL) INTERNAL_ERROR (fname); - /* Copy the structure. */ + /* Copy the structure. This data may be modified in place + before we write out the file. */ *debugdata = *shdr_info[cnt].data; if (discard_section) debugdata->d_buf = NULL; @@ -886,39 +870,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, result = 1; goto fail_close; } - - /* Finally write the file. */ - if (unlikely (elf_update (debugelf, ELF_C_WRITE)) == -1) - { - error (0, 0, gettext ("while writing `%s': %s"), - debug_fname, elf_errmsg (-1)); - result = 1; - goto fail_close; - } - - /* Create the real output file. First rename, then change the - mode. */ - if (rename (tmp_debug_fname, debug_fname) != 0 - || fchmod (debug_fd, mode) != 0) - { - error (0, errno, gettext ("while creating '%s'"), debug_fname); - result = 1; - goto fail_close; - } - - /* The temporary file does not exist anymore. */ - tmp_debug_fname = NULL; - - /* Compute the checksum which we will add to the executable. */ - if (crc32_file (debug_fd, &debug_crc) != 0) - { - error (0, errno, - gettext ("while computing checksum for debug information")); - unlink (debug_fname); - result = 1; - goto fail_close; - } - } /* Mark the section header string table as unused, we will create @@ -928,7 +879,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, /* We need a string table for the section headers. */ shst = ebl_strtabinit (true); if (shst == NULL) - error (EXIT_FAILURE, errno, gettext ("while preparing output for `%s'"), + error (EXIT_FAILURE, errno, gettext ("while preparing output for '%s'"), output_fname ?: fname); /* Assign new section numbers. */ @@ -991,7 +942,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, error (EXIT_FAILURE, 0, gettext ("cannot allocate section data: %s"), elf_errmsg (-1)); - debug_basename = basename (debug_fname); + debug_basename = basename (debug_fname_embed ?: debug_fname); crc_offset = strlen (debug_basename) + 1; /* Align to 4 byte boundary */ crc_offset = ((crc_offset - 1) & ~3) + 4; @@ -1002,14 +953,13 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, shdr_info[cnt].data->d_buf = xcalloc (1, shdr_info[cnt].data->d_size); strcpy (shdr_info[cnt].data->d_buf, debug_basename); - /* Store the crc value in the correct byteorder */ - if ((__BYTE_ORDER == __LITTLE_ENDIAN - && ehdr->e_ident[EI_DATA] == ELFDATA2MSB) - || (__BYTE_ORDER == __BIG_ENDIAN - && ehdr->e_ident[EI_DATA] == ELFDATA2LSB)) - debug_crc = bswap_32 (debug_crc); - memcpy ((char *)shdr_info[cnt].data->d_buf + crc_offset, - (char *) &debug_crc, 4); + + /* Cache this Elf_Data describing the CRC32 word in the section. + We'll fill this in when we have written the debug file. */ + debuglink_crc_data = *shdr_info[cnt].data; + debuglink_crc_data.d_buf = ((char *) debuglink_crc_data.d_buf + + crc_offset); + debuglink_crc_data.d_size = 4; /* One more section done. */ ++cnt; @@ -1287,8 +1237,10 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, symbol table. */ for (cnt = 1; cnt <= shdridx; ++cnt) { - if (shdr_info[cnt].idx == 0) - /* Ignore sections which are discarded. */ + if (shdr_info[cnt].idx == 0 && debug_fname == NULL) + /* Ignore sections which are discarded. When we are saving a + relocation section in a separate debug file, we must fix up + the symbol table references. */ continue; if (shdr_info[cnt].shdr.sh_type == SHT_REL @@ -1300,8 +1252,10 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, Elf32_Word *newsymidx = shdr_info[shdr_info[cnt].old_sh_link].newsymidx; - Elf_Data *d = elf_getdata (elf_getscn (newelf, - shdr_info[cnt].idx), + Elf_Data *d = elf_getdata (shdr_info[cnt].idx == 0 + ? elf_getscn (debugelf, cnt) + : elf_getscn (newelf, + shdr_info[cnt].idx), NULL); assert (d != NULL); size_t nrels = (shdr_info[cnt].shdr.sh_size @@ -1354,7 +1308,9 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (shdr_info[symtabidx].newsymidx == NULL) continue; - /* The symbol version section in the new file. */ + assert (shdr_info[cnt].idx > 0); + + /* The hash section in the new file. */ scn = elf_getscn (newelf, shdr_info[cnt].idx); /* The symbol table data. */ @@ -1376,12 +1332,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, size_t elsize = gelf_fsize (elf, ELF_T_SYM, 1, ehdr->e_version); - /* Convert to the correct byte order. */ - if (gelf_xlatetom (newelf, hashd, hashd, - BYTE_ORDER == LITTLE_ENDIAN - ? ELFDATA2LSB : ELFDATA2MSB) == NULL) - INTERNAL_ERROR (fname); - /* Adjust the nchain value. The symbol table size changed. We keep the same size for the bucket array. */ bucket[1] = symd->d_size / elsize; @@ -1439,12 +1389,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, size_t elsize = gelf_fsize (elf, ELF_T_SYM, 1, ehdr->e_version); - /* Convert to the correct byte order. */ - if (gelf_xlatetom (newelf, hashd, hashd, - BYTE_ORDER == LITTLE_ENDIAN - ? ELFDATA2LSB : ELFDATA2MSB) == NULL) - INTERNAL_ERROR (fname); - /* Adjust the nchain value. The symbol table size changed. We keep the same size for the bucket array. */ bucket[1] = symd->d_size / elsize; @@ -1490,12 +1434,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, } } } - - /* Convert back to the file byte order. */ - if (gelf_xlatetof (newelf, hashd, hashd, - BYTE_ORDER == LITTLE_ENDIAN - ? ELFDATA2LSB : ELFDATA2MSB) == NULL) - INTERNAL_ERROR (fname); } else if (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym) { @@ -1508,6 +1446,8 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (shdr_info[symtabidx].newsymidx == NULL) continue; + assert (shdr_info[cnt].idx > 0); + /* The symbol version section in the new file. */ scn = elf_getscn (newelf, shdr_info[cnt].idx); @@ -1521,12 +1461,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, Elf_Data *verd = elf_getdata (scn, NULL); assert (verd != NULL); - /* Convert to the correct byte order. */ - if (gelf_xlatetom (newelf, verd, verd, - BYTE_ORDER == LITTLE_ENDIAN - ? ELFDATA2LSB : ELFDATA2MSB) == NULL) - INTERNAL_ERROR (fname); - /* The symbol version array. */ GElf_Half *verstab = (GElf_Half *) verd->d_buf; @@ -1552,12 +1486,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, ehdr->e_version), ehdr->e_version); (void) gelf_update_shdr (scn, shdr); - - /* Convert back to the file byte order. */ - if (gelf_xlatetof (newelf, verd, verd, - BYTE_ORDER == LITTLE_ENDIAN - ? ELFDATA2LSB : ELFDATA2MSB) == NULL) - INTERNAL_ERROR (fname); } else if (shdr_info[cnt].shdr.sh_type == SHT_GROUP) { @@ -1580,6 +1508,58 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, } } + /* Now that we have done all adjustments to the data, + we can actually write out the debug file. */ + if (debug_fname != NULL) + { + uint32_t debug_crc; + Elf_Data debug_crc_data = + { + .d_type = ELF_T_WORD, + .d_buf = &debug_crc, + .d_size = sizeof (debug_crc), + .d_version = EV_CURRENT + }; + + /* Finally write the file. */ + if (unlikely (elf_update (debugelf, ELF_C_WRITE)) == -1) + { + error (0, 0, gettext ("while writing '%s': %s"), + debug_fname, elf_errmsg (-1)); + result = 1; + goto fail_close; + } + + /* Create the real output file. First rename, then change the + mode. */ + if (rename (tmp_debug_fname, debug_fname) != 0 + || fchmod (debug_fd, mode) != 0) + { + error (0, errno, gettext ("while creating '%s'"), debug_fname); + result = 1; + goto fail_close; + } + + /* The temporary file does not exist anymore. */ + tmp_debug_fname = NULL; + + /* Compute the checksum which we will add to the executable. */ + if (crc32_file (debug_fd, &debug_crc) != 0) + { + error (0, errno, + gettext ("while computing checksum for debug information")); + unlink (debug_fname); + result = 1; + goto fail_close; + } + + /* Store it in the debuglink section data. */ + if (unlikely (gelf_xlatetof (newelf, &debuglink_crc_data, + &debug_crc_data, ehdr->e_ident[EI_DATA]) + != &debuglink_crc_data)) + INTERNAL_ERROR (fname); + } + /* Finally finish the ELF header. Fill in the fields not handled by libelf from the old file. */ newehdr = gelf_getehdr (newelf, &newehdr_mem); @@ -1641,7 +1621,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, /* Finally write the file. */ if (elf_update (newelf, ELF_C_WRITE) == -1) { - error (0, 0, gettext ("while writing `%s': %s"), + error (0, 0, gettext ("while writing '%s': %s"), fname, elf_errmsg (-1)); result = 1; } @@ -1669,14 +1649,14 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, /* That was it. Close the descriptors. */ if (elf_end (newelf) != 0) { - error (0, 0, gettext ("error while finishing `%s': %s"), fname, + error (0, 0, gettext ("error while finishing '%s': %s"), fname, elf_errmsg (-1)); result = 1; } if (debugelf != NULL && elf_end (debugelf) != 0) { - error (0, 0, gettext ("error while finishing `%s': %s"), debug_fname, + error (0, 0, gettext ("error while finishing '%s': %s"), debug_fname, elf_errmsg (-1)); result = 1; } @@ -1700,7 +1680,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (futimes (fd, tvp) != 0) { error (0, errno, gettext ("\ -cannot set access and modification date of \"%s\""), +cannot set access and modification date of '%s'"), output_fname ?: fname); result = 1; } @@ -1757,13 +1737,13 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname, if (unlikely (futimes (fd, tvp) != 0)) { error (0, errno, gettext ("\ -cannot set access and modification date of \"%s\""), fname); +cannot set access and modification date of '%s'"), fname); result = 1; } } if (unlikely (close (fd) != 0)) - error (EXIT_FAILURE, errno, gettext ("while closing `%s'"), fname); + error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname); return result; } diff --git a/elfutils/tests/ChangeLog b/elfutils/tests/ChangeLog index 05e36331..b1918d8f 100644 --- a/elfutils/tests/ChangeLog +++ b/elfutils/tests/ChangeLog @@ -1,3 +1,62 @@ +2005-05-08 Ulrich Drepper <drepper@redhat.com> + + * run-line2addr.sh: Remove testfile14 at the end. + + * run-strip-test.sh: Remove deubinfo test input file as well. + + * Makefile.am (EXTRA_DIST): Newly added files incorrectly used + .bz, not .bz2. + +2005-05-03 Roland McGrath <roland@redhat.com> + + * run-strip-test.sh: Use variables for test file names. + Optionally produce separate debug file and check it. + * run-strip-test2.sh: Use run-strip-test.sh via ., no duplication. + * run-strip-test3.sh: Likewise. + * run-strip-test4.sh: New file. + * run-strip-test5.sh: New file. + * run-strip-test6.sh: New file. + * testfile15.bz: New file. + * testfile15.debug.bz: New file. + * testfile16.bz: New file. + * testfile16.debug.bz: New file. + * testfile17.bz: New file. + * testfile17.debug.bz: New file. + * Makefile.am (TESTS, EXTRA_DIST): Add them. + +2005-04-25 Ulrich Drepper <drepper@redhat.com> + + * run-line2addr.sh: Also use testfile14. Adjust for correct + return of multiple matches. + * testfile14.bz2: New file. + * Makefile.am (EXTRA_DIST): Add testfile14.bz2. + + * show-abbrev.c (main): Adjust for dwarf_getabbrev interface change. + +2005-04-04 Roland McGrath <roland@frob.com> + + * line2addr.c (main): Initialize LINES and NLINES before calling + dwarf_getsrc_file, and free LINES afterwards. + + * allfcts.c (main): Use size_t for CUHL. + +2005-04-04 Ulrich Drepper <drepper@redhat.com> + + * line2addr.c: New file. + * run-line2addr.sh: New file. + * Makefile.am: Add rules to build, run, and distribute new code. + +2005-04-02 Ulrich Drepper <drepper@redhat.com> + + * allfcts.c: New file. + * run-allfcts.sh: New file. + * Makefile.am: Add rules to build, run, and distribute new code. + +2005-02-05 Ulrich Drepper <drepper@redhat.com> + + * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all test + programs with -lmudflap. + 2004-09-25 Ulrich Drepper <drepper@redhat.com> * asm-tst4.c (main): Add LD_LIBRARY_PATH to elflint invocation. diff --git a/elfutils/tests/Makefile.am b/elfutils/tests/Makefile.am index 1e4f9a8d..769a2314 100644 --- a/elfutils/tests/Makefile.am +++ b/elfutils/tests/Makefile.am @@ -1,7 +1,6 @@ ## Process this file with automake to create Makefile.in -## Configure input file for elfutils. ## -## Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc. +## Copyright (C) 1996-2002, 2003, 2004, 2005 Red Hat, Inc. ## ## This program is Open Source software; you can redistribute it and/or ## modify it under the terms of the Open Software License version 1.0 as @@ -14,8 +13,12 @@ ## 3001 King Ranch Road, Ukiah, CA 95482. ## DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE -AM_CFLAGS = -Wall -Werror -std=gnu99 -if !MUDFLAP +if MUDFLAP +AM_CFLAGS = -Wall -Werror -std=gnu99 -fmudflap\ + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) +else +AM_CFLAGS = -Wall -Werror -std=gnu99 \ + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) AM_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf endif INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \ @@ -25,7 +28,7 @@ INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ showptable update1 update2 update3 update4 test-nlist \ show-die-info get-files get-lines get-pubnames \ - get-aranges \ + get-aranges allfcts line2addr \ show-abbrev hash asm-tst1 asm-tst2 asm-tst3 \ asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \ msg_tst newscn ecp @@ -34,11 +37,12 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ update1 update2 update3 update4 \ run-show-die-info.sh run-get-files.sh run-get-lines.sh \ - run-get-pubnames.sh run-get-aranges.sh \ - run-show-abbrev.sh hash asm-tst1 asm-tst2 \ + run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \ + run-show-abbrev.sh run-line2addr.sh hash asm-tst1 asm-tst2 \ asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \ msg_tst newscn run-strip-test.sh run-strip-test2.sh \ - run-strip-test3.sh run-ecp-test.sh run-ecp-test2.sh + run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \ + run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh # run-show-ciefde.sh EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ @@ -49,12 +53,18 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \ testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \ testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \ - testfile13.bz2 run-strip-test3.sh + testfile13.bz2 run-strip-test3.sh run-allfcts.sh \ + run-line2addr.sh testfile14.bz2 \ + run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \ + testfile15.bz2 testfile15.debug.bz2 \ + testfile16.bz2 testfile16.debug.bz2 \ + testfile17.bz2 testfile17.debug.bz2 if MUDFLAP libdw = ../libdw/libdw.a libelf = ../libelf/libelf.a libasm = ../libasm/libasm.a +libmudflap = -lmudflap else libdw = ../libdw/libdw.so libelf = ../libelf/libelf.so @@ -62,37 +72,40 @@ libasm = ../libasm/libasm.so endif libebl = ../libebl/libebl.a -arextract_LDADD = $(libelf) -arsymtest_LDADD = $(libelf) -newfile_LDADD = $(libelf) -saridx_LDADD = $(libelf) -scnnames_LDADD = $(libelf) -sectiondump_LDADD = $(libelf) -showptable_LDADD = $(libelf) -hash_LDADD = $(libelf) -test_nlist_LDADD = $(libelf) -msg_tst_LDADD = $(libelf) -newscn_LDADD = $(libelf) -ecp_LDADD = $(libelf) -update1_LDADD = $(libelf) -update2_LDADD = $(libelf) -update3_LDADD = $(libebl) $(libelf) -update4_LDADD = $(libebl) $(libelf) -show_die_info_LDADD = $(libdw) $(libelf) -get_pubnames_LDADD = $(libdw) $(libelf) -show_abbrev_LDADD = $(libdw) $(libelf) -get_lines_LDADD = $(libdw) $(libelf) -get_files_LDADD = $(libdw) $(libelf) -get_aranges_LDADD = $(libdw) $(libelf) -#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) -asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) +arextract_LDADD = $(libelf) $(libmudflap) +arsymtest_LDADD = $(libelf) $(libmudflap) +newfile_LDADD = $(libelf) $(libmudflap) +saridx_LDADD = $(libelf) $(libmudflap) +scnnames_LDADD = $(libelf) $(libmudflap) +sectiondump_LDADD = $(libelf) $(libmudflap) +showptable_LDADD = $(libelf) $(libmudflap) +hash_LDADD = $(libelf) $(libmudflap) +test_nlist_LDADD = $(libelf) $(libmudflap) +msg_tst_LDADD = $(libelf) $(libmudflap) +newscn_LDADD = $(libelf) $(libmudflap) +ecp_LDADD = $(libelf) $(libmudflap) +update1_LDADD = $(libelf) $(libmudflap) +update2_LDADD = $(libelf) $(libmudflap) +update3_LDADD = $(libebl) $(libelf) $(libmudflap) +update4_LDADD = $(libebl) $(libelf) $(libmudflap) +show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap) +get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap) +show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap) +get_lines_LDADD = $(libdw) $(libelf) $(libmudflap) +get_files_LDADD = $(libdw) $(libelf) $(libmudflap) +get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap) +allfcts_LDADD = $(libdw) $(libelf) $(libmudflap) +line2addr_no_Wformat = yes +line2addr_LDADD = $(libdw) $(libelf) $(libmudflap) +#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap) +asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) CLEANFILES = xxx diff --git a/elfutils/tests/Makefile.in b/elfutils/tests/Makefile.in index c5dd6529..7c661ec1 100644 --- a/elfutils/tests/Makefile.in +++ b/elfutils/tests/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.2 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c get-pubnames.c hash.c msg_tst.c newfile.c newscn.c saridx.c scnnames.c sectiondump.c show-abbrev.c show-die-info.c showptable.c test-nlist.c update1.c update2.c update3.c update4.c +SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c newfile.c newscn.c saridx.c scnnames.c sectiondump.c show-abbrev.c show-die-info.c showptable.c test-nlist.c update1.c update2.c update3.c update4.c srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -44,17 +44,16 @@ noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \ update2$(EXEEXT) update3$(EXEEXT) update4$(EXEEXT) \ test-nlist$(EXEEXT) show-die-info$(EXEEXT) get-files$(EXEEXT) \ get-lines$(EXEEXT) get-pubnames$(EXEEXT) get-aranges$(EXEEXT) \ - show-abbrev$(EXEEXT) hash$(EXEEXT) asm-tst1$(EXEEXT) \ - asm-tst2$(EXEEXT) asm-tst3$(EXEEXT) asm-tst4$(EXEEXT) \ - asm-tst5$(EXEEXT) asm-tst6$(EXEEXT) asm-tst7$(EXEEXT) \ - asm-tst8$(EXEEXT) asm-tst9$(EXEEXT) msg_tst$(EXEEXT) \ - newscn$(EXEEXT) ecp$(EXEEXT) + allfcts$(EXEEXT) line2addr$(EXEEXT) show-abbrev$(EXEEXT) \ + hash$(EXEEXT) asm-tst1$(EXEEXT) asm-tst2$(EXEEXT) \ + asm-tst3$(EXEEXT) asm-tst4$(EXEEXT) asm-tst5$(EXEEXT) \ + asm-tst6$(EXEEXT) asm-tst7$(EXEEXT) asm-tst8$(EXEEXT) \ + asm-tst9$(EXEEXT) msg_tst$(EXEEXT) newscn$(EXEEXT) \ + ecp$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -62,117 +61,132 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) +allfcts_SOURCES = allfcts.c +allfcts_OBJECTS = allfcts.$(OBJEXT) +@MUDFLAP_FALSE@am__DEPENDENCIES_1 = ../libdw/libdw.so +@MUDFLAP_TRUE@am__DEPENDENCIES_1 = ../libdw/libdw.a +@MUDFLAP_FALSE@am__DEPENDENCIES_2 = ../libelf/libelf.so +@MUDFLAP_TRUE@am__DEPENDENCIES_2 = ../libelf/libelf.a +am__DEPENDENCIES_3 = +allfcts_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) arextract_SOURCES = arextract.c arextract_OBJECTS = arextract.$(OBJEXT) -@MUDFLAP_FALSE@am__DEPENDENCIES_1 = ../libelf/libelf.so -@MUDFLAP_TRUE@am__DEPENDENCIES_1 = ../libelf/libelf.a -arextract_DEPENDENCIES = $(am__DEPENDENCIES_1) +arextract_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) arsymtest_SOURCES = arsymtest.c arsymtest_OBJECTS = arsymtest.$(OBJEXT) -arsymtest_DEPENDENCIES = $(am__DEPENDENCIES_1) +arsymtest_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst1_SOURCES = asm-tst1.c asm_tst1_OBJECTS = asm-tst1.$(OBJEXT) -@MUDFLAP_FALSE@am__DEPENDENCIES_2 = ../libasm/libasm.so -@MUDFLAP_TRUE@am__DEPENDENCIES_2 = ../libasm/libasm.a -am__DEPENDENCIES_3 = ../libebl/libebl.a -asm_tst1_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +@MUDFLAP_FALSE@am__DEPENDENCIES_4 = ../libasm/libasm.so +@MUDFLAP_TRUE@am__DEPENDENCIES_4 = ../libasm/libasm.a +am__DEPENDENCIES_5 = ../libebl/libebl.a +asm_tst1_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst2_SOURCES = asm-tst2.c asm_tst2_OBJECTS = asm-tst2.$(OBJEXT) -asm_tst2_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst2_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst3_SOURCES = asm-tst3.c asm_tst3_OBJECTS = asm-tst3.$(OBJEXT) -asm_tst3_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst3_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst4_SOURCES = asm-tst4.c asm_tst4_OBJECTS = asm-tst4.$(OBJEXT) -asm_tst4_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst4_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst5_SOURCES = asm-tst5.c asm_tst5_OBJECTS = asm-tst5.$(OBJEXT) -asm_tst5_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst5_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst6_SOURCES = asm-tst6.c asm_tst6_OBJECTS = asm-tst6.$(OBJEXT) -asm_tst6_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst6_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst7_SOURCES = asm-tst7.c asm_tst7_OBJECTS = asm-tst7.$(OBJEXT) -asm_tst7_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst7_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst8_SOURCES = asm-tst8.c asm_tst8_OBJECTS = asm-tst8.$(OBJEXT) -asm_tst8_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst8_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) asm_tst9_SOURCES = asm-tst9.c asm_tst9_OBJECTS = asm-tst9.$(OBJEXT) -asm_tst9_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_1) +asm_tst9_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) ecp_SOURCES = ecp.c ecp_OBJECTS = ecp.$(OBJEXT) -ecp_DEPENDENCIES = $(am__DEPENDENCIES_1) +ecp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) get_aranges_SOURCES = get-aranges.c get_aranges_OBJECTS = get-aranges.$(OBJEXT) -@MUDFLAP_FALSE@am__DEPENDENCIES_4 = ../libdw/libdw.so -@MUDFLAP_TRUE@am__DEPENDENCIES_4 = ../libdw/libdw.a -get_aranges_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) +get_aranges_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) get_files_SOURCES = get-files.c get_files_OBJECTS = get-files.$(OBJEXT) -get_files_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) +get_files_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) get_lines_SOURCES = get-lines.c get_lines_OBJECTS = get-lines.$(OBJEXT) -get_lines_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) +get_lines_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) get_pubnames_SOURCES = get-pubnames.c get_pubnames_OBJECTS = get-pubnames.$(OBJEXT) -get_pubnames_DEPENDENCIES = $(am__DEPENDENCIES_4) \ - $(am__DEPENDENCIES_1) +get_pubnames_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) hash_SOURCES = hash.c hash_OBJECTS = hash.$(OBJEXT) -hash_DEPENDENCIES = $(am__DEPENDENCIES_1) +hash_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +line2addr_SOURCES = line2addr.c +line2addr_OBJECTS = line2addr.$(OBJEXT) +line2addr_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) msg_tst_SOURCES = msg_tst.c msg_tst_OBJECTS = msg_tst.$(OBJEXT) -msg_tst_DEPENDENCIES = $(am__DEPENDENCIES_1) +msg_tst_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) newfile_SOURCES = newfile.c newfile_OBJECTS = newfile.$(OBJEXT) -newfile_DEPENDENCIES = $(am__DEPENDENCIES_1) +newfile_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) newscn_SOURCES = newscn.c newscn_OBJECTS = newscn.$(OBJEXT) -newscn_DEPENDENCIES = $(am__DEPENDENCIES_1) +newscn_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) saridx_SOURCES = saridx.c saridx_OBJECTS = saridx.$(OBJEXT) -saridx_DEPENDENCIES = $(am__DEPENDENCIES_1) +saridx_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) scnnames_SOURCES = scnnames.c scnnames_OBJECTS = scnnames.$(OBJEXT) -scnnames_DEPENDENCIES = $(am__DEPENDENCIES_1) +scnnames_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) sectiondump_SOURCES = sectiondump.c sectiondump_OBJECTS = sectiondump.$(OBJEXT) -sectiondump_DEPENDENCIES = $(am__DEPENDENCIES_1) +sectiondump_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) show_abbrev_SOURCES = show-abbrev.c show_abbrev_OBJECTS = show-abbrev.$(OBJEXT) -show_abbrev_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) +show_abbrev_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) show_die_info_SOURCES = show-die-info.c show_die_info_OBJECTS = show-die-info.$(OBJEXT) -show_die_info_DEPENDENCIES = $(am__DEPENDENCIES_4) \ - $(am__DEPENDENCIES_1) +show_die_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) showptable_SOURCES = showptable.c showptable_OBJECTS = showptable.$(OBJEXT) -showptable_DEPENDENCIES = $(am__DEPENDENCIES_1) +showptable_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) test_nlist_SOURCES = test-nlist.c test_nlist_OBJECTS = test-nlist.$(OBJEXT) -test_nlist_DEPENDENCIES = $(am__DEPENDENCIES_1) +test_nlist_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) update1_SOURCES = update1.c update1_OBJECTS = update1.$(OBJEXT) -update1_DEPENDENCIES = $(am__DEPENDENCIES_1) +update1_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) update2_SOURCES = update2.c update2_OBJECTS = update2.$(OBJEXT) -update2_DEPENDENCIES = $(am__DEPENDENCIES_1) +update2_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) update3_SOURCES = update3.c update3_OBJECTS = update3.$(OBJEXT) -update3_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) +update3_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) update4_SOURCES = update4.c update4_OBJECTS = update4.$(OBJEXT) -update4_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) +update4_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -180,20 +194,20 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c \ - asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c asm-tst8.c \ - asm-tst9.c ecp.c get-aranges.c get-files.c get-lines.c \ - get-pubnames.c hash.c msg_tst.c newfile.c newscn.c saridx.c \ - scnnames.c sectiondump.c show-abbrev.c show-die-info.c \ - showptable.c test-nlist.c update1.c update2.c update3.c \ - update4.c -DIST_SOURCES = arextract.c arsymtest.c asm-tst1.c asm-tst2.c \ +SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c \ asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c \ asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c \ - get-lines.c get-pubnames.c hash.c msg_tst.c newfile.c newscn.c \ - saridx.c scnnames.c sectiondump.c show-abbrev.c \ - show-die-info.c showptable.c test-nlist.c update1.c update2.c \ - update3.c update4.c + get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \ + newfile.c newscn.c saridx.c scnnames.c sectiondump.c \ + show-abbrev.c show-die-info.c showptable.c test-nlist.c \ + update1.c update2.c update3.c update4.c +DIST_SOURCES = allfcts.c arextract.c arsymtest.c asm-tst1.c asm-tst2.c \ + asm-tst3.c asm-tst4.c asm-tst5.c asm-tst6.c asm-tst7.c \ + asm-tst8.c asm-tst9.c ecp.c get-aranges.c get-files.c \ + get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \ + newfile.c newscn.c saridx.c scnnames.c sectiondump.c \ + show-abbrev.c show-die-info.c showptable.c test-nlist.c \ + update1.c update2.c update3.c update4.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -208,7 +222,6 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ @@ -217,25 +230,19 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOCALEDIR = @LOCALEDIR@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -253,7 +260,6 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -301,7 +307,12 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -AM_CFLAGS = -Wall -Werror -std=gnu99 +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -std=gnu99 \ +@MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) + +@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -std=gnu99 -fmudflap\ +@MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) + @MUDFLAP_FALSE@AM_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \ -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \ @@ -311,11 +322,12 @@ INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ update1 update2 update3 update4 \ run-show-die-info.sh run-get-files.sh run-get-lines.sh \ - run-get-pubnames.sh run-get-aranges.sh \ - run-show-abbrev.sh hash asm-tst1 asm-tst2 \ + run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \ + run-show-abbrev.sh run-line2addr.sh hash asm-tst1 asm-tst2 \ asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \ msg_tst newscn run-strip-test.sh run-strip-test2.sh \ - run-strip-test3.sh run-ecp-test.sh run-ecp-test2.sh + run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \ + run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh # run-show-ciefde.sh EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ @@ -326,7 +338,12 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \ testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \ testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \ - testfile13.bz2 run-strip-test3.sh + testfile13.bz2 run-strip-test3.sh run-allfcts.sh \ + run-line2addr.sh testfile14.bz2 \ + run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \ + testfile15.bz2 testfile15.debug.bz2 \ + testfile16.bz2 testfile16.debug.bz2 \ + testfile17.bz2 testfile17.debug.bz2 @MUDFLAP_FALSE@libdw = ../libdw/libdw.so @MUDFLAP_TRUE@libdw = ../libdw/libdw.a @@ -334,39 +351,43 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ @MUDFLAP_TRUE@libelf = ../libelf/libelf.a @MUDFLAP_FALSE@libasm = ../libasm/libasm.so @MUDFLAP_TRUE@libasm = ../libasm/libasm.a +@MUDFLAP_TRUE@libmudflap = -lmudflap libebl = ../libebl/libebl.a -arextract_LDADD = $(libelf) -arsymtest_LDADD = $(libelf) -newfile_LDADD = $(libelf) -saridx_LDADD = $(libelf) -scnnames_LDADD = $(libelf) -sectiondump_LDADD = $(libelf) -showptable_LDADD = $(libelf) -hash_LDADD = $(libelf) -test_nlist_LDADD = $(libelf) -msg_tst_LDADD = $(libelf) -newscn_LDADD = $(libelf) -ecp_LDADD = $(libelf) -update1_LDADD = $(libelf) -update2_LDADD = $(libelf) -update3_LDADD = $(libebl) $(libelf) -update4_LDADD = $(libebl) $(libelf) -show_die_info_LDADD = $(libdw) $(libelf) -get_pubnames_LDADD = $(libdw) $(libelf) -show_abbrev_LDADD = $(libdw) $(libelf) -get_lines_LDADD = $(libdw) $(libelf) -get_files_LDADD = $(libdw) $(libelf) -get_aranges_LDADD = $(libdw) $(libelf) -#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) -asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) -asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) +arextract_LDADD = $(libelf) $(libmudflap) +arsymtest_LDADD = $(libelf) $(libmudflap) +newfile_LDADD = $(libelf) $(libmudflap) +saridx_LDADD = $(libelf) $(libmudflap) +scnnames_LDADD = $(libelf) $(libmudflap) +sectiondump_LDADD = $(libelf) $(libmudflap) +showptable_LDADD = $(libelf) $(libmudflap) +hash_LDADD = $(libelf) $(libmudflap) +test_nlist_LDADD = $(libelf) $(libmudflap) +msg_tst_LDADD = $(libelf) $(libmudflap) +newscn_LDADD = $(libelf) $(libmudflap) +ecp_LDADD = $(libelf) $(libmudflap) +update1_LDADD = $(libelf) $(libmudflap) +update2_LDADD = $(libelf) $(libmudflap) +update3_LDADD = $(libebl) $(libelf) $(libmudflap) +update4_LDADD = $(libebl) $(libelf) $(libmudflap) +show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap) +get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap) +show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap) +get_lines_LDADD = $(libdw) $(libelf) $(libmudflap) +get_files_LDADD = $(libdw) $(libelf) $(libmudflap) +get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap) +allfcts_LDADD = $(libdw) $(libelf) $(libmudflap) +line2addr_no_Wformat = yes +line2addr_LDADD = $(libdw) $(libelf) $(libmudflap) +#show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap) +asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) +asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) CLEANFILES = xxx all: all-am @@ -404,6 +425,9 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +allfcts$(EXEEXT): $(allfcts_OBJECTS) $(allfcts_DEPENDENCIES) + @rm -f allfcts$(EXEEXT) + $(LINK) $(allfcts_LDFLAGS) $(allfcts_OBJECTS) $(allfcts_LDADD) $(LIBS) arextract$(EXEEXT): $(arextract_OBJECTS) $(arextract_DEPENDENCIES) @rm -f arextract$(EXEEXT) $(LINK) $(arextract_LDFLAGS) $(arextract_OBJECTS) $(arextract_LDADD) $(LIBS) @@ -455,6 +479,9 @@ get-pubnames$(EXEEXT): $(get_pubnames_OBJECTS) $(get_pubnames_DEPENDENCIES) hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES) @rm -f hash$(EXEEXT) $(LINK) $(hash_LDFLAGS) $(hash_OBJECTS) $(hash_LDADD) $(LIBS) +line2addr$(EXEEXT): $(line2addr_OBJECTS) $(line2addr_DEPENDENCIES) + @rm -f line2addr$(EXEEXT) + $(LINK) $(line2addr_LDFLAGS) $(line2addr_OBJECTS) $(line2addr_LDADD) $(LIBS) msg_tst$(EXEEXT): $(msg_tst_OBJECTS) $(msg_tst_DEPENDENCIES) @rm -f msg_tst$(EXEEXT) $(LINK) $(msg_tst_LDFLAGS) $(msg_tst_OBJECTS) $(msg_tst_LDADD) $(LIBS) @@ -504,6 +531,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allfcts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arextract.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arsymtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm-tst1.Po@am__quote@ @@ -521,6 +549,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-lines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-pubnames.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line2addr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_tst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newscn.Po@am__quote@ diff --git a/elfutils/tests/allfcts.c b/elfutils/tests/allfcts.c new file mode 100644 index 00000000..147ebc2c --- /dev/null +++ b/elfutils/tests/allfcts.c @@ -0,0 +1,50 @@ +#include <fcntl.h> +#include <libdw.h> +#include <stdio.h> +#include <unistd.h> + + +static int +cb (Dwarf_Func *func, void *arg __attribute__ ((unused))) +{ + const char *file = dwarf_func_file (func); + int line = -1; + dwarf_func_line (func, &line); + const char *fct = dwarf_func_name (func); + + printf ("%s:%d:%s\n", file, line, fct); + + return DWARF_CB_OK; +} + + +int +main (int argc, char *argv[]) +{ + for (int i = 1; i < argc; ++i) + { + int fd = open (argv[i], O_RDONLY); + + Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ); + if (dbg != NULL) + { + Dwarf_Off off = 0; + size_t cuhl; + Dwarf_Off noff; + + while (dwarf_nextcu (dbg, off, &noff, &cuhl, NULL, NULL, NULL) == 0) + { + Dwarf_Die die_mem; + Dwarf_Die *die = dwarf_offdie (dbg, off + cuhl, &die_mem); + + (void) dwarf_getfuncs (die, cb, NULL, 0); + + off = noff; + } + + dwarf_end (dbg); + } + + close (fd); + } +} diff --git a/elfutils/tests/line2addr.c b/elfutils/tests/line2addr.c new file mode 100644 index 00000000..d2017fba --- /dev/null +++ b/elfutils/tests/line2addr.c @@ -0,0 +1,65 @@ +#include <fcntl.h> +#include <inttypes.h> +#include <libdw.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + + +int +main (int argc, char *argv[]) +{ + for (int cnt = 1; cnt < argc; ++cnt) + { + char *fname; + char *file; + int line; + + switch (sscanf (argv[cnt], "%a[^:]:%a[^:]:%d", + &fname, &file, &line)) + { + default: + case 0: + case 1: + printf ("ignored %s\n", argv[cnt]); + continue; + case 2: + line = 0; + break; + case 3: + break; + } + + int fd = open (fname, O_RDONLY); + if (fd == -1) + continue; + + Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ); + if (dbg != NULL) + { + Dwarf_Line **lines = NULL; + size_t nlines = 0; + + if (dwarf_getsrc_file (dbg, file, line, 0, &lines, &nlines) == 0) + { + for (size_t inner = 0; inner < nlines; ++inner) + { + Dwarf_Addr addr; + if (dwarf_lineaddr (lines[inner], &addr) == 0) + printf ("%s -> %#" PRIxMAX "\n", + argv[cnt], (uintmax_t) addr); + } + + free (lines); + } + + dwarf_end (dbg); + } + + close (fd); + free (fname); + free (file); + } + + return 0; +} diff --git a/elfutils/tests/run-allfcts.sh b/elfutils/tests/run-allfcts.sh new file mode 100755 index 00000000..51fe75ce --- /dev/null +++ b/elfutils/tests/run-allfcts.sh @@ -0,0 +1,46 @@ +#! /bin/sh +# Copyright (C) 2005 Red Hat, Inc. +# Written by Ulrich Drepper <drepper@redhat.com>, 2005. +# +# This program is Open Source software; you can redistribute it and/or +# modify it under the terms of the Open Software License version 1.0 as +# published by the Open Source Initiative. +# +# You should have received a copy of the Open Software License along +# with this program; if not, you may obtain a copy of the Open Software +# License version 1.0 from http://www.opensource.org/licenses/osl.php or +# by writing the Open Source Initiative c/o Lawrence Rosen, Esq., +# 3001 King Ranch Road, Ukiah, CA 95482. +set -e + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0 + +./allfcts testfile testfile2 testfile8 > allfcts.out + +diff -u allfcts.out - <<"EOF" +/home/drepper/gnu/new-bu/build/ttt/m.c:5:main +/home/drepper/gnu/new-bu/build/ttt/b.c:4:bar +/home/drepper/gnu/new-bu/build/ttt/f.c:3:foo +/shoggoth/drepper/b.c:4:bar +/shoggoth/drepper/f.c:3:foo +/shoggoth/drepper/m.c:5:main +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:107:main +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:159:print_version +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:173:parse_opt +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:201:more_help +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:217:process_file +/usr/include/sys/stat.h:375:stat64 +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:291:crc32_file +/home/drepper/gnu/elfutils/build/src/../../src/strip.c:313:handle_elf +EOF + +rm -f testfile testfile2 testfile8 allfcts.out + +exit 0 diff --git a/elfutils/tests/run-arextract.sh b/elfutils/tests/run-arextract.sh index 839a6792..69ac0bca 100755 --- a/elfutils/tests/run-arextract.sh +++ b/elfutils/tests/run-arextract.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc. # Written by Ulrich Drepper <drepper@redhat.com>, 1999. # # This program is Open Source software; you can redistribute it and/or @@ -12,8 +12,7 @@ # by writing the Open Source Initiative c/o Lawrence Rosen, Esq., # 3001 King Ranch Road, Ukiah, CA 95482. -archive=../libelf/.libs/libelf.a -test -f $archive || archive=../libelf/libelf.a +archive=../libelf/libelf.a if test -f $archive; then # The file is really available (i.e., no shared-only built). echo -n "Extracting symbols... $ac_c" diff --git a/elfutils/tests/run-line2addr.sh b/elfutils/tests/run-line2addr.sh new file mode 100755 index 00000000..c46c8fda --- /dev/null +++ b/elfutils/tests/run-line2addr.sh @@ -0,0 +1,44 @@ +#! /bin/sh +# Copyright (C) 2005 Red Hat, Inc. +# Written by Ulrich Drepper <drepper@redhat.com>, 2005. +# +# This program is Open Source software; you can redistribute it and/or +# modify it under the terms of the Open Software License version 1.0 as +# published by the Open Source Initiative. +# +# You should have received a copy of the Open Software License along +# with this program; if not, you may obtain a copy of the Open Software +# License version 1.0 from http://www.opensource.org/licenses/osl.php or +# by writing the Open Source Initiative c/o Lawrence Rosen, Esq., +# 3001 King Ranch Road, Ukiah, CA 95482. +set -e + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0 + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/testfile14.bz2 > testfile14 2>/dev/null || exit 0 + +./line2addr testfile:f.c:4 testfile:f.c:8 testfile2:m.c:6 testfile2:b.c:1 testfile8:strip.c:953 testfile8:strip.c:365 testfile14:v.c:6 > line2addr.out + +diff -u line2addr.out - <<"EOF" +testfile:f.c:4 -> 0x804846b +testfile2:m.c:6 -> 0x100004cc +testfile2:b.c:1 -> 0x10000470 +testfile8:strip.c:953 -> 0x169f +testfile8:strip.c:953 -> 0x16aa +testfile8:strip.c:365 -> 0x278b +testfile8:strip.c:365 -> 0x2797 +testfile14:v.c:6 -> 0x400468 +testfile14:v.c:6 -> 0x400487 +EOF + +rm -f testfile testfile2 testfile8 testfile14 line2addr.out + +exit 0 diff --git a/elfutils/tests/run-strip-test.sh b/elfutils/tests/run-strip-test.sh index aab37f48..526eb091 100755 --- a/elfutils/tests/run-strip-test.sh +++ b/elfutils/tests/run-strip-test.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2003 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc. # Written by Ulrich Drepper <drepper@redhat.com>, 1999. # # This program is Open Source software; you can redistribute it and/or @@ -13,21 +13,39 @@ # 3001 King Ranch Road, Ukiah, CA 95482. set -e +original=${original:-testfile11} +stripped=${stripped:-testfile7} +debugout=${debugfile:+-f testfile.debug.temp -F $debugfile} + +# Don't fail if we cannot decompress the file. +bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0 + # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile11.bz2 > testfile11 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$stripped.bz2 > $stripped 2>/dev/null || exit 0 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile7.bz2 > testfile7 2>/dev/null || exit 0 +test -z "$debugfile" || +bunzip2 -c $srcdir/$debugfile.bz2 > $debugfile 2>/dev/null || exit 0 LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/strip -o testfile.temp testfile11 + ../src/strip -o testfile.temp $debugout $original -cmp testfile7 testfile.temp +cmp $stripped testfile.temp # Check elflint and the expected result. LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ../src/elflint -q testfile.temp -rm -f testfile11 testfile7 testfile.temp +test -z "$debugfile" || { +cmp $debugfile testfile.debug.temp + +# Check elflint and the expected result. +LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ + ../src/elflint -q -d testfile.debug.temp + +rm -f "$debugfile" +} + +rm -f $original $stripped testfile.temp testfile.debug.temp exit 0 diff --git a/elfutils/tests/run-strip-test2.sh b/elfutils/tests/run-strip-test2.sh index f385a865..824361c6 100755 --- a/elfutils/tests/run-strip-test2.sh +++ b/elfutils/tests/run-strip-test2.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc. # Written by Ulrich Drepper <drepper@redhat.com>, 1999. # # This program is Open Source software; you can redistribute it and/or @@ -11,23 +11,7 @@ # License version 1.0 from http://www.opensource.org/licenses/osl.php or # by writing the Open Source Initiative c/o Lawrence Rosen, Esq., # 3001 King Ranch Road, Ukiah, CA 95482. -set -e -# Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0 - -# Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile9.bz2 > testfile9 2>/dev/null || exit 0 - -LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/strip -o testfile.temp testfile8 - -cmp testfile9 testfile.temp - -# Check elflint and the expected result. -LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/elflint -q testfile.temp - -rm -f testfile8 testfile9 testfile.temp - -exit 0 +original=testfile8 +stripped=testfile9 +. $srcdir/run-strip-test.sh diff --git a/elfutils/tests/run-strip-test3.sh b/elfutils/tests/run-strip-test3.sh index 5ff4a5a9..3e8ac875 100755 --- a/elfutils/tests/run-strip-test3.sh +++ b/elfutils/tests/run-strip-test3.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2003 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc. # Written by Ulrich Drepper <drepper@redhat.com>, 1999. # # This program is Open Source software; you can redistribute it and/or @@ -11,23 +11,7 @@ # License version 1.0 from http://www.opensource.org/licenses/osl.php or # by writing the Open Source Initiative c/o Lawrence Rosen, Esq., # 3001 King Ranch Road, Ukiah, CA 95482. -set -e -# Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile12.bz2 > testfile12 2>/dev/null || exit 0 - -# Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile13.bz2 > testfile13 2>/dev/null || exit 0 - -LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/strip -o testfile.temp testfile12 - -cmp testfile13 testfile.temp - -# Check elflint and the expected result. -LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/elflint -q testfile.temp - -rm -f testfile12 testfile13 testfile.temp - -exit 0 +original=testfile12 +stripped=testfile13 +. $srcdir/run-strip-test.sh diff --git a/elfutils/tests/run-strip-test4.sh b/elfutils/tests/run-strip-test4.sh new file mode 100755 index 00000000..8e9be228 --- /dev/null +++ b/elfutils/tests/run-strip-test4.sh @@ -0,0 +1,5 @@ +original=testfile11 +stripped=testfile15 +debugfile=testfile15.debug + +. $srcdir/run-strip-test.sh diff --git a/elfutils/tests/run-strip-test5.sh b/elfutils/tests/run-strip-test5.sh new file mode 100755 index 00000000..9fa9ebef --- /dev/null +++ b/elfutils/tests/run-strip-test5.sh @@ -0,0 +1,5 @@ +original=testfile8 +stripped=testfile16 +debugfile=testfile16.debug + +. $srcdir/run-strip-test.sh diff --git a/elfutils/tests/run-strip-test6.sh b/elfutils/tests/run-strip-test6.sh new file mode 100755 index 00000000..8ee5f02c --- /dev/null +++ b/elfutils/tests/run-strip-test6.sh @@ -0,0 +1,5 @@ +original=testfile12 +stripped=testfile17 +debugfile=testfile17.debug + +. $srcdir/run-strip-test.sh diff --git a/elfutils/tests/show-abbrev.c b/elfutils/tests/show-abbrev.c index 7017932f..fba73759 100644 --- a/elfutils/tests/show-abbrev.c +++ b/elfutils/tests/show-abbrev.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. +/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 1998. This program is Open Source software; you can redistribute it and/or @@ -53,7 +53,7 @@ main (int argc, char *argv[]) { size_t length; Dwarf_Abbrev *abbrev = dwarf_getabbrev (&die, offset, &length); - if (abbrev == NULL) + if (abbrev == NULL || abbrev == DWARF_END_ABBREV) /* End of the list. */ break; diff --git a/elfutils/tests/testfile14.bz2 b/elfutils/tests/testfile14.bz2 Binary files differnew file mode 100644 index 00000000..ac7c69e1 --- /dev/null +++ b/elfutils/tests/testfile14.bz2 diff --git a/elfutils/tests/testfile15.bz2 b/elfutils/tests/testfile15.bz2 Binary files differnew file mode 100644 index 00000000..e75f4575 --- /dev/null +++ b/elfutils/tests/testfile15.bz2 diff --git a/elfutils/tests/testfile15.debug.bz2 b/elfutils/tests/testfile15.debug.bz2 Binary files differnew file mode 100644 index 00000000..5c869001 --- /dev/null +++ b/elfutils/tests/testfile15.debug.bz2 diff --git a/elfutils/tests/testfile16.bz2 b/elfutils/tests/testfile16.bz2 Binary files differnew file mode 100644 index 00000000..909e2253 --- /dev/null +++ b/elfutils/tests/testfile16.bz2 diff --git a/elfutils/tests/testfile16.debug.bz2 b/elfutils/tests/testfile16.debug.bz2 Binary files differnew file mode 100644 index 00000000..48d651fb --- /dev/null +++ b/elfutils/tests/testfile16.debug.bz2 diff --git a/elfutils/tests/testfile17.bz2 b/elfutils/tests/testfile17.bz2 Binary files differnew file mode 100644 index 00000000..5a123204 --- /dev/null +++ b/elfutils/tests/testfile17.bz2 diff --git a/elfutils/tests/testfile17.debug.bz2 b/elfutils/tests/testfile17.debug.bz2 Binary files differnew file mode 100644 index 00000000..86a76ab7 --- /dev/null +++ b/elfutils/tests/testfile17.debug.bz2 diff --git a/elfutils/tests/testfile9.bz2 b/elfutils/tests/testfile9.bz2 Binary files differindex 40454bce..40454bce 100755..100644 --- a/elfutils/tests/testfile9.bz2 +++ b/elfutils/tests/testfile9.bz2 |