summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-11-16 15:19:09 +0000
committerDmitry V. Levin <ldv@altlinux.org>2007-11-16 15:19:09 +0000
commitff8d659689b0aee56d115bdc0f24d68e61ce9a05 (patch)
treece6311e3afa4851d0dc087bfed63ce4bda2dce62
parent965679e2f32d58a7052caf2b81666d0049ba41f8 (diff)
downloadelfutils-ff8d659689b0aee56d115bdc0f24d68e61ce9a05.tar.gz
0.131-10.131-1
- Update to 0.131 - libdw: DW_FORM_ref_addr support; dwarf_formref entry point now deprecated; bug fixes for oddly-formatted DWARF - libdwfl: bug fixes in offline archive support, symbol table handling; apply partial relocations for dwfl_module_address_section on ET_REL - libebl: powerpc backend support for Altivec registers
-rw-r--r--.gear/rules2
-rw-r--r--elfutils-portability.patch331
-rw-r--r--elfutils-robustify.patch2117
-rw-r--r--elfutils-strip-copy-symtab.patch43
-rw-r--r--elfutils.spec118
-rw-r--r--elfutils/ABOUT-NLS1419
-rw-r--r--elfutils/ChangeLog10
-rw-r--r--elfutils/INSTALL186
-rw-r--r--elfutils/Makefile.am5
-rw-r--r--elfutils/Makefile.in169
-rw-r--r--elfutils/NEWS52
-rw-r--r--elfutils/aclocal.m4177
-rw-r--r--elfutils/backends/ChangeLog110
-rw-r--r--elfutils/backends/Makefile.am20
-rw-r--r--elfutils/backends/Makefile.in166
-rw-r--r--elfutils/backends/alpha_corenote.c67
-rw-r--r--elfutils/backends/alpha_init.c5
-rw-r--r--elfutils/backends/alpha_regs.c161
-rw-r--r--elfutils/backends/alpha_retval.c20
-rw-r--r--elfutils/backends/alpha_symbol.c10
-rw-r--r--elfutils/backends/i386_auxv.c49
-rw-r--r--elfutils/backends/i386_corenote.c191
-rw-r--r--elfutils/backends/i386_init.c3
-rw-r--r--elfutils/backends/i386_regs.c4
-rw-r--r--elfutils/backends/i386_retval.c20
-rw-r--r--elfutils/backends/ia64_retval.c39
-rw-r--r--elfutils/backends/linux-core-note.c222
-rw-r--r--elfutils/backends/ppc64_corenote.c2
-rw-r--r--elfutils/backends/ppc64_init.c4
-rw-r--r--elfutils/backends/ppc64_retval.c32
-rw-r--r--elfutils/backends/ppc_auxv.c52
-rw-r--r--elfutils/backends/ppc_corenote.c115
-rw-r--r--elfutils/backends/ppc_init.c4
-rw-r--r--elfutils/backends/ppc_regs.c45
-rw-r--r--elfutils/backends/ppc_retval.c25
-rw-r--r--elfutils/backends/ppc_symbol.c7
-rw-r--r--elfutils/backends/s390_retval.c14
-rw-r--r--elfutils/backends/sparc64_corenote.c2
-rw-r--r--elfutils/backends/sparc_auxv.c43
-rw-r--r--elfutils/backends/sparc_corenote.c109
-rw-r--r--elfutils/backends/sparc_init.c10
-rw-r--r--elfutils/backends/sparc_retval.c24
-rw-r--r--elfutils/backends/sparc_symbol.c13
-rw-r--r--elfutils/backends/x86_64_corenote.c204
-rw-r--r--elfutils/backends/x86_64_init.c5
-rw-r--r--elfutils/backends/x86_64_regs.c60
-rw-r--r--elfutils/backends/x86_64_retval.c24
-rw-r--r--elfutils/config/ChangeLog8
-rw-r--r--elfutils/config/Makefile.in112
-rwxr-xr-x[-rw-r--r--]elfutils/config/config.guess631
-rwxr-xr-x[-rw-r--r--]elfutils/config/config.sub175
-rwxr-xr-x[-rw-r--r--]elfutils/config/depcomp442
-rw-r--r--elfutils/config/elfutils.spec.in40
-rwxr-xr-x[-rw-r--r--]elfutils/config/install-sh662
-rwxr-xr-x[-rw-r--r--]elfutils/config/missing205
-rw-r--r--elfutils/config/mkinstalldirs101
-rwxr-xr-xelfutils/config/ylwrap223
-rwxr-xr-xelfutils/configure5355
-rw-r--r--elfutils/configure.ac7
-rw-r--r--elfutils/elfutils.spec42
-rw-r--r--elfutils/lib/Makefile.in118
-rw-r--r--elfutils/libasm/Makefile.in136
-rw-r--r--elfutils/libcpu/Makefile.in118
-rw-r--r--elfutils/libdw/ChangeLog96
-rw-r--r--elfutils/libdw/Makefile.am4
-rw-r--r--elfutils/libdw/Makefile.in167
-rw-r--r--elfutils/libdw/dwarf.h4
-rw-r--r--elfutils/libdw/dwarf_begin_elf.c27
-rw-r--r--elfutils/libdw/dwarf_child.c11
-rw-r--r--elfutils/libdw/dwarf_formref.c22
-rw-r--r--elfutils/libdw/dwarf_formref_die.c36
-rw-r--r--elfutils/libdw/dwarf_getscopes.c38
-rw-r--r--elfutils/libdw/dwarf_getsrcdirs.c (renamed from elfutils/libelf/gelf_freechunk.c)35
-rw-r--r--elfutils/libdw/dwarf_getsrclines.c24
-rw-r--r--elfutils/libdw/dwarf_ranges.c21
-rw-r--r--elfutils/libdw/dwarf_siblingof.c4
-rw-r--r--elfutils/libdw/libdw.h28
-rw-r--r--elfutils/libdw/libdw.map24
-rw-r--r--elfutils/libdw/libdwP.h11
-rw-r--r--elfutils/libdw/libdw_findcu.c13
-rw-r--r--elfutils/libdw/libdw_form.c7
-rw-r--r--elfutils/libdw/libdw_visit_scopes.c4
-rw-r--r--elfutils/libdwfl/ChangeLog330
-rw-r--r--elfutils/libdwfl/Makefile.am8
-rw-r--r--elfutils/libdwfl/Makefile.in167
-rw-r--r--elfutils/libdwfl/argp-std.c12
-rw-r--r--elfutils/libdwfl/derelocate.c189
-rw-r--r--elfutils/libdwfl/dwfl_build_id_find_debuginfo.c92
-rw-r--r--elfutils/libdwfl/dwfl_build_id_find_elf.c152
-rw-r--r--elfutils/libdwfl/dwfl_module.c40
-rw-r--r--elfutils/libdwfl/dwfl_module_addrname.c72
-rw-r--r--elfutils/libdwfl/dwfl_module_addrsym.c186
-rw-r--r--elfutils/libdwfl/dwfl_module_build_id.c166
-rw-r--r--elfutils/libdwfl/dwfl_module_getdwarf.c410
-rw-r--r--elfutils/libdwfl/dwfl_module_getsym.c18
-rw-r--r--elfutils/libdwfl/dwfl_module_report_build_id.c (renamed from elfutils/libelf/gelf_rawchunk.c)90
-rw-r--r--elfutils/libdwfl/dwfl_report_elf.c164
-rw-r--r--elfutils/libdwfl/elf-from-memory.c12
-rw-r--r--elfutils/libdwfl/find-debuginfo.c71
-rw-r--r--elfutils/libdwfl/libdwfl.h112
-rw-r--r--elfutils/libdwfl/libdwflP.h65
-rw-r--r--elfutils/libdwfl/linux-kernel-modules.c413
-rw-r--r--elfutils/libdwfl/offline.c236
-rw-r--r--elfutils/libdwfl/relocate.c682
-rw-r--r--elfutils/libebl/ChangeLog45
-rw-r--r--elfutils/libebl/Makefile.am2
-rw-r--r--elfutils/libebl/Makefile.in137
-rw-r--r--elfutils/libebl/ebl-hooks.h9
-rw-r--r--elfutils/libebl/eblauxvinfo.c121
-rw-r--r--elfutils/libebl/eblcorenote.c200
-rw-r--r--elfutils/libebl/eblcorenotetypename.c18
-rw-r--r--elfutils/libebl/eblobjnote.c99
-rw-r--r--elfutils/libebl/eblobjnotetypename.c4
-rw-r--r--elfutils/libebl/eblopenbackend.c39
-rw-r--r--elfutils/libebl/libebl.h41
-rw-r--r--elfutils/libelf-po/ChangeLog15
-rw-r--r--elfutils/libelf-po/Makefile.in.in302
-rw-r--r--elfutils/libelf-po/Makevars25
-rw-r--r--elfutils/libelf-po/POTFILES.in5
-rw-r--r--elfutils/libelf-po/Rules-quot42
-rw-r--r--elfutils/libelf-po/boldquot.sed10
-rw-r--r--elfutils/libelf-po/en@boldquot.header25
-rw-r--r--elfutils/libelf-po/en@quot.header22
-rw-r--r--elfutils/libelf-po/insert-header.sin23
-rw-r--r--elfutils/libelf-po/libelf.pot182
-rw-r--r--elfutils/libelf-po/quot.sed6
-rw-r--r--elfutils/libelf/ChangeLog97
-rw-r--r--elfutils/libelf/Makefile.am6
-rw-r--r--elfutils/libelf/Makefile.in176
-rw-r--r--elfutils/libelf/abstract.h19
-rw-r--r--elfutils/libelf/elf.h65
-rw-r--r--elfutils/libelf/elf32_updatefile.c17
-rw-r--r--elfutils/libelf/elf_begin.c27
-rw-r--r--elfutils/libelf/elf_end.c20
-rw-r--r--elfutils/libelf/elf_getdata.c162
-rw-r--r--elfutils/libelf/elf_getdata_rawchunk.c188
-rw-r--r--elfutils/libelf/exttypes.h4
-rw-r--r--elfutils/libelf/gelf.h19
-rw-r--r--elfutils/libelf/gelf_fsize.c5
-rw-r--r--elfutils/libelf/gelf_getauxv.c130
-rw-r--r--elfutils/libelf/gelf_getnote.c119
-rw-r--r--elfutils/libelf/gelf_update_auxv.c135
-rw-r--r--elfutils/libelf/gelf_xlate.c8
-rw-r--r--elfutils/libelf/gelf_xlate.h3
-rw-r--r--elfutils/libelf/libelf.h20
-rw-r--r--elfutils/libelf/libelf.map10
-rw-r--r--elfutils/libelf/libelfP.h36
-rw-r--r--elfutils/libelf/note_xlate.h80
-rw-r--r--elfutils/m4/ChangeLog8
-rw-r--r--elfutils/m4/Makefile.in109
-rw-r--r--elfutils/m4/gettext.m4452
-rw-r--r--elfutils/m4/iconv.m48
-rw-r--r--elfutils/m4/nls.m431
-rw-r--r--elfutils/m4/po.m4428
-rw-r--r--elfutils/m4/progtest.m479
-rw-r--r--elfutils/po/ChangeLog15
-rw-r--r--elfutils/po/Makefile.in.in192
-rw-r--r--elfutils/po/Makevars19
-rw-r--r--elfutils/po/POTFILES.in1
-rw-r--r--elfutils/po/Rules-quot5
-rw-r--r--elfutils/po/elfutils.pot1469
-rw-r--r--elfutils/po/remove-potcdate.sin19
-rw-r--r--elfutils/po/stamp-po1
-rw-r--r--elfutils/src/ChangeLog394
-rw-r--r--elfutils/src/Makefile.am20
-rw-r--r--elfutils/src/Makefile.in325
-rw-r--r--elfutils/src/addr2line.c45
-rw-r--r--elfutils/src/ar.c62
-rw-r--r--elfutils/src/arlib.c7
-rw-r--r--elfutils/src/arlib.h5
-rw-r--r--elfutils/src/arlib2.c4
-rw-r--r--elfutils/src/elfcmp.c121
-rw-r--r--elfutils/src/elflint.c323
-rw-r--r--elfutils/src/findtextrel.c6
-rw-r--r--elfutils/src/ld.c6
-rw-r--r--elfutils/src/ldgeneric.c2
-rw-r--r--elfutils/src/ldlex.c1837
-rw-r--r--elfutils/src/ldscript.c128
-rw-r--r--elfutils/src/ldscript.h4
-rw-r--r--elfutils/src/make-debug-archive.in132
-rw-r--r--elfutils/src/nm.c61
-rw-r--r--elfutils/src/objdump.c8
-rw-r--r--elfutils/src/ranlib.c6
-rw-r--r--elfutils/src/readelf.c1787
-rw-r--r--elfutils/src/size.c8
-rw-r--r--elfutils/src/strings.c6
-rw-r--r--elfutils/src/strip.c61
-rw-r--r--elfutils/src/unstrip.c2314
-rw-r--r--elfutils/tests/ChangeLog159
-rw-r--r--elfutils/tests/Makefile.am32
-rw-r--r--elfutils/tests/Makefile.in296
-rw-r--r--elfutils/tests/dwfl-addr-sect.c88
-rw-r--r--elfutils/tests/dwfl-bug-fd-leak.c110
-rw-r--r--elfutils/tests/dwfl-bug-report.c56
-rw-r--r--elfutils/tests/dwflmodtest.c38
-rw-r--r--elfutils/tests/get-files.c18
-rwxr-xr-xelfutils/tests/run-addrname-test.sh20
-rwxr-xr-xelfutils/tests/run-allregs.sh189
-rwxr-xr-xelfutils/tests/run-dwfl-addr-sect.sh37
-rwxr-xr-xelfutils/tests/run-dwfl-bug-offline-rel.sh36
-rwxr-xr-xelfutils/tests/run-elflint-self.sh5
-rwxr-xr-xelfutils/tests/run-elflint-test.sh3
-rwxr-xr-xelfutils/tests/run-get-files.sh8
-rwxr-xr-xelfutils/tests/run-readelf-test2.sh36
-rwxr-xr-xelfutils/tests/run-readelf-test3.sh39
-rwxr-xr-xelfutils/tests/run-readelf-test4.sh41
-rwxr-xr-xelfutils/tests/run-strip-test.sh22
-rwxr-xr-xelfutils/tests/run-strip-test4.sh4
-rwxr-xr-xelfutils/tests/run-strip-test6.sh4
-rwxr-xr-xelfutils/tests/run-strip-test7.sh5
-rwxr-xr-xelfutils/tests/run-unstrip-test.sh42
-rwxr-xr-xelfutils/tests/run-unstrip-test2.sh5
-rw-r--r--elfutils/tests/test-subr.sh4
-rw-r--r--elfutils/tests/testfile35.bz2bin0 -> 1643 bytes
-rw-r--r--elfutils/tests/testfile35.debug.bz2bin0 -> 9106 bytes
-rw-r--r--elfutils/tests/testfile36.bz2bin0 -> 714 bytes
-rw-r--r--elfutils/tests/testfile36.debug.bz2bin0 -> 24909 bytes
-rw-r--r--elfutils/tests/testfile37.bz2bin0 -> 3140 bytes
-rw-r--r--elfutils/tests/testfile37.debug.bz2bin0 -> 28522 bytes
-rw-r--r--elfutils/tests/testfile38.bz2bin0 -> 457 bytes
-rw-r--r--elfutils/tests/testfile39.bz2bin0 -> 2992 bytes
-rw-r--r--elfutils/tests/testfile40.bz2bin0 -> 2302 bytes
-rw-r--r--elfutils/tests/testfile40.debug.bz2bin0 -> 1398 bytes
-rw-r--r--elfutils/tests/testfile41.bz2bin0 -> 295 bytes
-rw-r--r--elfutils/tests/testfile42.bz2bin0 -> 16201 bytes
-rw-r--r--elfutils/tests/testfile43.bz2bin0 -> 739 bytes
226 files changed, 22809 insertions, 10862 deletions
diff --git a/.gear/rules b/.gear/rules
index 5a1113bc..5d5de53b 100644
--- a/.gear/rules
+++ b/.gear/rules
@@ -1,4 +1,4 @@
bzip2: *.debug
copy: *.patch
bzip2: *.symtab
-tar.gz: elfutils name=elfutils-0.126
+tar.gz: elfutils name=elfutils-0.131
diff --git a/elfutils-portability.patch b/elfutils-portability.patch
index 63e7a9cc..737e0996 100644
--- a/elfutils-portability.patch
+++ b/elfutils-portability.patch
@@ -1,6 +1,6 @@
--- elfutils/backends/ChangeLog
+++ elfutils/backends/ChangeLog
-@@ -130,6 +130,11 @@
+@@ -240,6 +240,11 @@
* sparc_init.c: Likewise.
* x86_64_init.c: Likewise.
@@ -12,7 +12,7 @@
2005-11-19 Roland McGrath <roland@redhat.com>
* ppc64_reloc.def: REL30 -> ADDR30.
-@@ -152,6 +157,9 @@
+@@ -262,6 +267,9 @@
* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
(CLEANFILES): Add libebl_$(m).so.
@@ -51,7 +51,7 @@
libebl_%.map: Makefile
--- elfutils/backends/Makefile.in
+++ elfutils/backends/Makefile.in
-@@ -159,6 +159,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -152,6 +152,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -59,17 +59,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -199,6 +200,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -181,6 +182,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -241,9 +243,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -236,9 +238,9 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
-@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99
+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99
@@ -79,7 +79,7 @@
INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
-I$(top_srcdir)/lib -I..
-@@ -604,7 +606,7 @@ uninstall-am: uninstall-info-am
+@@ -626,7 +628,7 @@ uninstall-am:
libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(word 2,$^) \
@@ -90,7 +90,7 @@
libebl_%.map: Makefile
--- elfutils/ChangeLog
+++ elfutils/ChangeLog
-@@ -15,6 +15,10 @@
+@@ -25,6 +25,10 @@
* configure.ac: Add dummy automake conditional to get dependencies
for non-generic linker right. See src/Makefile.am.
@@ -101,7 +101,7 @@
2005-11-18 Roland McGrath <roland@redhat.com>
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
-@@ -62,6 +66,17 @@
+@@ -72,6 +76,17 @@
* Makefile.am (all_SUBDIRS): Add libdwfl.
* configure.ac: Write libdwfl/Makefile.
@@ -121,7 +121,7 @@
* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
--- elfutils/config/Makefile.in
+++ elfutils/config/Makefile.in
-@@ -84,6 +84,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -71,6 +71,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -129,31 +129,31 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -124,6 +125,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -100,6 +101,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
--- elfutils/configure
+++ elfutils/configure
-@@ -276,7 +276,7 @@ PACKAGE_STRING='Red Hat elfutils 0.126'
- 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 MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT MODVERSION 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 NEVER_TRUE NEVER_FALSE MUDFLAP_TRUE MUDFLAP_FALSE GPROF_TRUE GPROF_FALSE GCOV_TRUE GCOV_FALSE BUILD_STATIC_TRUE BUILD_STATIC_FALSE TESTS_RPATH_TRUE TESTS_RPATH_FALSE LIBEBL_SUBDIR HAVE_LIBASM_TRUE HAVE_LIBASM_FALSE STANDALONE_TRUE STANDALONE_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE 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 MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT MODVERSION 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 WEXTRA LD_AS_NEEDED LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu NEVER_TRUE NEVER_FALSE MUDFLAP_TRUE MUDFLAP_FALSE GPROF_TRUE GPROF_FALSE GCOV_TRUE GCOV_FALSE BUILD_STATIC_TRUE BUILD_STATIC_FALSE TESTS_RPATH_TRUE TESTS_RPATH_FALSE LIBEBL_SUBDIR HAVE_LIBASM_TRUE HAVE_LIBASM_FALSE STANDALONE_TRUE STANDALONE_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -3411,6 +3411,92 @@ echo "$as_me: error: gcc with C99 suppor
+@@ -674,6 +674,8 @@ YFLAGS
+ LEX
+ LEX_OUTPUT_ROOT
+ LEXLIB
++WEXTRA
++LD_AS_NEEDED
+ LOCALEDIR
+ DATADIRNAME
+ NATIVE_LD_TRUE
+@@ -3874,6 +3876,88 @@ echo "$as_me: error: gcc with C99 suppor
fi
-+echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
-+echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6
++{ echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
++echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6; }
+if test "${ac_cv_cc_wextra+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
@@ -163,39 +163,35 @@
+void foo (void) { }
+_ACEOF
+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_compile") 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_objext'
-+ { (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
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_cc_wextra=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
-+ac_cv_cc_wextra=no
++ ac_cv_cc_wextra=no
+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$old_CFLAGS"
+fi
-+echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
-+echo "${ECHO_T}$ac_cv_cc_wextra" >&6
++{ echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
++echo "${ECHO_T}$ac_cv_cc_wextra" >&6; }
+
+if test "x$ac_cv_cc_wextra" = xyes; then
+ WEXTRA=-Wextra
@@ -204,8 +200,8 @@
+fi
+
+
-+echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
-+echo $ECHO_N "checking for --as-needed linker option... $ECHO_C" >&6
++{ echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
++echo $ECHO_N "checking for --as-needed linker option... $ECHO_C" >&6; }
+if test "${ac_cv_as_needed+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
@@ -227,8 +223,8 @@
+fi
+rm -f conftest*
+fi
-+echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
-+echo "${ECHO_T}$ac_cv_as_needed" >&6
++{ echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
++echo "${ECHO_T}$ac_cv_as_needed" >&6; }
+if test "x$ac_cv_as_needed" = xyes; then
+ LD_AS_NEEDED=-Wl,--as-needed
+else
@@ -241,18 +237,40 @@
LOCALEDIR=$datadir
cat >>confdefs.h <<_ACEOF
-@@ -5040,6 +5126,8 @@ s,@YACC@,$YACC,;t t
- s,@LEX@,$LEX,;t t
- s,@LEXLIB@,$LEXLIB,;t t
- s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
-+s,@WEXTRA@,$WEXTRA,;t t
-+s,@LD_AS_NEEDED@,$LD_AS_NEEDED,;t t
- s,@LOCALEDIR@,$LOCALEDIR,;t t
- s,@DATADIRNAME@,$DATADIRNAME,;t t
- s,@NATIVE_LD_TRUE@,$NATIVE_LD_TRUE,;t t
+@@ -5608,10 +5692,10 @@ YFLAGS!$YFLAGS$ac_delim
+ LEX!$LEX$ac_delim
+ LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+ LEXLIB!$LEXLIB$ac_delim
++WEXTRA!$WEXTRA$ac_delim
++LD_AS_NEEDED!$LD_AS_NEEDED$ac_delim
+ LOCALEDIR!$LOCALEDIR$ac_delim
+ DATADIRNAME!$DATADIRNAME$ac_delim
+-NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
+-NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
+ _ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+@@ -5653,6 +5737,8 @@ _ACEOF
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
++NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
++NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
+ base_cpu!$base_cpu$ac_delim
+ NEVER_TRUE!$NEVER_TRUE$ac_delim
+ NEVER_FALSE!$NEVER_FALSE$ac_delim
+@@ -5683,7 +5769,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--- elfutils/configure.ac
+++ elfutils/configure.ac
-@@ -70,6 +70,34 @@ CFLAGS="$old_CFLAGS"])
+@@ -71,6 +71,34 @@ CFLAGS="$old_CFLAGS"])
AS_IF([test "x$ac_cv_c99" != xyes],
AC_MSG_ERROR([gcc with C99 support required]))
@@ -320,7 +338,7 @@
noinst_LIBRARIES = libeu.a
--- elfutils/lib/Makefile.in
+++ elfutils/lib/Makefile.in
-@@ -103,6 +103,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -91,6 +91,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -328,17 +346,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -143,6 +144,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -120,6 +121,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -185,9 +187,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -175,9 +177,9 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
-@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS)
+@MUDFLAP_FALSE@ $(WEXTRA) $($(*F)_CFLAGS)
@@ -381,7 +399,7 @@
-I$(top_srcdir)/lib
--- elfutils/libasm/Makefile.in
+++ elfutils/libasm/Makefile.in
-@@ -136,6 +136,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -124,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -389,17 +407,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -176,6 +177,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -153,6 +154,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = 1
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -218,9 +220,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -208,9 +210,9 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \
-@MUDFLAP_FALSE@ -Wextra -Wformat=2
+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2
@@ -434,7 +452,7 @@
noinst_LIBRARIES = libcpu_i386.a
--- elfutils/libcpu/Makefile.in
+++ elfutils/libcpu/Makefile.in
-@@ -99,6 +99,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -87,6 +87,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -442,18 +460,18 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -139,6 +140,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -116,6 +117,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -180,7 +182,7 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
+@@ -170,7 +172,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
INCLUDES = -I$(srcdir)
@@ -461,7 +479,7 @@
libcpu_i386_a_SOURCES = i386_dis.c
--- elfutils/libdw/ChangeLog
+++ elfutils/libdw/ChangeLog
-@@ -329,6 +329,11 @@
+@@ -425,6 +425,11 @@
2005-05-31 Roland McGrath <roland@redhat.com>
@@ -494,7 +512,7 @@
--- elfutils/libdw/Makefile.in
+++ elfutils/libdw/Makefile.in
-@@ -176,6 +176,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -163,6 +163,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -502,17 +520,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -216,6 +217,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -192,6 +193,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = 1
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -258,9 +260,10 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -247,9 +249,10 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \
-@MUDFLAP_FALSE@ -Wunused -Wformat=2 -Wextra -std=gnu99
+@MUDFLAP_FALSE@ -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
@@ -525,7 +543,7 @@
$(COMPILE)))
--- elfutils/libdwfl/ChangeLog
+++ elfutils/libdwfl/ChangeLog
-@@ -409,6 +409,11 @@
+@@ -739,6 +739,11 @@
2005-07-21 Roland McGrath <roland@redhat.com>
@@ -556,7 +574,7 @@
VERSION = 1
--- elfutils/libdwfl/Makefile.in
+++ elfutils/libdwfl/Makefile.in
-@@ -136,6 +136,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -128,6 +128,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -564,17 +582,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -176,6 +177,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -157,6 +158,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = 1
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -218,9 +220,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -212,9 +214,9 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
-@MUDFLAP_FALSE@ -Wextra -std=gnu99
+@MUDFLAP_FALSE@ $(WEXTRA) -std=gnu99
@@ -586,7 +604,7 @@
--- elfutils/libebl/ChangeLog
+++ elfutils/libebl/ChangeLog
-@@ -460,6 +460,11 @@
+@@ -505,6 +505,11 @@
* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
tracking works right.
@@ -617,7 +635,7 @@
INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
--- elfutils/libebl/Makefile.in
+++ elfutils/libebl/Makefile.in
-@@ -132,6 +132,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -120,6 +120,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -625,17 +643,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -172,6 +173,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -149,6 +150,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = 1
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -214,9 +216,9 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -204,9 +206,9 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
-@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99
+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99
@@ -647,7 +665,7 @@
--- elfutils/libelf/ChangeLog
+++ elfutils/libelf/ChangeLog
-@@ -206,6 +206,11 @@
+@@ -303,6 +303,11 @@
If section content hasn't been read yet, do it before looking for the
block size. If no section data present, infer size of section header.
@@ -703,7 +721,7 @@
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
--- elfutils/libelf/Makefile.in
+++ elfutils/libelf/Makefile.in
-@@ -38,7 +38,7 @@ PRE_UNINSTALL = :
+@@ -34,7 +34,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@@ -712,7 +730,7 @@
@MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
@MUDFLAP_TRUE@am_libelf_pic_a_OBJECTS =
subdir = libelf
-@@ -179,6 +179,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -168,6 +168,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -720,17 +738,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -219,6 +220,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -197,6 +198,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = 1
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -261,10 +263,10 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+@@ -252,10 +254,10 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
-@MUDFLAP_FALSE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \
+@MUDFLAP_FALSE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
@@ -743,7 +761,7 @@
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
--- elfutils/m4/Makefile.in
+++ elfutils/m4/Makefile.in
-@@ -82,6 +82,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -70,6 +70,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -751,17 +769,17 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -122,6 +123,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -99,6 +100,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
--- elfutils/Makefile.in
+++ elfutils/Makefile.in
-@@ -106,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -97,6 +97,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -769,17 +787,26 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -146,6 +147,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -126,6 +127,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
--- elfutils/src/ChangeLog
+++ elfutils/src/ChangeLog
-@@ -76,6 +76,10 @@
+@@ -30,6 +30,8 @@
+
+ * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+
++ * Makefile.am (readelf_no_Werror): New variable.
++
+ 2007-10-15 Roland McGrath <roland@redhat.com>
+
+ * make-debug-archive.in: New file.
+@@ -469,6 +471,10 @@
* elflint.c (valid_e_machine): Add EM_ALPHA.
Reported by Christian Aichinger <Greek0@gmx.net>.
@@ -790,7 +817,7 @@
2006-08-08 Ulrich Drepper <drepper@redhat.com>
* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
-@@ -152,6 +156,10 @@
+@@ -545,6 +551,10 @@
* Makefile.am: Add hacks to create dependency files for non-generic
linker.
@@ -801,7 +828,7 @@
2006-06-12 Ulrich Drepper <drepper@redhat.com>
* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
-@@ -500,6 +508,11 @@
+@@ -893,6 +903,11 @@
* readelf.c (print_debug_loc_section): Fix indentation for larger
address size.
@@ -847,9 +874,19 @@
$(if $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
+@@ -108,6 +109,9 @@ strings_no_Wformat = yes
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
+
++# Buggy old compilers.
++readelf_no_Werror = yes
++
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu) $(libmudflap)
--- elfutils/src/Makefile.in
+++ elfutils/src/Makefile.in
-@@ -212,6 +212,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -200,6 +200,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -857,15 +894,15 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -252,6 +253,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -229,6 +230,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@ -d
- ac_ct_CC = @ac_ct_CC@
-@@ -296,13 +298,13 @@ target_alias = @target_alias@
+@@ -286,13 +288,13 @@ top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \
@MUDFLAP_FALSE@ $(native_ld_cflags) $(if \
@MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) $(if \
@@ -881,6 +918,16 @@
@MUDFLAP_TRUE@ $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
-I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
+@@ -334,6 +336,9 @@ size_no_Wformat = yes
+ strings_no_Wformat = yes
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
++
++# Buggy old compilers.
++readelf_no_Werror = yes
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu) $(libmudflap)
--- elfutils/src/strings.c
+++ elfutils/src/strings.c
@@ -51,6 +51,10 @@
@@ -942,7 +989,7 @@
}
/* Open the file. */
-@@ -1691,7 +1707,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1702,7 +1718,7 @@ handle_elf (int fd, Elf *elf, const char
/* If requested, preserve the timestamp. */
if (tvp != NULL)
{
@@ -951,7 +998,7 @@
{
error (0, errno, gettext ("\
cannot set access and modification date of '%s'"),
-@@ -1748,7 +1764,7 @@ handle_ar (int fd, Elf *elf, const char
+@@ -1759,7 +1775,7 @@ handle_ar (int fd, Elf *elf, const char
if (tvp != NULL)
{
@@ -962,7 +1009,7 @@
cannot set access and modification date of '%s'"), fname);
--- elfutils/tests/ChangeLog
+++ elfutils/tests/ChangeLog
-@@ -449,6 +449,11 @@
+@@ -606,6 +606,11 @@
* Makefile.am (TESTS): Add run-elflint-test.sh.
(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
@@ -994,7 +1041,7 @@
endif
--- elfutils/tests/Makefile.in
+++ elfutils/tests/Makefile.in
-@@ -297,6 +297,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -323,6 +323,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
@@ -1002,18 +1049,18 @@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -337,6 +338,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
- TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
+@@ -352,6 +353,7 @@ SHELL = @SHELL@
+ STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WEXTRA = @WEXTRA@
XGETTEXT = @XGETTEXT@
+ XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
- ac_ct_CC = @ac_ct_CC@
-@@ -378,10 +380,10 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
+@@ -406,10 +408,10 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
@MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch
index 9f87c48d..ddeebcee 100644
--- a/elfutils-robustify.patch
+++ b/elfutils-robustify.patch
@@ -65,1032 +65,9 @@ src/
(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
check_symtab_shndx, check_hash, check_versym): Robustify.
---- elfutils-0.122/libelf/elf32_getphdr.c
-+++ elfutils-0.122/libelf/elf32_getphdr.c
-@@ -115,6 +115,16 @@ elfw2(LIBELFBITS,getphdr) (elf)
-
- if (elf->map_address != NULL)
- {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
-+ || unlikely (ehdr->e_phoff + size > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_PHDR);
-+ goto out;
-+ }
-+
- /* All the data is already mapped. Use it. */
- if (ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
---- elfutils-0.126/libelf/elf32_getshdr.c
-+++ elfutils-0.126/libelf/elf32_getshdr.c
-@@ -101,7 +101,8 @@ elfw2(LIBELFBITS,getshdr) (scn)
- goto out;
-
- size_t shnum;
-- if (INTUSE (elf_getshnum) (elf, &shnum) != 0)
-+ if (INTUSE (elf_getshnum) (elf, &shnum) != 0
-+ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
- goto out;
- size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
-
-@@ -118,6 +119,16 @@ elfw2(LIBELFBITS,getshdr) (scn)
-
- if (elf->map_address != NULL)
- {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
-+ || unlikely (ehdr->e_shoff + size > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ goto free_and_out;
-+ }
-+
- ElfW2(LIBELFBITS,Shdr) *notcvt;
-
- /* All the data is already mapped. If we could use it
-
---- elfutils-0.122/libelf/elf32_newphdr.c
-+++ elfutils-0.122/libelf/elf32_newphdr.c
-@@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
- else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count
- || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
- {
-+ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
-+ {
-+ result = NULL;
-+ goto out;
-+ }
-+
- /* Allocate a new program header with the appropriate number of
- elements. */
- result = (ElfW2(LIBELFBITS,Phdr) *)
---- elfutils-0.122/libelf/elf32_updatefile.c
-+++ elfutils-0.122/libelf/elf32_updatefile.c
-@@ -201,6 +201,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
- /* Write all the sections. Well, only those which are modified. */
- if (shnum > 0)
- {
-+ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
-+ return 1;
-+
- Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
- Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
- char *const shdr_start = ((char *) elf->map_address + elf->start_offset
-@@ -571,6 +574,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
- /* Write all the sections. Well, only those which are modified. */
- if (shnum > 0)
- {
-+ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
-+ + sizeof (ElfW2(LIBELFBITS,Shdr)))))
-+ return 1;
-+
- 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];
---- elfutils-0.122/libelf/elf_begin.c
-+++ elfutils-0.122/libelf/elf_begin.c
-@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c
-
- if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
- {
-- if (offset + ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
-+ if (unlikely (ehdr.e32->e_shoff >= maxsize)
-+ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize))
- /* Cannot read the first section header. */
- return (size_t) -1l;
-
-@@ -198,7 +199,8 @@ get_shnum (void *map_address, unsigned c
-
- if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
- {
-- if (offset + ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
-+ if (unlikely (ehdr.e64->e_shoff >= maxsize)
-+ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
- /* Cannot read the first section header. */
- return (size_t) -1l;
-
-@@ -265,6 +267,15 @@ file_read_elf (int fildes, void *map_add
- /* Could not determine the number of sections. */
- return NULL;
-
-+ /* Check for too many sections. */
-+ if (e_ident[EI_CLASS] == ELFCLASS32)
-+ {
-+ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
-+ return NULL;
-+ }
-+ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
-+ return NULL;
-+
- /* We can now allocate the memory. */
- Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
- ELF_K_ELF, scncnt * sizeof (Elf_Scn));
-@@ -298,13 +309,31 @@ file_read_elf (int fildes, void *map_add
- {
- /* We can use the mmapped memory. */
- elf->state.elf32.ehdr = ehdr;
-+
-+ if (unlikely (ehdr->e_shoff >= maxsize)
-+ || unlikely (ehdr->e_shoff
-+ + scncnt * sizeof (Elf32_Shdr) > maxsize))
-+ {
-+ free_and_out:
-+ free (elf);
-+ __libelf_seterrno (ELF_E_INVALID_FILE);
-+ return NULL;
-+ }
- elf->state.elf32.shdr
- = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
-+
- if (ehdr->e_phnum > 0)
-+ {
- /* Assign a value only if there really is a program
- header. Otherwise the value remains NULL. */
-+ if (unlikely (ehdr->e_phoff >= maxsize)
-+ || unlikely (ehdr->e_phoff
-+ + ehdr->e_phnum
-+ * sizeof (Elf32_Phdr) > maxsize))
-+ goto free_and_out;
- elf->state.elf32.phdr
- = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff);
-+ }
-
- for (size_t cnt = 0; cnt < scncnt; ++cnt)
- {
-@@ -373,13 +402,26 @@ file_read_elf (int fildes, void *map_add
- {
- /* We can use the mmapped memory. */
- elf->state.elf64.ehdr = ehdr;
-+
-+ if (unlikely (ehdr->e_shoff >= maxsize)
-+ || unlikely (ehdr->e_shoff
-+ + scncnt * sizeof (Elf32_Shdr) > maxsize))
-+ goto free_and_out;
- elf->state.elf64.shdr
- = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
-+
- if (ehdr->e_phnum > 0)
-+ {
- /* Assign a value only if there really is a program
- header. Otherwise the value remains NULL. */
-+ if (unlikely (ehdr->e_phoff >= maxsize)
-+ || unlikely (ehdr->e_phoff
-+ + ehdr->e_phnum
-+ * sizeof (Elf32_Phdr) > maxsize))
-+ goto free_and_out;
- elf->state.elf64.phdr
- = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
-+ }
-
- for (size_t cnt = 0; cnt < scncnt; ++cnt)
- {
---- elfutils-0.122/libelf/elf_getarsym.c
-+++ elfutils-0.122/libelf/elf_getarsym.c
-@@ -179,6 +179,9 @@ elf_getarsym (elf, ptr)
- size_t index_size = atol (tmpbuf);
-
- if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
-+#if SIZE_MAX <= 4294967295U
-+ || n >= SIZE_MAX / sizeof (Elf_Arsym)
-+#endif
- || n * sizeof (uint32_t) > index_size)
- {
- /* This index table cannot be right since it does not fit into
---- elfutils-0.122/libelf/elf_getshstrndx.c
-+++ elfutils-0.122/libelf/elf_getshstrndx.c
-@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst)
- if (elf->map_address != NULL
- && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
-- || (((size_t) ((char *) elf->map_address + offset))
-+ || (((size_t) ((char *) elf->map_address
-+ + elf->start_offset + offset))
- & (__alignof__ (Elf32_Shdr) - 1)) == 0))
-+ {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (offset + sizeof (Elf32_Shdr)
-+ > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ result = -1;
-+ goto out;
-+ }
-+
- /* We can directly access the memory. */
-- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
-+ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
-+ + offset))->sh_link;
-+ }
- else
- {
- /* We avoid reading in all the section headers. Just read
-@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst)
- if (elf->map_address != NULL
- && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- && (ALLOW_UNALIGNED
-- || (((size_t) ((char *) elf->map_address + offset))
-+ || (((size_t) ((char *) elf->map_address
-+ + elf->start_offset + offset))
- & (__alignof__ (Elf64_Shdr) - 1)) == 0))
-+ {
-+ /* First see whether the information in the ELF header is
-+ valid and it does not ask for too much. */
-+ if (unlikely (offset + sizeof (Elf64_Shdr)
-+ > elf->maximum_size))
-+ {
-+ /* Something is wrong. */
-+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+ result = -1;
-+ goto out;
-+ }
-+
- /* We can directly access the memory. */
-- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
-+ num = ((Elf64_Shdr *) (elf->map_address
-+ + elf->start_offset + offset))->sh_link;
-+ }
- else
- {
- /* We avoid reading in all the section headers. Just read
---- elfutils-0.122/libelf/elf_newscn.c
-+++ elfutils-0.122/libelf/elf_newscn.c
-@@ -104,10 +104,18 @@ elf_newscn (elf)
- else
- {
- /* We must allocate a new element. */
-- Elf_ScnList *newp;
-+ Elf_ScnList *newp = NULL;
-
- assert (elf->state.elf.scnincr > 0);
-
-+ if (
-+#if SIZE_MAX <= 4294967295U
-+ likely (elf->state.elf.scnincr
-+ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
-+#else
-+ 1
-+#endif
-+ )
- newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
- + ((elf->state.elf.scnincr *= 2)
- * sizeof (Elf_Scn)), 1);
---- elfutils-0.122/libelf/gelf_getdyn.c
-+++ elfutils-0.122/libelf/gelf_getdyn.c
-@@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst)
- table entries has to be adopted. The user better has provided
- a buffer where we can store the information. While copying the
- data we are converting the format. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Dyn)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst)
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, GElf_Dyn)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_getlib.c
-+++ elfutils-0.122/libelf/gelf_getlib.c
-@@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst)
- /* The data is already in the correct form. Just make sure the
- index is OK. */
- GElf_Lib *result = NULL;
-- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
-+ if (INVALID_NDX (ndx, GElf_Lib)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- else
- {
---- elfutils-0.122/libelf/gelf_getmove.c
-+++ elfutils-0.122/libelf/gelf_getmove.c
-@@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst)
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
-+ if (INVALID_NDX (ndx, GElf_Move)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_getrela.c
-+++ elfutils-0.122/libelf/gelf_getrela.c
-@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst)
- if (data_scn == NULL)
- return NULL;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return NULL;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_RELA))
- {
- __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst)
- if (scn->elf->class == ELFCLASS32)
- {
- /* We have to convert the data. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Rela)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- result = NULL;
-@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst)
- {
- /* Simply copy the data after we made sure we are actually getting
- correct data. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Rela)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- result = NULL;
---- elfutils-0.122/libelf/gelf_getrel.c
-+++ elfutils-0.122/libelf/gelf_getrel.c
-@@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst)
- if (data_scn == NULL)
- return NULL;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return NULL;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_REL))
- {
- __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst)
- if (scn->elf->class == ELFCLASS32)
- {
- /* We have to convert the data. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Rel)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- result = NULL;
-@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst)
- {
- /* Simply copy the data after we made sure we are actually getting
- correct data. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Rel)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- result = NULL;
---- elfutils-0.122/libelf/gelf_getsym.c
-+++ elfutils-0.122/libelf/gelf_getsym.c
-@@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst)
- table entries has to be adopted. The user better has provided
- a buffer where we can store the information. While copying the
- data we are converting the format. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
-+ if (INVALID_NDX (ndx, Elf32_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst)
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
-+ if (INVALID_NDX (ndx, GElf_Sym)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_getsyminfo.c
-+++ elfutils-0.122/libelf/gelf_getsyminfo.c
-@@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst)
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
-+ if (INVALID_NDX (ndx, GElf_Syminfo)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_getsymshndx.c
-+++ elfutils-0.122/libelf/gelf_getsymshndx.c
-@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd
- section index table. */
- if (likely (shndxdata_scn != NULL))
- {
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Word)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Word)
-+ > shndxdata_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
- table entries has to be adopted. The user better has provided
- a buffer where we can store the information. While copying the
- data we are converting the format. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
-+ if (INVALID_NDX (ndx, Elf32_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
-+ if (INVALID_NDX (ndx, GElf_Sym)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_getversym.c
-+++ elfutils-0.122/libelf/gelf_getversym.c
-@@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst)
-
- /* The data is already in the correct form. Just make sure the
- index is OK. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
-+ if (INVALID_NDX (ndx, GElf_Versym)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- result = NULL;
---- elfutils-0.122/libelf/gelf_update_dyn.c
-+++ elfutils-0.122/libelf/gelf_update_dyn.c
-@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src)
- if (data == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_DYN))
- {
- /* The type of the data better should match. */
-@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src)
- }
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Dyn)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src)
- else
- {
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Dyn)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_lib.c
-+++ elfutils-0.122/libelf/gelf_update_lib.c
-@@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src)
- if (data == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
- if (unlikely (data_scn->d.d_type != ELF_T_LIB))
- {
-@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src)
-
- /* Check whether we have to resize the data buffer. */
- int result = 0;
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Lib)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- else
- {
---- elfutils-0.122/libelf/gelf_update_move.c
-+++ elfutils-0.122/libelf/gelf_update_move.c
-@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src)
- assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely (ndx < 0)
-+ if (INVALID_NDX (ndx, GElf_Move)
- || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.122/libelf/gelf_update_rela.c
-+++ elfutils-0.122/libelf/gelf_update_rela.c
-@@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
- if (dst == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_RELA))
- {
- /* The type of the data better should match. */
-@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
- }
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Rela)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
- else
- {
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Rela)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_rel.c
-+++ elfutils-0.122/libelf/gelf_update_rel.c
-@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
- if (dst == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_REL))
- {
- /* The type of the data better should match. */
-@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
- }
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Rel)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
- else
- {
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Rel)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_sym.c
-+++ elfutils-0.122/libelf/gelf_update_sym.c
-@@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src)
- if (data == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_SYM))
- {
- /* The type of the data better should match. */
-@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src)
- }
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src)
- else
- {
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_syminfo.c
-+++ elfutils-0.122/libelf/gelf_update_syminfo.c
-@@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src)
- if (data == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
- {
- /* The type of the data better should match. */
-@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src)
- rwlock_wrlock (scn->elf->lock);
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
-+ if (INVALID_NDX (ndx, GElf_Syminfo)
-+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_symshndx.c
-+++ elfutils-0.122/libelf/gelf_update_symshndx.c
-@@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata
- if (symdata == NULL)
- return 0;
-
-- if (unlikely (ndx < 0))
-- {
-- __libelf_seterrno (ELF_E_INVALID_INDEX);
-- return 0;
-- }
--
- if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
- {
- /* The type of the data better should match. */
-@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata
- }
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf32_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
-@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata
- else
- {
- /* Check whether we have to resize the data buffer. */
-- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
-+ if (INVALID_NDX (ndx, Elf64_Sym)
-+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
- goto out;
---- elfutils-0.122/libelf/gelf_update_versym.c
-+++ elfutils-0.122/libelf/gelf_update_versym.c
-@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src)
- assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
-
- /* Check whether we have to resize the data buffer. */
-- if (unlikely (ndx < 0)
-+ if (INVALID_NDX (ndx, GElf_Versym)
- || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
- {
- __libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.122/libelf/libelfP.h
-+++ elfutils-0.122/libelf/libelfP.h
-@@ -558,4 +558,13 @@ extern uint32_t __libelf_crc32 (uint32_t
- } \
- } while (0)
-
-+/* Convenience macro. Assumes int NDX and TYPE with size at least
-+ 2 bytes. */
-+#if SIZE_MAX > 4294967295U
-+# define INVALID_NDX(ndx, type) unlikely (ndx < 0)
-+#else
-+# define INVALID_NDX(ndx, type) \
-+ unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type))
-+#endif
-+
- #endif /* libelfP.h */
---- elfutils-0.122/src/elflint.c
-+++ elfutils-0.122/src/elflint.c
-@@ -123,6 +123,9 @@ static uint32_t shstrndx;
- /* Array to count references in section groups. */
- static int *scnref;
-
-+/* Number of sections. */
-+static unsigned int shnum;
-+
-
- int
- main (int argc, char *argv[])
-@@ -312,10 +315,19 @@ section_name (Ebl *ebl, int idx)
- {
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr;
-+ const char *ret;
-+
-+ if ((unsigned int) idx > shnum)
-+ return "<invalid>";
-
- shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
-+ if (shdr == NULL)
-+ return "<invalid>";
-
-- return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+ ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+ if (ret == NULL)
-+ return "<invalid>";
-+ return ret;
- }
-
-
-@@ -337,10 +349,6 @@ static const int valid_e_machine[] =
- (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
-
-
--/* Number of sections. */
--static unsigned int shnum;
--
--
- static void
- check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
- {
-@@ -603,7 +611,8 @@ section [%2d] '%s': symbol table cannot
- }
- }
-
-- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
-+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
-+ if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext ("\
- section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"),
- cnt, section_name (ebl, cnt));
-@@ -641,7 +650,7 @@ section [%2d] '%s': XINDEX for zeroth en
- xndxscnidx, section_name (ebl, xndxscnidx));
- }
-
-- for (cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+ for (cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
- {
- sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
- if (sym == NULL)
-@@ -659,7 +668,8 @@ section [%2d] '%s': symbol %zu: invalid
- else
- {
- name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
-- assert (name != NULL);
-+ assert (name != NULL
-+ || strshdr->sh_type != SHT_STRTAB);
- }
-
- if (sym->st_shndx == SHN_XINDEX)
-@@ -968,9 +978,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
- {
- GElf_Shdr rcshdr_mem;
- const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
-- assert (rcshdr != NULL);
-
-- if (rcshdr->sh_type == SHT_DYNAMIC)
-+ if (rcshdr == NULL)
-+ break;
-+
-+ if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
- {
- /* Found the dynamic section. Look through it. */
- Elf_Data *d = elf_getdata (scn, NULL);
-@@ -980,7 +992,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
- {
- GElf_Dyn dyn_mem;
- GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
-- assert (dyn != NULL);
-+
-+ if (dyn == NULL)
-+ break;
-
- if (dyn->d_tag == DT_RELCOUNT)
- {
-@@ -994,7 +1008,9 @@ section [%2d] '%s': DT_RELCOUNT used for
- /* Does the number specified number of relative
- relocations exceed the total number of
- relocations? */
-- if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
-+ if (shdr->sh_entsize != 0
-+ && 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, idx),
-@@ -1154,7 +1170,8 @@ section [%2d] '%s': no relocations for m
- }
- }
-
-- if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
-+ size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
-+ if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext (reltype == ELF_T_RELA ? "\
- section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
- section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
-@@ -1376,7 +1393,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
- Elf_Data *symdata = elf_getdata (symscn, NULL);
- enum load_state state = state_undecided;
-
-- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
-+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
- {
- GElf_Rela rela_mem;
- GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
-@@ -1426,7 +1444,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
- Elf_Data *symdata = elf_getdata (symscn, NULL);
- enum load_state state = state_undecided;
-
-- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
-+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
- {
- GElf_Rel rel_mem;
- GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
-@@ -1528,7 +1547,8 @@ section [%2d] '%s': referenced as string
- 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))
-+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
-+ if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext ("\
- section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
- idx, section_name (ebl, idx));
-@@ -1538,7 +1558,7 @@ section [%2d] '%s': section entry size d
- idx, section_name (ebl, idx));
-
- bool non_null_warned = false;
-- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
- {
- GElf_Dyn dyn_mem;
- GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
-@@ -1756,6 +1776,8 @@ section [%2d] '%s': entry size does not
- idx, section_name (ebl, idx));
-
- if (symshdr != NULL
-+ && shdr->sh_entsize
-+ && symshdr->sh_entsize
- && (shdr->sh_size / shdr->sh_entsize
- < symshdr->sh_size / symshdr->sh_entsize))
- ERROR (gettext ("\
-@@ -1782,6 +1804,12 @@ section [%2d] '%s': extended section ind
- }
-
- Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
-+ if (data == NULL)
-+ {
-+ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
-+ idx, section_name (ebl, idx));
-+ return;
-+ }
-
- if (*((Elf32_Word *) data->d_buf) != 0)
- ERROR (gettext ("symbol 0 should have zero extended section index\n"));
-@@ -1824,7 +1852,7 @@ section [%2d] '%s': hash table section i
-
- size_t maxidx = nchain;
-
-- if (symshdr != NULL)
-+ if (symshdr != NULL && symshdr->sh_entsize != 0)
- {
- size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
-
-@@ -1835,18 +1863,28 @@ section [%2d] '%s': hash table section i
- maxidx = symsize;
- }
-
-+ Elf32_Word *buf = (Elf32_Word *) data->d_buf;
-+ Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
- size_t cnt;
- for (cnt = 2; cnt < 2 + nbucket; ++cnt)
-- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
-- ERROR (gettext ("\
-+ {
-+ if (buf + cnt >= end)
-+ break;
-+ else if (buf[cnt] >= maxidx)
-+ ERROR (gettext ("\
- section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
-- idx, section_name (ebl, idx), cnt - 2);
-+ idx, section_name (ebl, idx), cnt - 2);
-+ }
-
- for (; cnt < 2 + nbucket + nchain; ++cnt)
-- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
-- ERROR (gettext ("\
-+ {
-+ if (buf + cnt >= end)
-+ break;
-+ else if (buf[cnt] >= maxidx)
-+ ERROR (gettext ("\
- section [%2d] '%s': hash chain reference %zu out of bounds\n"),
-- idx, section_name (ebl, idx), cnt - 2 - nbucket);
-+ idx, section_name (ebl, idx), cnt - 2 - nbucket);
-+ }
- }
-
-
-@@ -1876,18 +1914,28 @@ section [%2d] '%s': hash table section i
- maxidx = symsize;
- }
-
-+ Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
-+ Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
- size_t cnt;
- for (cnt = 2; cnt < 2 + nbucket; ++cnt)
-- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
-- ERROR (gettext ("\
-+ {
-+ if (buf + cnt >= end)
-+ break;
-+ else if (buf[cnt] >= maxidx)
-+ ERROR (gettext ("\
- section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
-- idx, section_name (ebl, idx), cnt - 2);
-+ idx, section_name (ebl, idx), cnt - 2);
-+ }
-
- for (; cnt < 2 + nbucket + nchain; ++cnt)
-- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
-- ERROR (gettext ("\
-+ {
-+ if (buf + cnt >= end)
-+ break;
-+ else if (buf[cnt] >= maxidx)
-+ ERROR (gettext ("\
- section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
-- idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
-+ idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
-+ }
- }
-
-
-@@ -1912,7 +1960,7 @@ section [%2d] '%s': bitmask size not pow
- if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
- {
- ERROR (gettext ("\
--section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
-+section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
- idx, section_name (ebl, idx), (long int) shdr->sh_size,
- (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
- return;
-@@ -2430,8 +2478,9 @@ section [%2d] '%s' refers in sh_link to
-
- /* The number of elements in the version symbol table must be the
- same as the number of symbols. */
-- if (shdr->sh_size / shdr->sh_entsize
-- != symshdr->sh_size / symshdr->sh_entsize)
-+ if (shdr->sh_entsize && symshdr->sh_entsize
-+ && (shdr->sh_size / shdr->sh_entsize
-+ != 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, idx),
-@@ -3336,6 +3385,8 @@ phdr[%d]: no note entries defined for th
- return;
-
- char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz);
-+ if (notemem == NULL)
-+ return;
-
- /* ELF64 files often use note section entries in the 32-bit format.
- The p_align field is set to 8 in case the 64-bit format is used.
---- elfutils-0.122/src/readelf.c
-+++ elfutils-0.122/src/readelf.c
-@@ -958,6 +958,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
+--- elfutils-0.130/src/readelf.c.robustify
++++ elfutils-0.130/src/readelf.c
+@@ -1053,6 +1053,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
GElf_Sym sym_mem;
@@ -1099,7 +76,7 @@ src/
printf ((grpref[0] & GRP_COMDAT)
? ngettext ("\
\nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
-@@ -970,8 +972,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
+@@ -1065,8 +1067,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
data->d_size / sizeof (Elf32_Word) - 1),
elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
@@ -1110,7 +87,7 @@ src/
?: gettext ("<INVALID SYMBOL>"),
data->d_size / sizeof (Elf32_Word) - 1);
-@@ -1122,7 +1124,8 @@ static void
+@@ -1217,7 +1219,8 @@ static void
handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
{
int class = gelf_getclass (ebl->elf);
@@ -1120,7 +97,7 @@ src/
Elf_Data *data;
size_t cnt;
size_t shstrndx;
-@@ -1137,6 +1140,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
+@@ -1232,6 +1235,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1132,7 +109,7 @@ src/
printf (ngettext ("\
\nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1146,9 +1154,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
+@@ -1241,9 +1249,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(int) shdr->sh_link,
@@ -1143,7 +120,7 @@ src/
fputs_unlocked (gettext (" Type Value\n"), stdout);
for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -1666,6 +1672,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
+@@ -1761,6 +1767,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1157,7 +134,7 @@ src/
/* Now we can compute the number of entries in the section. */
unsigned int nsyms = data->d_size / (class == ELFCLASS32
? sizeof (Elf32_Sym)
-@@ -1676,15 +1689,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
+@@ -1771,15 +1784,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
nsyms),
(unsigned int) elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
@@ -1174,7 +151,7 @@ src/
fputs_unlocked (class == ELFCLASS32
? gettext ("\
-@@ -1920,7 +1930,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
+@@ -2015,7 +2025,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1189,7 +166,7 @@ src/
printf (ngettext ("\
\nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1931,9 +1947,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
+@@ -2026,9 +2042,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1200,7 +177,7 @@ src/
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -1986,8 +2000,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
+@@ -2081,8 +2095,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
@@ -1216,7 +193,7 @@ src/
printf (ngettext ("\
\nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1999,9 +2019,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
+@@ -2094,9 +2114,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1227,7 +204,7 @@ src/
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2263,8 +2281,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
+@@ -2358,8 +2376,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
filename = NULL;
}
@@ -1243,7 +220,7 @@ src/
printf (ngettext ("\
\nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
"\
-@@ -2276,9 +2300,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
+@@ -2371,9 +2395,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1254,7 +231,7 @@ src/
/* Now we can finally look at the actual contents of this section. */
for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -2330,7 +2352,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
+@@ -2425,7 +2447,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
++counts[lengths[cnt]];
@@ -1273,7 +250,7 @@ src/
printf (ngettext ("\
\nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -2343,9 +2375,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
+@@ -2438,9 +2470,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
@@ -1284,7 +261,7 @@ src/
if (extrastr != NULL)
fputs (extrastr, stdout);
-@@ -3654,6 +3684,16 @@ print_debug_aranges_section (Ebl *ebl __
+@@ -3834,6 +3864,16 @@ print_debug_aranges_section (Dwfl_Module
return;
}
@@ -1301,9 +278,9 @@ src/
printf (ngettext ("\
\nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n",
"\
---- elfutils-0.122/src/strip.c
-+++ elfutils-0.122/src/strip.c
-@@ -412,6 +412,7 @@ handle_elf (int fd, Elf *elf, const char
+--- elfutils-0.128/src/strip.c.orig
++++ elfutils-0.128/src/strip.c
+@@ -413,6 +413,7 @@ handle_elf (int fd, Elf *elf, const char
Elf_Data debuglink_crc_data;
bool any_symtab_changes = false;
Elf_Data *shstrtab_data = NULL;
@@ -1311,7 +288,7 @@ src/
/* Create the full name of the file. */
if (prefix != NULL)
-@@ -542,6 +543,11 @@ handle_elf (int fd, Elf *elf, const char
+@@ -543,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char
goto fail_close;
}
@@ -1323,7 +300,7 @@ src/
/* Storage for section information. We leave room for two more
entries since we unconditionally create a section header string
table. Maybe some weird tool created an ELF file without one.
-@@ -563,7 +569,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -564,7 +570,7 @@ handle_elf (int fd, Elf *elf, const char
{
/* This should always be true (i.e., there should not be any
holes in the numbering). */
@@ -1332,7 +309,7 @@ src/
shdr_info[cnt].scn = scn;
-@@ -576,6 +582,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -577,6 +583,7 @@ handle_elf (int fd, Elf *elf, const char
shdr_info[cnt].shdr.sh_name);
if (shdr_info[cnt].name == NULL)
{
@@ -1340,7 +317,7 @@ src/
error (0, 0, gettext ("illformed file '%s'"), fname);
goto fail_close;
}
-@@ -585,6 +592,8 @@ handle_elf (int fd, Elf *elf, const char
+@@ -586,6 +593,8 @@ handle_elf (int fd, Elf *elf, const char
/* Remember the shdr.sh_link value. */
shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
@@ -1349,7 +326,7 @@ src/
/* Sections in files other than relocatable object files which
are not loaded can be freely moved by us. In relocatable
-@@ -597,7 +606,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -598,7 +607,7 @@ handle_elf (int fd, Elf *elf, const char
appropriate reference. */
if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
{
@@ -1358,7 +335,7 @@ src/
shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
-@@ -614,7 +623,12 @@ handle_elf (int fd, Elf *elf, const char
+@@ -615,7 +624,12 @@ handle_elf (int fd, Elf *elf, const char
for (inner = 1;
inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
++inner)
@@ -1371,7 +348,7 @@ src/
if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
/* If the section group contains only one element and this
-@@ -625,7 +639,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -626,7 +640,7 @@ handle_elf (int fd, Elf *elf, const char
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
{
@@ -1380,7 +357,7 @@ src/
shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
}
-@@ -633,7 +647,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -634,7 +648,7 @@ handle_elf (int fd, Elf *elf, const char
discarded right away. */
if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
{
@@ -1389,7 +366,7 @@ src/
if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
{
-@@ -708,11 +722,15 @@ handle_elf (int fd, Elf *elf, const char
+@@ -709,11 +723,15 @@ handle_elf (int fd, Elf *elf, const char
{
/* If a relocation section is marked as being removed make
sure the section it is relocating is removed, too. */
@@ -1407,7 +384,7 @@ src/
if (shdr_info[cnt].idx == 1)
{
-@@ -737,7 +755,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -738,7 +756,7 @@ handle_elf (int fd, Elf *elf, const char
if (shdr_info[cnt].symtab_idx != 0
&& shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
{
@@ -1416,7 +393,7 @@ src/
shdr_info[shdr_info[cnt].symtab_idx].data
= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
-@@ -777,6 +795,9 @@ handle_elf (int fd, Elf *elf, const char
+@@ -778,6 +796,9 @@ handle_elf (int fd, Elf *elf, const char
else if (scnidx == SHN_XINDEX)
scnidx = xndx;
@@ -1426,7 +403,7 @@ src/
if (shdr_info[scnidx].idx == 0)
{
/* Mark this section as used. */
-@@ -808,12 +829,16 @@ handle_elf (int fd, Elf *elf, const char
+@@ -809,12 +830,16 @@ handle_elf (int fd, Elf *elf, const char
}
/* Handle references through sh_info. */
@@ -1445,7 +422,7 @@ src/
/* Mark the section as investigated. */
shdr_info[cnt].idx = 2;
-@@ -912,7 +937,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -953,7 +978,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
elf_errmsg (-1));
@@ -1454,7 +431,7 @@ src/
/* Add this name to the section header string table. */
shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
-@@ -949,7 +974,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -990,7 +1015,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
@@ -1463,7 +440,7 @@ src/
shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
if (shdr_info[cnt].data == NULL)
-@@ -980,7 +1005,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1021,7 +1046,7 @@ handle_elf (int fd, Elf *elf, const char
}
/* Index of the section header table in the shdr_info array. */
@@ -1472,7 +449,7 @@ src/
/* Add the section header string table section name. */
shdr_info[cnt].se = ebl_strtabadd (shst, ".shstrtab", 10);
-@@ -1005,7 +1030,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1046,7 +1071,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
@@ -1481,7 +458,7 @@ src/
/* Finalize the string table and fill in the correct indices in the
section headers. */
-@@ -1095,20 +1120,20 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1136,20 +1161,20 @@ handle_elf (int fd, Elf *elf, const char
shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
NULL);
@@ -1505,7 +482,7 @@ src/
>= shdr_info[cnt].data->d_size / elsize);
}
-@@ -1163,7 +1188,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1204,7 +1229,7 @@ handle_elf (int fd, Elf *elf, const char
sec = shdr_info[sym->st_shndx].idx;
else
{
@@ -1514,7 +491,7 @@ src/
sec = shdr_info[xshndx].idx;
}
-@@ -1184,7 +1209,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1225,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char
nxshndx = sec;
}
@@ -1523,7 +500,7 @@ src/
if ((inner != destidx || nshndx != sym->st_shndx
|| (shndxdata != NULL && nxshndx != xshndx))
-@@ -1207,7 +1232,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1248,7 +1273,7 @@ handle_elf (int fd, Elf *elf, const char
else
/* This is a section symbol for a section which has
been removed. */
@@ -1532,7 +509,7 @@ src/
}
if (destidx != inner)
-@@ -1371,11 +1396,11 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1441,11 +1466,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
@@ -1546,7 +523,7 @@ src/
size_t hidx = elf_hash (name) % nbucket;
if (bucket[hidx] == 0)
-@@ -1394,7 +1419,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1464,7 +1489,7 @@ handle_elf (int fd, Elf *elf, const char
else
{
/* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
@@ -1555,7 +532,7 @@ src/
== sizeof (Elf64_Xword));
Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
-@@ -1428,11 +1453,11 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1495,11 +1520,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
@@ -1569,3 +546,1009 @@ src/
size_t hidx = elf_hash (name) % nbucket;
if (bucket[hidx] == 0)
+--- elfutils-0.130/src/elflint.c.robustify
++++ elfutils-0.130/src/elflint.c
+@@ -126,6 +126,9 @@ static uint32_t shstrndx;
+ /* Array to count references in section groups. */
+ static int *scnref;
+
++/* Number of sections. */
++static unsigned int shnum;
++
+
+ int
+ main (int argc, char *argv[])
+@@ -315,10 +318,19 @@ section_name (Ebl *ebl, int idx)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr;
++ const char *ret;
++
++ if ((unsigned int) idx > shnum)
++ return "<invalid>";
+
+ shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
++ if (shdr == NULL)
++ return "<invalid>";
+
+- return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++ ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++ if (ret == NULL)
++ return "<invalid>";
++ return ret;
+ }
+
+
+@@ -340,10 +352,6 @@ static const int valid_e_machine[] =
+ (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
+
+
+-/* Number of sections. */
+-static unsigned int shnum;
+-
+-
+ static void
+ check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
+ {
+@@ -606,7 +614,8 @@ section [%2d] '%s': symbol table cannot
+ }
+ }
+
+- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext ("\
+ section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"),
+ cnt, section_name (ebl, cnt));
+@@ -644,7 +653,7 @@ section [%2d] '%s': XINDEX for zeroth en
+ xndxscnidx, section_name (ebl, xndxscnidx));
+ }
+
+- for (cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ for (cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
+ if (sym == NULL)
+@@ -662,7 +671,8 @@ section [%2d] '%s': symbol %zu: invalid
+ else
+ {
+ name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
+- assert (name != NULL);
++ assert (name != NULL
++ || strshdr->sh_type != SHT_STRTAB);
+ }
+
+ if (sym->st_shndx == SHN_XINDEX)
+@@ -992,9 +1002,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
+ {
+ GElf_Shdr rcshdr_mem;
+ const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
+- assert (rcshdr != NULL);
+
+- if (rcshdr->sh_type == SHT_DYNAMIC)
++ if (rcshdr == NULL)
++ break;
++
++ if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
+ {
+ /* Found the dynamic section. Look through it. */
+ Elf_Data *d = elf_getdata (scn, NULL);
+@@ -1004,7 +1016,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
+ {
+ GElf_Dyn dyn_mem;
+ GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
+- assert (dyn != NULL);
++
++ if (dyn == NULL)
++ break;
+
+ if (dyn->d_tag == DT_RELCOUNT)
+ {
+@@ -1018,7 +1032,9 @@ section [%2d] '%s': DT_RELCOUNT used for
+ /* Does the number specified number of relative
+ relocations exceed the total number of
+ relocations? */
+- if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
++ if (shdr->sh_entsize != 0
++ && 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, idx),
+@@ -1178,7 +1194,8 @@ section [%2d] '%s': no relocations for m
+ }
+ }
+
+- if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
++ size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext (reltype == ELF_T_RELA ? "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
+@@ -1401,7 +1418,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ enum load_state state = state_undecided;
+
+- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
++ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Rela rela_mem;
+ GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
+@@ -1451,7 +1469,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ enum load_state state = state_undecided;
+
+- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
++ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Rel rel_mem;
+ GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
+@@ -1555,7 +1574,8 @@ section [%2d] '%s': referenced as string
+ 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))
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext ("\
+ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
+ idx, section_name (ebl, idx));
+@@ -1565,7 +1585,7 @@ section [%2d] '%s': section entry size d
+ idx, section_name (ebl, idx));
+
+ bool non_null_warned = false;
+- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Dyn dyn_mem;
+ GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
+@@ -1846,6 +1866,8 @@ section [%2d] '%s': entry size does not
+ idx, section_name (ebl, idx));
+
+ if (symshdr != NULL
++ && shdr->sh_entsize
++ && symshdr->sh_entsize
+ && (shdr->sh_size / shdr->sh_entsize
+ < symshdr->sh_size / symshdr->sh_entsize))
+ ERROR (gettext ("\
+@@ -1872,6 +1894,12 @@ section [%2d] '%s': extended section ind
+ }
+
+ Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
++ if (data == NULL)
++ {
++ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
++ idx, section_name (ebl, idx));
++ return;
++ }
+
+ if (*((Elf32_Word *) data->d_buf) != 0)
+ ERROR (gettext ("symbol 0 should have zero extended section index\n"));
+@@ -1914,7 +1942,7 @@ section [%2d] '%s': hash table section i
+
+ size_t maxidx = nchain;
+
+- if (symshdr != NULL)
++ if (symshdr != NULL && symshdr->sh_entsize != 0)
+ {
+ size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
+
+@@ -1925,18 +1953,28 @@ section [%2d] '%s': hash table section i
+ maxidx = symsize;
+ }
+
++ Elf32_Word *buf = (Elf32_Word *) data->d_buf;
++ Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
+ size_t cnt;
+ for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2);
++ }
+
+ for (; cnt < 2 + nbucket + nchain; ++cnt)
+- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2 - nbucket);
++ }
+ }
+
+
+@@ -1966,18 +2004,28 @@ section [%2d] '%s': hash table section i
+ maxidx = symsize;
+ }
+
++ Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
++ Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
+ size_t cnt;
+ for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2);
++ }
+
+ for (; cnt < 2 + nbucket + nchain; ++cnt)
+- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
+- idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
++ idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
++ }
+ }
+
+
+@@ -2002,7 +2050,7 @@ section [%2d] '%s': bitmask size not pow
+ if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
+ {
+ ERROR (gettext ("\
+-section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
++section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
+ idx, section_name (ebl, idx), (long int) shdr->sh_size,
+ (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
+ return;
+@@ -2659,8 +2707,9 @@ section [%2d] '%s' refers in sh_link to
+
+ /* The number of elements in the version symbol table must be the
+ same as the number of symbols. */
+- if (shdr->sh_size / shdr->sh_entsize
+- != symshdr->sh_size / symshdr->sh_entsize)
++ if (shdr->sh_entsize && symshdr->sh_entsize
++ && (shdr->sh_size / shdr->sh_entsize
++ != 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, idx),
+--- elfutils-0.127/libelf/elf_begin.c.robustify
++++ elfutils-0.127/libelf/elf_begin.c
+@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c
+
+ if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
+ {
+- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
++ if (unlikely (ehdr.e32->e_shoff >= maxsize)
++ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize))
+ /* Cannot read the first section header. */
+ return 0;
+
+@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c
+
+ if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
+ {
+- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
++ if (unlikely (ehdr.e64->e_shoff >= maxsize)
++ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
+ /* Cannot read the first section header. */
+ return 0;
+
+@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add
+ /* Could not determine the number of sections. */
+ return NULL;
+
++ /* Check for too many sections. */
++ if (e_ident[EI_CLASS] == ELFCLASS32)
++ {
++ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
++ return NULL;
++ }
++ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
++ return NULL;
++
+ /* We can now allocate the memory. */
+ Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
+ ELF_K_ELF, scncnt * sizeof (Elf_Scn));
+@@ -308,13 +319,31 @@ file_read_elf (int fildes, void *map_add
+ {
+ /* We can use the mmapped memory. */
+ elf->state.elf32.ehdr = ehdr;
++
++ if (unlikely (ehdr->e_shoff >= maxsize)
++ || unlikely (ehdr->e_shoff
++ + scncnt * sizeof (Elf32_Shdr) > maxsize))
++ {
++ free_and_out:
++ free (elf);
++ __libelf_seterrno (ELF_E_INVALID_FILE);
++ return NULL;
++ }
+ elf->state.elf32.shdr
+ = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
++
+ if (ehdr->e_phnum > 0)
++ {
+ /* Assign a value only if there really is a program
+ header. Otherwise the value remains NULL. */
++ if (unlikely (ehdr->e_phoff >= maxsize)
++ || unlikely (ehdr->e_phoff
++ + ehdr->e_phnum
++ * sizeof (Elf32_Phdr) > maxsize))
++ goto free_and_out;
+ elf->state.elf32.phdr
+ = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff);
++ }
+
+ for (size_t cnt = 0; cnt < scncnt; ++cnt)
+ {
+@@ -383,13 +412,26 @@ file_read_elf (int fildes, void *map_add
+ {
+ /* We can use the mmapped memory. */
+ elf->state.elf64.ehdr = ehdr;
++
++ if (unlikely (ehdr->e_shoff >= maxsize)
++ || unlikely (ehdr->e_shoff
++ + scncnt * sizeof (Elf32_Shdr) > maxsize))
++ goto free_and_out;
+ elf->state.elf64.shdr
+ = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
++
+ if (ehdr->e_phnum > 0)
++ {
+ /* Assign a value only if there really is a program
+ header. Otherwise the value remains NULL. */
++ if (unlikely (ehdr->e_phoff >= maxsize)
++ || unlikely (ehdr->e_phoff
++ + ehdr->e_phnum
++ * sizeof (Elf32_Phdr) > maxsize))
++ goto free_and_out;
+ elf->state.elf64.phdr
+ = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
++ }
+
+ for (size_t cnt = 0; cnt < scncnt; ++cnt)
+ {
+--- elfutils-0.127/libelf/libelfP.h.robustify
++++ elfutils-0.127/libelf/libelfP.h
+@@ -574,4 +574,13 @@ extern uint32_t __libelf_crc32 (uint32_t
+ } \
+ } while (0)
+
++/* Convenience macro. Assumes int NDX and TYPE with size at least
++ 2 bytes. */
++#if SIZE_MAX > 4294967295U
++# define INVALID_NDX(ndx, type) unlikely (ndx < 0)
++#else
++# define INVALID_NDX(ndx, type) \
++ unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type))
++#endif
++
+ #endif /* libelfP.h */
+--- elfutils-0.127/libelf/gelf_update_move.c.robustify
++++ elfutils-0.127/libelf/gelf_update_move.c
+@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src)
+ assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely (ndx < 0)
++ if (INVALID_NDX (ndx, GElf_Move)
+ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+--- elfutils-0.127/libelf/gelf_getsym.c.robustify
++++ elfutils-0.127/libelf/gelf_getsym.c
+@@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst)
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst)
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Sym)
++ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_getrela.c.robustify
++++ elfutils-0.127/libelf/gelf_getrela.c
+@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst)
+ if (data_scn == NULL)
+ return NULL;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return NULL;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst)
+ if (scn->elf->class == ELFCLASS32)
+ {
+ /* We have to convert the data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rela)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst)
+ {
+ /* Simply copy the data after we made sure we are actually getting
+ correct data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rela)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+--- elfutils-0.127/libelf/gelf_getmove.c.robustify
++++ elfutils-0.127/libelf/gelf_getmove.c
+@@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst)
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Move)
++ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_update_symshndx.c.robustify
++++ elfutils-0.127/libelf/gelf_update_symshndx.c
+@@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata
+ if (symdata == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
+ {
+ /* The type of the data better should match. */
+@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_update_dyn.c.robustify
++++ elfutils-0.127/libelf/gelf_update_dyn.c
+@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src)
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_DYN))
+ {
+ /* The type of the data better should match. */
+@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src)
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Dyn)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src)
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Dyn)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_update_rela.c.robustify
++++ elfutils-0.127/libelf/gelf_update_rela.c
+@@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ if (dst == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+ {
+ /* The type of the data better should match. */
+@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rela)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rela)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_getsymshndx.c.robustify
++++ elfutils-0.127/libelf/gelf_getsymshndx.c
+@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd
+ section index table. */
+ if (likely (shndxdata_scn != NULL))
+ {
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Word)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Word)
++ > shndxdata_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
++ if (INVALID_NDX (ndx, GElf_Sym)
++ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/elf32_newphdr.c.robustify
++++ elfutils-0.127/libelf/elf32_newphdr.c
+@@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
+ else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count
+ || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
+ {
++ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
++ {
++ result = NULL;
++ goto out;
++ }
++
+ /* Allocate a new program header with the appropriate number of
+ elements. */
+ result = (ElfW2(LIBELFBITS,Phdr) *)
+--- elfutils-0.127/libelf/gelf_update_sym.c.robustify
++++ elfutils-0.127/libelf/gelf_update_sym.c
+@@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src)
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_SYM))
+ {
+ /* The type of the data better should match. */
+@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src)
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src)
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Sym)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_getsyminfo.c.robustify
++++ elfutils-0.127/libelf/gelf_getsyminfo.c
+@@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst)
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Syminfo)
++ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_getlib.c.robustify
++++ elfutils-0.127/libelf/gelf_getlib.c
+@@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst)
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+ GElf_Lib *result = NULL;
+- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Lib)
++ || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ else
+ {
+--- elfutils-0.127/libelf/elf32_updatefile.c.robustify
++++ elfutils-0.127/libelf/elf32_updatefile.c
+@@ -201,6 +201,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
+ /* Write all the sections. Well, only those which are modified. */
+ if (shnum > 0)
+ {
++ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
++ return 1;
++
+ Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
+ Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
+ char *const shdr_start = ((char *) elf->map_address + elf->start_offset
+@@ -571,6 +574,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
+ /* Write all the sections. Well, only those which are modified. */
+ if (shnum > 0)
+ {
++ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
++ + sizeof (ElfW2(LIBELFBITS,Shdr)))))
++ return 1;
++
+ 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];
+--- elfutils-0.127/libelf/gelf_getversym.c.robustify
++++ elfutils-0.127/libelf/gelf_getversym.c
+@@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst)
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Versym)
++ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+--- elfutils-0.127/libelf/elf_getarsym.c.robustify
++++ elfutils-0.127/libelf/elf_getarsym.c
+@@ -179,6 +179,9 @@ elf_getarsym (elf, ptr)
+ size_t index_size = atol (tmpbuf);
+
+ if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
++#if SIZE_MAX <= 4294967295U
++ || n >= SIZE_MAX / sizeof (Elf_Arsym)
++#endif
+ || n * sizeof (uint32_t) > index_size)
+ {
+ /* This index table cannot be right since it does not fit into
+--- elfutils-0.127/libelf/gelf_getrel.c.robustify
++++ elfutils-0.127/libelf/gelf_getrel.c
+@@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst)
+ if (data_scn == NULL)
+ return NULL;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return NULL;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_REL))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst)
+ if (scn->elf->class == ELFCLASS32)
+ {
+ /* We have to convert the data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rel)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst)
+ {
+ /* Simply copy the data after we made sure we are actually getting
+ correct data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rel)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+--- elfutils-0.127/libelf/gelf_update_versym.c.robustify
++++ elfutils-0.127/libelf/gelf_update_versym.c
+@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src)
+ assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely (ndx < 0)
++ if (INVALID_NDX (ndx, GElf_Versym)
+ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+--- elfutils-0.127/libelf/gelf_getdyn.c.robustify
++++ elfutils-0.127/libelf/gelf_getdyn.c
+@@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst)
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Dyn)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst)
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Dyn)
++ || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_update_syminfo.c.robustify
++++ elfutils-0.127/libelf/gelf_update_syminfo.c
+@@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src)
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
+ {
+ /* The type of the data better should match. */
+@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src)
+ rwlock_wrlock (scn->elf->lock);
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Syminfo)
++ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/gelf_update_rel.c.robustify
++++ elfutils-0.127/libelf/gelf_update_rel.c
+@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ if (dst == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_REL))
+ {
+ /* The type of the data better should match. */
+@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rel)
++ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rel)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+--- elfutils-0.127/libelf/elf_newscn.c.robustify
++++ elfutils-0.127/libelf/elf_newscn.c
+@@ -104,10 +104,18 @@ elf_newscn (elf)
+ else
+ {
+ /* We must allocate a new element. */
+- Elf_ScnList *newp;
++ Elf_ScnList *newp = NULL;
+
+ assert (elf->state.elf.scnincr > 0);
+
++ if (
++#if SIZE_MAX <= 4294967295U
++ likely (elf->state.elf.scnincr
++ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
++#else
++ 1
++#endif
++ )
+ newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
+ + ((elf->state.elf.scnincr *= 2)
+ * sizeof (Elf_Scn)), 1);
+--- elfutils-0.127/libelf/gelf_update_lib.c.robustify
++++ elfutils-0.127/libelf/gelf_update_lib.c
+@@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src)
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
+ if (unlikely (data_scn->d.d_type != ELF_T_LIB))
+ {
+@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src)
+
+ /* Check whether we have to resize the data buffer. */
+ int result = 0;
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Lib)
++ || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ else
+ {
+--- elfutils-0.127/libelf/elf_getshstrndx.c.robustify
++++ elfutils-0.127/libelf/elf_getshstrndx.c
+@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst)
+ if (elf->map_address != NULL
+ && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ && (ALLOW_UNALIGNED
+- || (((size_t) ((char *) elf->map_address + offset))
++ || (((size_t) ((char *) elf->map_address
++ + elf->start_offset + offset))
+ & (__alignof__ (Elf32_Shdr) - 1)) == 0))
++ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (offset + sizeof (Elf32_Shdr)
++ > elf->maximum_size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ result = -1;
++ goto out;
++ }
++
+ /* We can directly access the memory. */
+- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
++ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
++ + offset))->sh_link;
++ }
+ else
+ {
+ /* We avoid reading in all the section headers. Just read
+@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst)
+ if (elf->map_address != NULL
+ && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ && (ALLOW_UNALIGNED
+- || (((size_t) ((char *) elf->map_address + offset))
++ || (((size_t) ((char *) elf->map_address
++ + elf->start_offset + offset))
+ & (__alignof__ (Elf64_Shdr) - 1)) == 0))
++ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (offset + sizeof (Elf64_Shdr)
++ > elf->maximum_size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ result = -1;
++ goto out;
++ }
++
+ /* We can directly access the memory. */
+- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
++ num = ((Elf64_Shdr *) (elf->map_address
++ + elf->start_offset + offset))->sh_link;
++ }
+ else
+ {
+ /* We avoid reading in all the section headers. Just read
+--- elfutils-0.127/libelf/elf32_getshdr.c.robustify
++++ elfutils-0.127/libelf/elf32_getshdr.c
+@@ -101,7 +101,8 @@ elfw2(LIBELFBITS,getshdr) (scn)
+ goto out;
+
+ size_t shnum;
+- if (INTUSE (elf_getshnum) (elf, &shnum) != 0)
++ if (INTUSE (elf_getshnum) (elf, &shnum) != 0
++ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
+ goto out;
+ size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
+
+@@ -118,6 +119,16 @@ elfw2(LIBELFBITS,getshdr) (scn)
+
+ if (elf->map_address != NULL)
+ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
++ || unlikely (ehdr->e_shoff + size > elf->maximum_size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ goto free_and_out;
++ }
++
+ ElfW2(LIBELFBITS,Shdr) *notcvt;
+
+ /* All the data is already mapped. If we could use it
+--- elfutils-0.127/libelf/elf32_getphdr.c.robustify
++++ elfutils-0.127/libelf/elf32_getphdr.c
+@@ -116,6 +116,16 @@ elfw2(LIBELFBITS,getphdr) (elf)
+
+ if (elf->map_address != NULL)
+ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
++ || unlikely (ehdr->e_phoff + size > elf->maximum_size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_PHDR);
++ goto out;
++ }
++
+ /* All the data is already mapped. Use it. */
+ void *file_phdr = ((char *) elf->map_address
+ + elf->start_offset + ehdr->e_phoff);
diff --git a/elfutils-strip-copy-symtab.patch b/elfutils-strip-copy-symtab.patch
index bf82405b..35cc6b87 100644
--- a/elfutils-strip-copy-symtab.patch
+++ b/elfutils-strip-copy-symtab.patch
@@ -14,7 +14,7 @@
} *shdr_info = NULL;
Elf_Scn *scn;
size_t cnt;
-@@ -826,8 +827,39 @@ handle_elf (int fd, Elf *elf, const char
+@@ -826,6 +827,37 @@ handle_elf (int fd, Elf *elf, const char
The ones that are not removed in the stripped file are SHT_NOBITS. */
if (debug_fname != NULL)
{
@@ -23,8 +23,8 @@
+ - libbfd isn't able to look up the .symtab/.strtab in the stripped
+ object instead. As a workaround, emit .symtab/.strtab in both
+ places. */
- for (cnt = 1; cnt < shnum; ++cnt)
- {
++ for (cnt = 1; cnt < shnum; ++cnt)
++ {
+ if (shdr_info[cnt].idx == 0
+ && (shdr_info[cnt].shdr.sh_type == SHT_REL
+ || shdr_info[cnt].shdr.sh_type == SHT_RELA)
@@ -49,22 +49,18 @@
+ }
+ }
+
-+ for (cnt = 1; cnt < shnum; ++cnt)
-+ {
+ for (cnt = 1; cnt < shnum; ++cnt)
+ {
scn = elf_newscn (debugelf);
- if (scn == NULL)
- error (EXIT_FAILURE, 0,
-@@ -835,7 +867,8 @@ handle_elf (int fd, Elf *elf, const char
+@@ -835,6 +867,7 @@ handle_elf (int fd, Elf *elf, const char
elf_errmsg (-1));
bool discard_section = (shdr_info[cnt].idx > 0
-- && cnt != ehdr->e_shstrndx);
-+ && cnt != ehdr->e_shstrndx
-+ && shdr_info[cnt].debug_data == NULL);
++ && shdr_info[cnt].debug_data == NULL
+ && shdr_info[cnt].shdr.sh_type != SHT_NOTE
+ && cnt != ehdr->e_shstrndx);
- /* Set the section header in the new file. */
- GElf_Shdr debugshdr = shdr_info[cnt].shdr;
-@@ -864,6 +897,13 @@ handle_elf (int fd, Elf *elf, const char
+@@ -865,6 +898,13 @@ handle_elf (int fd, Elf *elf, const char
*debugdata = *shdr_info[cnt].data;
if (discard_section)
debugdata->d_buf = NULL;
@@ -78,7 +74,7 @@
}
/* Finish the ELF header. Fill in the fields not handled by
-@@ -1055,7 +1095,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1056,7 +1096,7 @@ handle_elf (int fd, Elf *elf, const char
shdr_info[shdr_info[cnt].shdr.sh_info].idx;
/* Get the data from the old file if necessary. We already
@@ -87,7 +83,7 @@
if (cnt < shnum)
{
if (shdr_info[cnt].data == NULL)
-@@ -1264,6 +1304,13 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1283,6 +1323,13 @@ handle_elf (int fd, Elf *elf, const char
if (shdr_info[shdr_info[cnt].old_sh_link].newsymidx == NULL)
continue;
@@ -101,7 +97,7 @@
Elf32_Word *newsymidx
= shdr_info[shdr_info[cnt].old_sh_link].newsymidx;
Elf_Data *d = elf_getdata (shdr_info[cnt].idx == 0
-@@ -1322,6 +1369,13 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1341,6 +1388,13 @@ handle_elf (int fd, Elf *elf, const char
if (shdr_info[symtabidx].newsymidx == NULL)
continue;
@@ -115,7 +111,7 @@
assert (shdr_info[cnt].idx > 0);
/* The hash section in the new file. */
-@@ -1447,7 +1501,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1460,7 +1514,7 @@ handle_elf (int fd, Elf *elf, const char
chain[hidx] = inner;
}
}
@@ -124,7 +120,7 @@
}
else if (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym)
{
-@@ -1460,6 +1514,13 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1473,6 +1527,13 @@ handle_elf (int fd, Elf *elf, const char
if (shdr_info[symtabidx].newsymidx == NULL)
continue;
@@ -138,7 +134,7 @@
assert (shdr_info[cnt].idx > 0);
/* The symbol version section in the new file. */
-@@ -1504,20 +1565,27 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1515,20 +1576,27 @@ handle_elf (int fd, Elf *elf, const char
else if (shdr_info[cnt].shdr.sh_type == SHT_GROUP)
{
/* Check whether the associated symbol table changed. */
@@ -178,7 +174,7 @@
}
}
}
-@@ -1647,7 +1715,10 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1658,7 +1726,10 @@ handle_elf (int fd, Elf *elf, const char
table indices. */
if (any_symtab_changes)
for (cnt = 1; cnt <= shdridx; ++cnt)
@@ -190,9 +186,8 @@
/* Free the memory. */
if ((shnum + 2) * sizeof (struct shdr_info) > MAX_STACK_ALLOC)
-
---- elfutils-0.124/tests/run-strip-test5.sh.~1~
-+++ elfutils-0.124/tests/run-strip-test5.sh
+--- elfutils/tests/run-strip-test5.sh.~1~
++++ elfutils/tests/run-strip-test5.sh
@@ -1,5 +1,5 @@
original=testfile8
-stripped=testfile16
diff --git a/elfutils.spec b/elfutils.spec
index 853f0d61..08bd0e5f 100644
--- a/elfutils.spec
+++ b/elfutils.spec
@@ -1,4 +1,4 @@
-%define eu_version 0.126
+%define eu_version 0.131
%define eu_release 1
%if %{?_with_compat:1}%{!?_with_compat:0}
@@ -14,7 +14,7 @@
%define separate_devel_static 1
%endif
-Summary: A collection of utilities and DSOs to handle compiled objects.
+Summary: A collection of utilities and DSOs to handle compiled objects
Name: elfutils
Version: %{eu_version}
%if !%{compat}
@@ -22,22 +22,21 @@ Release: %{eu_release}%{?dist}
%else
Release: 0.%{eu_release}
%endif
-License: GPL
+License: GPLv2 with exceptions
Group: Development/Tools
Source: elfutils-%{version}.tar.gz
Patch1: elfutils-portability.patch
Patch2: elfutils-robustify.patch
Obsoletes: libelf libelf-devel
-Requires: elfutils-libelf = %{version}-%{release}
-Requires: elfutils-libs = %{version}-%{release}
+Requires: elfutils-libelf-%{_arch} = %{version}-%{release}
+Requires: elfutils-libs-%{_arch} = %{version}-%{release}
Patch0: elfutils-strip-copy-symtab.patch
Source2: testfile16.symtab.bz2
Source3: testfile16.symtab.debug.bz2
-# ExcludeArch: xxx
-BuildRoot: %{_tmppath}/%{name}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: bison >= 1.875
BuildRequires: flex >= 2.5.4a
BuildRequires: bzip2
@@ -64,11 +63,8 @@ symbols), readelf (to see the raw ELF file structures), and elflint
Summary: Libraries to handle compiled objects.
Group: Development/Tools
License: GPL
-Requires: elfutils-libelf = %{version}-%{release}
-Conflicts: elfutils < %{version}-%{release}
-Conflicts: elfutils > %{version}-%{release}
-Conflicts: elfutils-devel < %{version}-%{release}
-Conflicts: elfutils-devel > %{version}-%{release}
+Provides: elfutils-libs-%{_arch} = %{version}-%{release}
+Requires: elfutils-libelf-%{_arch} = %{version}-%{release}
%description libs
The elfutils-libs package contains libraries which implement DWARF, ELF,
@@ -80,12 +76,11 @@ other programs using these libraries.
Summary: Development libraries to handle compiled objects.
Group: Development/Tools
License: GPL
-Requires: elfutils-libs = %{version}-%{release}
-Requires: elfutils-libelf-devel = %{version}-%{release}
-Conflicts: elfutils-libelf-devel < %{version}-%{release}
-Conflicts: elfutils-libelf-devel > %{version}-%{release}
+Provides: elfutils-devel-%{_arch} = %{version}-%{release}
+Requires: elfutils-libs-%{_arch} = %{version}-%{release}
+Requires: elfutils-libelf-devel-%{_arch} = %{version}-%{release}
%if !0%{?separate_devel_static}
-Requires: elfutils-devel-static = %{version}-%{release}
+Requires: elfutils-devel-static-%{_arch} = %{version}-%{release}
%endif
%description devel
@@ -98,10 +93,9 @@ assembler interface.
%package devel-static
Summary: Static archives to handle compiled objects.
Group: Development/Tools
-Requires: elfutils-devel = %{version}-%{release}
-Conflicts: elfutils-devel < %{version}-%{release}
-Conflicts: elfutils-devel > %{version}-%{release}
-Requires: elfutils-libelf-devel-static = %{version}-%{release}
+Provides: elfutils-devel-static-%{_arch} = %{version}-%{release}
+Requires: elfutils-devel-%{_arch} = %{version}-%{release}
+Requires: elfutils-libelf-devel-static-%{_arch} = %{version}-%{release}
%description devel-static
The elfutils-devel-static package contains the static archives
@@ -110,12 +104,7 @@ with the code to handle compiled objects.
%package libelf
Summary: Library to read and write ELF files.
Group: Development/Tools
-Conflicts: elfutils < %{version}-%{release}
-Conflicts: elfutils > %{version}-%{release}
-Conflicts: elfutils-libs < %{version}-%{release}
-Conflicts: elfutils-libs > %{version}-%{release}
-Conflicts: elfutils-libelf-devel < %{version}-%{release}
-Conflicts: elfutils-libelf-devel > %{version}-%{release}
+Provides: elfutils-libelf-%{_arch} = %{version}-%{release}
%description libelf
The elfutils-libelf package provides a DSO which allows reading and
@@ -126,10 +115,11 @@ elfutils package use it also to generate new ELF files.
%package libelf-devel
Summary: Development support for libelf
Group: Development/Tools
-Requires: elfutils-libelf = %{version}-%{release}
+Provides: elfutils-libelf-devel-%{_arch} = %{version}-%{release}
+Requires: elfutils-libelf-%{_arch} = %{version}-%{release}
Conflicts: libelf-devel
%if !0%{?separate_devel_static}
-Requires: elfutils-libelf-devel-static = %{version}-%{release}
+Requires: elfutils-libelf-devel-static-%{_arch} = %{version}-%{release}
%endif
%description libelf-devel
@@ -141,19 +131,18 @@ different sections of an ELF file.
%package libelf-devel-static
Summary: Static archive of libelf
Group: Development/Tools
-Requires: elfutils-libelf-devel = %{version}-%{release}
-Conflicts: elfutils-libelf-devel < %{version}-%{release}
-Conflicts: elfutils-libelf-devel > %{version}-%{release}
+Provides: elfutils-libelf-devel-static-%{_arch} = %{version}-%{release}
+Requires: elfutils-libelf-devel-%{_arch} = %{version}-%{release}
%description libelf-devel-static
-The elfutils-libelf-devel-static package contains
-the static archive for libelf.
+The elfutils-libelf-static package contains the static archive
+for libelf.
%prep
%setup -q
%patch0 -p1
-ln %{SOURCE2} %{SOURCE3} tests
+ln -f %{SOURCE2} %{SOURCE3} tests || cp -f %{SOURCE2} %{SOURCE3} tests
%if %{compat}
%patch1 -p1
@@ -182,9 +171,7 @@ make -s %{?_smp_mflags}
%install
rm -rf ${RPM_BUILD_ROOT}
-mkdir -p ${RPM_BUILD_ROOT}%{_prefix}
-
-%makeinstall
+make -s install DESTDIR=${RPM_BUILD_ROOT}
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so*
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so*
@@ -200,7 +187,7 @@ chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so*
}
%check
-make check
+make -s check
%clean
rm -rf ${RPM_BUILD_ROOT}
@@ -222,12 +209,15 @@ rm -rf ${RPM_BUILD_ROOT}
%{_bindir}/eu-elflint
%{_bindir}/eu-findtextrel
%{_bindir}/eu-nm
+#%{_bindir}/eu-objdump
%{_bindir}/eu-ranlib
%{_bindir}/eu-readelf
%{_bindir}/eu-size
%{_bindir}/eu-strings
%{_bindir}/eu-strip
#%{_bindir}/eu-ld
+%{_bindir}/eu-unstrip
+%{_bindir}/eu-make-debug-archive
%files libs
%defattr(-,root,root)
@@ -271,6 +261,56 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a
%changelog
+* Sun Nov 11 2007 Roland McGrath <roland@redhat.com> - 0.131-1
+- Update to 0.131
+ - libdw: DW_FORM_ref_addr support; dwarf_formref entry point now deprecated;
+ bug fixes for oddly-formatted DWARF
+ - libdwfl: bug fixes in offline archive support, symbol table handling;
+ apply partial relocations for dwfl_module_address_section on ET_REL
+ - libebl: powerpc backend support for Altivec registers
+
+* Wed Oct 17 2007 Roland McGrath <roland@redhat.com> - 0.130-3
+- Fix ET_REL support.
+- Fix odd indentation in eu-readelf -x output.
+
+* Tue Oct 16 2007 Roland McGrath <roland@redhat.com> - 0.130-1
+- Update to 0.130
+ - eu-readelf -p option can take an argument like -x for one section
+ - eu-readelf --archive-index (or -c)
+ - eu-readelf -n improved output for core dumps
+ - eu-readelf: handle SHT_NOTE sections without requiring phdrs (#249467)
+ - eu-elflint: ditto
+ - eu-elflint: stricter checks on debug sections
+ - eu-unstrip: new options, --list (or -n), --relocate (or -R)
+ - libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk;
+ new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
+ - libebl: backend improvements (#324031)
+ - libdwfl: build_id support, new functions for it
+ - libdwfl: dwfl_module_addrsym fixes (#268761, #268981)
+ - libdwfl offline archive support, new script eu-make-debug-archive
+
+* Mon Aug 20 2007 Roland McGrath <roland@redhat.com> - 0.129-2
+- Fix false-positive eu-elflint failure on ppc -mbss-plt binaries.
+
+* Tue Aug 14 2007 Roland McGrath <roland@redhat.com> - 0.129-1
+- Update to 0.129
+ - readelf: new options --hex-dump (or -x), --strings (or -p) (#250973)
+ - addr2line: new option --symbols (or -S)
+ - libdw: dwarf_getscopes fixes (#230235)
+ - libdwfl: dwfl_module_addrsym fixes (#249490)
+
+* Fri Jun 8 2007 Roland McGrath <roland@redhat.com> - 0.128-2
+- Update to 0.128
+ - new program: unstrip
+ - elfcmp: new option --hash-inexact
+- Replace Conflicts: with Provides/Requires using -arch
+
+* Wed Apr 18 2007 Roland McGrath <roland@redhat.com> - 0.127-1
+- Update to 0.127
+ - libdw: new function dwarf_getsrcdirs
+ - libdwfl: new functions dwfl_module_addrsym, dwfl_report_begin_add,
+ dwfl_module_address_section
+
* Mon Feb 5 2007 Roland McGrath <roland@redhat.com> - 0.126-1
- Update to 0.126
- New program eu-ar.
diff --git a/elfutils/ABOUT-NLS b/elfutils/ABOUT-NLS
index 7e121c5b..ec20977e 100644
--- a/elfutils/ABOUT-NLS
+++ b/elfutils/ABOUT-NLS
@@ -1,10 +1,11 @@
-Notes on the Free Translation Project
-*************************************
+1 Notes on the Free Translation Project
+***************************************
- Free software is going international! The Free Translation Project
-is a way to get maintainers of free software, translators, and users all
-together, so that will gradually become able to speak many languages.
-A few packages already provide translations for their messages.
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
@@ -15,41 +16,78 @@ this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
-work at translations should contact the appropriate team.
+work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
-INSTALL Matters
-===============
+1.1 Quick configuration advice
+==============================
- Some packages are "localizable" when properly installed; the
-programs they contain can be made to speak your own native language.
-Most such packages use GNU `gettext'. Other packages have their own
-ways to internationalization, predating GNU `gettext'.
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+1.2 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
-provides the GNU `gettext' functions. If not, the GNU `gettext' own
-library will be used. This library is wholly contained within this
-package, usually in the `intl/' subdirectory, so prior installation of
-the GNU `gettext' package is _not_ required. Installers may use
-special options at configuration time for changing the default
-behaviour. The command:
+provides the GNU `gettext' functions. If not, the included GNU
+`gettext' library will be used. This library is wholly contained
+within this package, usually in the `intl/' subdirectory, so prior
+installation of the GNU `gettext' package is _not_ required.
+Installers may use special options at configuration time for changing
+the default behaviour. The commands:
+ ./configure --with-included-gettext
./configure --disable-nls
-will bypass any pre-existing `gettext' to _totally_ disable translation
-of messages.
+will, respectively, bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might not be desirable. You should use
+the more recent version of the GNU `gettext' library. I.e. if the file
+`intl/VERSION' shows that the library which comes with this package is
+more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
- Internationalized packages have usually many `po/LL.po' files, where
+ Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
@@ -58,10 +96,10 @@ may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
-Using This Package
-==================
+1.3 Using This Package
+======================
- As a user, if your language has been installed for this package, you
+As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
@@ -80,8 +118,8 @@ country code serves to distinguish the dialects.
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
-locales supported by your system for your country by running the command
-`locale -a | grep '^LL''.
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
@@ -94,16 +132,23 @@ system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
-Translating Teams
-=================
+1.4 Translating Teams
+=====================
- For the Free Translation Project to be a success, we need interested
+For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
@@ -127,429 +172,897 @@ get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
-the terminology in use. Proven linguistic skill are praised more than
-programming skill, here.
+the terminology in use. Proven linguistic skills are praised more than
+programming skills, here.
-Available Packages
-==================
+1.5 Available Packages
+======================
- Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of May 2003.
-The matrix shows, in regard of each package, for which languages PO
-files have been submitted to translation coordination, with a
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of October
+2006. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
- Ready PO files am az be bg ca cs da de el en en_GB eo es
- +-------------------------------------------+
- a2ps | [] [] [] [] |
- aegis | () |
- anubis | |
- ap-utils | |
- bash | [] [] [] |
- batchelor | |
- bfd | [] [] |
- binutils | [] [] |
- bison | [] [] [] |
- bluez-pin | [] [] |
- clisp | |
- clisp | [] [] [] |
- coreutils | [] [] [] [] |
- cpio | [] [] [] |
- darkstat | () [] |
- diffutils | [] [] [] [] [] [] [] |
- e2fsprogs | [] [] |
- enscript | [] [] [] [] |
- error | [] [] [] [] [] |
- fetchmail | [] () [] [] [] [] |
- fileutils | [] [] [] |
- findutils | [] [] [] [] [] [] |
- flex | [] [] [] [] |
- gas | [] |
- gawk | [] [] [] [] |
- gcal | [] |
- gcc | [] [] |
- gettext | [] [] [] [] [] |
- gettext-runtime | [] [] [] [] [] |
- gettext-tools | [] [] |
- gimp-print | [] [] [] [] [] |
- gliv | |
- glunarclock | [] [] [] |
- gnucash | () [] |
- gnucash-glossary | [] () [] |
- gnupg | [] () [] [] [] [] |
- gpe-calendar | [] |
- gpe-conf | [] |
- gpe-contacts | [] |
- gpe-edit | |
- gpe-login | [] |
- gpe-ownerinfo | [] |
- gpe-sketchbook | [] |
- gpe-timesheet | |
- gpe-today | [] |
- gpe-todo | [] |
- gphoto2 | [] [] [] [] |
- gprof | [] [] |
- gpsdrive | () () () |
- grep | [] [] [] [] [] |
- gretl | [] |
- hello | [] [] [] [] [] [] |
- id-utils | [] [] |
- indent | [] [] [] [] |
- jpilot | [] [] [] [] |
- jwhois | [] |
- kbd | [] [] [] [] [] |
- ld | [] [] |
- libc | [] [] [] [] [] [] |
- libgpewidget | [] |
- libiconv | [] [] [] [] [] |
- lifelines | [] () |
- lilypond | [] |
- lingoteach | |
- lingoteach_lessons | () () |
- lynx | [] [] [] [] |
- m4 | [] [] [] [] |
- mailutils | [] [] |
- make | [] [] [] |
- man-db | [] () [] [] () |
- mysecretdiary | [] [] [] |
- nano | [] () [] [] [] |
- nano_1_0 | [] () [] [] [] |
- opcodes | [] [] |
- parted | [] [] [] [] [] |
- ptx | [] [] [] [] [] |
- python | |
- radius | |
- recode | [] [] [] [] [] [] |
- screem | |
- sed | [] [] [] [] [] |
- sh-utils | [] [] [] |
- sharutils | [] [] [] [] [] [] |
- sketch | [] () [] |
- soundtracker | [] [] [] |
- sp | [] |
- tar | [] [] [] [] |
- texinfo | [] [] [] [] |
- textutils | [] [] [] [] |
- tin | () () |
- util-linux | [] [] [] [] [] |
- vorbis-tools | [] [] [] |
- wastesedge | () |
- wdiff | [] [] [] [] |
- wget | [] [] [] [] [] [] [] |
- xchat | [] [] [] |
- xpad | |
- +-------------------------------------------+
- am az be bg ca cs da de el en en_GB eo es
- 0 1 4 2 31 17 54 60 14 1 4 12 56
-
- et fa fi fr ga gl he hr hu id it ja ko
- +----------------------------------------+
- a2ps | [] [] [] () () |
- aegis | |
- anubis | [] |
- ap-utils | [] |
- bash | [] [] |
- batchelor | [] |
- bfd | [] [] |
- binutils | [] [] |
- bison | [] [] [] [] |
- bluez-pin | [] [] [] [] |
- clisp | |
- clisp | [] |
- coreutils | [] [] [] [] |
- cpio | [] [] [] [] |
- darkstat | () [] [] [] |
- diffutils | [] [] [] [] [] [] [] |
- e2fsprogs | |
- enscript | [] [] |
- error | [] [] [] [] |
- fetchmail | [] |
- fileutils | [] [] [] [] [] |
- findutils | [] [] [] [] [] [] [] [] [] [] [] |
- flex | [] [] |
- gas | [] |
- gawk | [] [] |
- gcal | [] |
- gcc | [] |
- gettext | [] [] [] |
- gettext-runtime | [] [] [] [] |
- gettext-tools | [] |
- gimp-print | [] [] |
- gliv | () |
- glunarclock | [] [] [] [] |
- gnucash | [] |
- gnucash-glossary | [] |
- gnupg | [] [] [] [] [] [] [] |
- gpe-calendar | [] |
- gpe-conf | |
- gpe-contacts | [] |
- gpe-edit | [] [] |
- gpe-login | [] |
- gpe-ownerinfo | [] [] [] |
- gpe-sketchbook | [] |
- gpe-timesheet | [] [] [] |
- gpe-today | [] [] |
- gpe-todo | [] [] |
- gphoto2 | [] [] [] |
- gprof | [] [] |
- gpsdrive | () [] () () |
- grep | [] [] [] [] [] [] [] [] [] [] [] |
- gretl | [] |
- hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
- id-utils | [] [] [] |
- indent | [] [] [] [] [] [] [] [] |
- jpilot | [] () |
- jwhois | [] [] [] [] |
- kbd | [] |
- ld | [] |
- libc | [] [] [] [] [] [] |
- libgpewidget | [] [] [] |
- libiconv | [] [] [] [] [] [] [] [] |
- lifelines | () |
- lilypond | [] |
- lingoteach | [] [] |
- lingoteach_lessons | |
- lynx | [] [] [] [] |
- m4 | [] [] [] [] |
- mailutils | |
- make | [] [] [] [] [] [] |
- man-db | [] () () |
- mysecretdiary | [] [] |
- nano | [] [] [] [] |
- nano_1_0 | [] [] [] [] |
- opcodes | [] [] |
- parted | [] [] [] |
- ptx | [] [] [] [] [] [] [] |
- python | |
- radius | |
- recode | [] [] [] [] [] [] |
- screem | |
- sed | [] [] [] [] [] [] [] [] |
- sh-utils | [] [] [] [] [] [] |
- sharutils | [] [] [] [] [] |
- sketch | [] |
- soundtracker | [] [] [] |
- sp | [] () |
- tar | [] [] [] [] [] [] [] [] [] |
- texinfo | [] [] [] [] |
- textutils | [] [] [] [] [] |
- tin | [] () |
- util-linux | [] [] [] [] () [] |
- vorbis-tools | [] |
- wastesedge | () |
- wdiff | [] [] [] [] [] |
- wget | [] [] [] [] [] [] [] [] |
- xchat | [] [] [] |
- xpad | |
- +----------------------------------------+
- et fa fi fr ga gl he hr hu id it ja ko
- 20 1 15 73 14 24 8 10 30 31 19 31 9
-
- lg lt lv ms nb nl nn no pl pt pt_BR ro
- +----------------------------------------+
- a2ps | [] [] () () () [] [] |
- aegis | () |
- anubis | [] [] |
- ap-utils | () |
- bash | [] |
- batchelor | |
- bfd | |
- binutils | |
- bison | [] [] [] [] |
- bluez-pin | [] |
- clisp | |
- clisp | [] |
- coreutils | [] |
- cpio | [] [] [] |
- darkstat | [] [] [] [] |
- diffutils | [] [] [] |
- e2fsprogs | |
- enscript | [] [] |
- error | [] [] |
- fetchmail | () () |
- fileutils | [] |
- findutils | [] [] [] [] |
- flex | [] |
- gas | |
- gawk | [] |
- gcal | |
- gcc | |
- gettext | [] |
- gettext-runtime | [] |
- gettext-tools | |
- gimp-print | [] |
- gliv | [] |
- glunarclock | [] |
- gnucash | |
- gnucash-glossary | [] [] |
- gnupg | |
- gpe-calendar | [] [] |
- gpe-conf | [] [] |
- gpe-contacts | [] |
- gpe-edit | [] [] |
- gpe-login | [] [] |
- gpe-ownerinfo | [] [] |
- gpe-sketchbook | [] [] |
- gpe-timesheet | [] [] |
- gpe-today | [] [] |
- gpe-todo | [] [] |
- gphoto2 | |
- gprof | [] |
- gpsdrive | () () () |
- grep | [] [] [] [] |
- gretl | |
- hello | [] [] [] [] [] [] [] [] [] |
- id-utils | [] [] [] |
- indent | [] [] [] |
- jpilot | () () |
- jwhois | [] [] [] |
- kbd | |
- ld | |
- libc | [] [] [] [] |
- libgpewidget | [] [] |
- libiconv | [] [] |
- lifelines | |
- lilypond | [] |
- lingoteach | |
- lingoteach_lessons | |
- lynx | [] [] |
- m4 | [] [] [] [] |
- mailutils | |
- make | [] [] |
- man-db | [] |
- mysecretdiary | [] |
- nano | [] [] [] [] |
- nano_1_0 | [] [] [] [] |
- opcodes | [] [] [] |
- parted | [] [] [] |
- ptx | [] [] [] [] [] [] [] |
- python | |
- radius | |
- recode | [] [] [] |
- screem | |
- sed | [] [] |
- sh-utils | [] |
- sharutils | [] |
- sketch | [] |
- soundtracker | |
- sp | |
- tar | [] [] [] [] [] [] |
- texinfo | [] |
- textutils | [] |
- tin | |
- util-linux | [] [] |
- vorbis-tools | [] [] |
- wastesedge | |
- wdiff | [] [] [] [] |
- wget | [] [] [] |
- xchat | [] [] |
- xpad | [] |
- +----------------------------------------+
- lg lt lv ms nb nl nn no pl pt pt_BR ro
- 0 0 2 11 7 26 3 4 18 15 34 34
-
- ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
- +-------------------------------------------+
- a2ps | [] [] [] [] [] | 16
- aegis | () | 0
- anubis | [] [] | 5
- ap-utils | () | 1
- bash | [] | 7
- batchelor | | 1
- bfd | [] [] [] | 7
- binutils | [] [] [] | 7
- bison | [] [] | 13
- bluez-pin | | 7
- clisp | | 0
- clisp | | 5
- coreutils | [] [] [] [] [] | 14
- cpio | [] [] [] | 13
- darkstat | [] () () | 9
- diffutils | [] [] [] [] | 21
- e2fsprogs | [] | 3
- enscript | [] [] [] | 11
- error | [] [] [] | 14
- fetchmail | [] | 7
- fileutils | [] [] [] [] [] [] | 15
- findutils | [] [] [] [] [] [] | 27
- flex | [] [] [] | 10
- gas | [] | 3
- gawk | [] [] | 9
- gcal | [] [] | 4
- gcc | [] | 4
- gettext | [] [] [] [] [] [] | 15
- gettext-runtime | [] [] [] [] [] [] | 16
- gettext-tools | [] [] | 5
- gimp-print | [] [] | 10
- gliv | | 1
- glunarclock | [] [] [] | 11
- gnucash | [] [] | 4
- gnucash-glossary | [] [] [] | 8
- gnupg | [] [] [] [] | 16
- gpe-calendar | [] | 5
- gpe-conf | | 3
- gpe-contacts | [] | 4
- gpe-edit | [] | 5
- gpe-login | [] | 5
- gpe-ownerinfo | [] | 7
- gpe-sketchbook | [] | 5
- gpe-timesheet | [] | 6
- gpe-today | [] | 6
- gpe-todo | [] | 6
- gphoto2 | [] [] | 9
- gprof | [] [] | 7
- gpsdrive | [] [] | 3
- grep | [] [] [] [] | 24
- gretl | | 2
- hello | [] [] [] [] [] | 33
- id-utils | [] [] [] | 11
- indent | [] [] [] [] | 19
- jpilot | [] [] [] [] [] | 10
- jwhois | () () [] [] | 10
- kbd | [] [] | 8
- ld | [] [] | 5
- libc | [] [] [] [] | 20
- libgpewidget | | 6
- libiconv | [] [] [] [] [] [] | 21
- lifelines | [] | 2
- lilypond | [] | 4
- lingoteach | | 2
- lingoteach_lessons | () | 0
- lynx | [] [] [] [] | 14
- m4 | [] [] [] | 15
- mailutils | | 2
- make | [] [] [] [] | 15
- man-db | [] | 6
- mysecretdiary | [] [] | 8
- nano | [] [] [] | 15
- nano_1_0 | [] [] [] | 15
- opcodes | [] [] | 9
- parted | [] [] | 13
- ptx | [] [] [] | 22
- python | | 0
- radius | | 0
- recode | [] [] [] [] | 19
- screem | [] | 1
- sed | [] [] [] [] [] | 20
- sh-utils | [] [] [] | 13
- sharutils | [] [] [] [] | 16
- sketch | [] | 5
- soundtracker | [] | 7
- sp | [] | 3
- tar | [] [] [] [] [] | 24
- texinfo | [] [] [] [] | 13
- textutils | [] [] [] [] [] | 15
- tin | | 1
- util-linux | [] [] | 14
- vorbis-tools | [] | 7
- wastesedge | | 0
- wdiff | [] [] [] [] | 17
- wget | [] [] [] [] [] [] [] | 25
- xchat | [] [] [] | 11
- xpad | | 1
- +-------------------------------------------+
- 50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
- 97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913
+ Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo
+ +----------------------------------------------------+
+ GNUnet | [] |
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ ant-phone | () |
+ anubis | [] |
+ ap-utils | |
+ aspell | [] [] [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ console-tools | [] [] |
+ coreutils | [] [] [] |
+ cpio | |
+ cpplib | [] [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] |
+ dialog | [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] () [] |
+ fileutils | [] [] |
+ findutils | [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] [] [] |
+ gip | [] |
+ gliv | [] |
+ glunarclock | [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | () () [] |
+ gnucash-glossary | [] () |
+ gnuedu | |
+ gnulib | [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-filemanager | |
+ gpe-go | [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] |
+ gretl | |
+ gsasl | |
+ gss | |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] [] [] |
+ gtick | () |
+ gtkam | [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] |
+ id-utils | [] [] |
+ impost | |
+ indent | [] [] [] |
+ iso_3166 | [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] |
+ iso_639 | [] [] |
+ jpilot | [] |
+ jtag | |
+ jwhois | |
+ kbd | [] [] [] [] |
+ keytouch | |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | () |
+ ld | [] |
+ leafpad | [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | |
+ libiconv | [] [] |
+ libidn | [] [] |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] |
+ make | [] [] |
+ man-db | [] () [] [] |
+ minicom | [] [] [] |
+ mysecretdiary | [] [] |
+ nano | [] [] [] |
+ nano_1_0 | [] () [] [] |
+ opcodes | [] |
+ parted | |
+ pilot-qof | [] |
+ psmisc | [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] [] |
+ sharutils | [] [] [] [] [] [] |
+ shishi | |
+ silky | |
+ skencil | [] () |
+ sketch | [] () |
+ solfege | |
+ soundtracker | [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | () () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | [] [] |
+ +----------------------------------------------------+
+ af am ar az be bg bs ca cs cy da de el en en_GB eo
+ 10 0 1 2 9 22 1 42 41 2 60 95 16 1 17 16
+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | [] [] [] () |
+ aegis | |
+ ant-phone | [] |
+ anubis | [] |
+ ap-utils | [] [] |
+ aspell | [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] [] [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ console-tools | |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ error | [] [] [] [] [] |
+ fetchmail | [] |
+ fileutils | [] [] [] [] [] [] |
+ findutils | [] [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | [] [] |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] |
+ gliv | () |
+ glunarclock | [] [] [] |
+ gmult | [] [] [] |
+ gnubiff | () () |
+ gnucash | () () () |
+ gnucash-glossary | [] [] |
+ gnuedu | [] |
+ gnulib | [] [] [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] [] [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | () () [] () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] [] [] [] [] |
+ gretl | [] [] [] |
+ gsasl | [] [] |
+ gss | [] |
+ gst-plugins | [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] [] |
+ impost | [] [] |
+ indent | [] [] [] [] [] [] [] [] [] [] |
+ iso_3166 | [] [] [] |
+ iso_3166_2 | [] |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] [] |
+ jpilot | [] [] |
+ jtag | [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] [] |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] [] [] |
+ libgpg-error | |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | [] [] |
+ libiconv | [] [] |
+ libidn | [] [] |
+ lifelines | () |
+ lilypond | [] |
+ lingoteach | [] [] [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] |
+ man-db | () |
+ minicom | [] [] [] [] |
+ mysecretdiary | [] [] [] |
+ nano | [] [] [] [] [] [] |
+ nano_1_0 | [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] [] |
+ shishi | |
+ silky | [] |
+ skencil | [] [] |
+ sketch | [] [] |
+ solfege | [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] [] [] |
+ texinfo | [] [] |
+ textutils | [] [] [] [] [] |
+ tin | [] () |
+ tp-robot | [] [] [] [] |
+ tuxpaint | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux | [] [] [] [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ 88 22 14 2 40 115 61 14 1 8 1 6 59 31 0 52
+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ +-------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] () |
+ aegis | () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | [] |
+ aspell | [] [] |
+ bash | [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] |
+ bluez-pin | [] [] [] |
+ cflow | |
+ clisp | [] |
+ console-tools | |
+ coreutils | [] |
+ cpio | |
+ cpplib | [] |
+ cryptonit | [] |
+ darkstat | [] [] |
+ dialog | [] [] |
+ diffutils | [] [] [] |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ error | [] |
+ fetchmail | [] [] |
+ fileutils | [] [] |
+ findutils | [] |
+ flex | [] [] |
+ fslint | [] [] |
+ gas | |
+ gawk | [] [] |
+ gbiff | [] |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] |
+ gettext-runtime | [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] |
+ gip | [] [] |
+ gliv | [] |
+ glunarclock | [] [] |
+ gmult | [] [] |
+ gnubiff | |
+ gnucash | () () |
+ gnucash-glossary | [] |
+ gnuedu | |
+ gnulib | [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] |
+ gprof | |
+ gpsdrive | () () () |
+ gramadoir | () |
+ grep | [] [] [] [] |
+ gretl | |
+ gsasl | [] |
+ gss | |
+ gst-plugins | [] |
+ gst-plugins-base | |
+ gst-plugins-good | [] |
+ gstreamer | [] |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] |
+ gutenprint | |
+ hello | [] [] [] [] [] [] |
+ id-utils | [] |
+ impost | |
+ indent | [] [] |
+ iso_3166 | [] |
+ iso_3166_2 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] |
+ jpilot | () () () |
+ jtag | |
+ jwhois | [] |
+ kbd | [] |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] |
+ libc | [] [] [] [] [] |
+ libexif | |
+ libextractor | |
+ libgpewidget | [] |
+ libgpg-error | |
+ libgphoto2 | [] |
+ libgphoto2_port | [] |
+ libgsasl | [] |
+ libiconv | |
+ libidn | [] [] |
+ lifelines | [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] |
+ m4 | [] [] |
+ mailutils | |
+ make | [] [] [] |
+ man-db | () |
+ minicom | [] |
+ mysecretdiary | [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] |
+ opcodes | [] |
+ parted | [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | |
+ recode | [] |
+ rpm | [] [] |
+ screem | [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] |
+ shishi | |
+ silky | [] |
+ skencil | |
+ sketch | |
+ solfege | |
+ soundtracker | |
+ sp | () |
+ stardict | [] [] |
+ system-tools-ba... | [] [] [] [] |
+ tar | [] [] [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | |
+ tp-robot | [] |
+ tuxpaint | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] |
+ vorbis-tools | [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] |
+ xkeyboard-config | [] |
+ xpad | [] [] [] |
+ +-------------------------------------------------+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ 52 24 2 2 1 3 0 2 3 21 0 15 1 97 5 1
+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ +------------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] [] [] [] [] |
+ aegis | () () |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ ap-utils | () |
+ aspell | [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] |
+ console-tools | [] |
+ coreutils | [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] |
+ cryptonit | [] [] |
+ darkstat | [] [] [] [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] [] |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ fslint | [] [] [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] [] |
+ gliv | [] [] [] [] |
+ glunarclock | [] [] [] [] [] [] |
+ gmult | [] [] [] [] |
+ gnubiff | () |
+ gnucash | () [] |
+ gnucash-glossary | [] [] [] |
+ gnuedu | |
+ gnulib | [] [] [] [] [] |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] [] [] [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] [] [] [] |
+ gpe-login | [] [] [] [] [] [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] |
+ gretl | [] |
+ gsasl | [] [] [] |
+ gss | [] [] [] |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] |
+ impost | [] |
+ indent | [] [] [] [] [] [] |
+ iso_3166 | [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | |
+ jtag | [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] |
+ ld | [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] [] |
+ libgpewidget | [] [] [] [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] |
+ libiconv | [] [] |
+ libidn | [] [] () |
+ lifelines | [] [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailutils | [] [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] [] |
+ minicom | [] [] [] [] [] |
+ mysecretdiary | [] [] [] [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] |
+ pilot-qof | [] |
+ psmisc | [] [] |
+ pwdutils | [] [] |
+ python | |
+ qof | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] |
+ rpm | [] [] [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ silky | [] |
+ skencil | [] [] [] |
+ sketch | [] [] [] |
+ solfege | [] |
+ soundtracker | [] [] |
+ sp | |
+ stardict | [] [] [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] |
+ tin | () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] |
+ wget | [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ xpad | [] [] [] |
+ +------------------------------------------------------+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ 0 2 3 58 30 54 5 73 72 4 40 46 11 50 128 2
+
+ tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ +---------------------------------------------------+
+ GNUnet | [] | 2
+ a2ps | [] [] [] | 19
+ aegis | | 0
+ ant-phone | [] [] | 6
+ anubis | [] [] [] | 11
+ ap-utils | () [] | 4
+ aspell | [] [] [] | 15
+ bash | [] | 11
+ batchelor | [] [] | 9
+ bfd | | 1
+ bibshelf | [] | 7
+ binutils | [] [] [] | 9
+ bison | [] [] [] | 19
+ bison-runtime | [] [] [] | 15
+ bluez-pin | [] [] [] [] [] [] | 28
+ cflow | [] [] | 5
+ clisp | | 6
+ console-tools | [] [] | 5
+ coreutils | [] [] | 16
+ cpio | [] [] [] | 9
+ cpplib | [] [] [] [] | 11
+ cryptonit | | 5
+ darkstat | [] () () | 15
+ dialog | [] [] [] [] [] | 30
+ diffutils | [] [] [] [] | 28
+ doodle | [] | 6
+ e2fsprogs | [] [] | 10
+ enscript | [] [] [] | 16
+ error | [] [] [] [] | 18
+ fetchmail | [] [] | 12
+ fileutils | [] [] [] | 18
+ findutils | [] [] [] | 17
+ flex | [] [] | 15
+ fslint | [] | 9
+ gas | [] | 3
+ gawk | [] [] | 15
+ gbiff | [] | 5
+ gcal | [] | 5
+ gcc | [] [] [] | 6
+ gettext-examples | [] [] [] [] [] [] | 27
+ gettext-runtime | [] [] [] [] [] [] | 28
+ gettext-tools | [] [] [] [] [] | 19
+ gimp-print | [] [] | 12
+ gip | [] [] | 12
+ gliv | [] [] | 8
+ glunarclock | [] [] [] | 15
+ gmult | [] [] [] [] | 15
+ gnubiff | [] | 1
+ gnucash | () | 2
+ gnucash-glossary | [] [] | 9
+ gnuedu | [] | 2
+ gnulib | [] [] [] [] [] | 28
+ gnunet-gtk | | 1
+ gnutls | | 2
+ gpe-aerial | [] [] | 14
+ gpe-beam | [] [] | 14
+ gpe-calendar | [] | 3
+ gpe-clock | [] [] [] [] | 21
+ gpe-conf | [] [] | 14
+ gpe-contacts | [] [] | 10
+ gpe-edit | [] [] [] [] | 20
+ gpe-filemanager | [] | 6
+ gpe-go | [] [] | 15
+ gpe-login | [] [] [] [] [] | 21
+ gpe-ownerinfo | [] [] [] [] | 21
+ gpe-package | [] | 6
+ gpe-sketchbook | [] [] | 16
+ gpe-su | [] [] [] | 20
+ gpe-taskmanager | [] [] [] | 20
+ gpe-timesheet | [] [] [] [] | 18
+ gpe-today | [] [] [] [] [] | 21
+ gpe-todo | [] | 7
+ gphoto2 | [] [] [] [] | 20
+ gprof | [] [] | 11
+ gpsdrive | | 4
+ gramadoir | [] | 7
+ grep | [] [] [] [] | 34
+ gretl | | 4
+ gsasl | [] [] | 8
+ gss | [] | 5
+ gst-plugins | [] [] [] | 15
+ gst-plugins-base | [] [] [] | 9
+ gst-plugins-good | [] [] [] [] [] | 20
+ gstreamer | [] [] [] | 17
+ gtick | [] | 3
+ gtkam | [] | 13
+ gtkorphan | [] | 7
+ gtkspell | [] [] [] [] [] [] | 26
+ gutenprint | | 3
+ hello | [] [] [] [] [] | 37
+ id-utils | [] [] | 14
+ impost | [] | 4
+ indent | [] [] [] [] | 25
+ iso_3166 | [] [] [] [] | 16
+ iso_3166_2 | | 2
+ iso_4217 | [] [] | 14
+ iso_639 | [] | 14
+ jpilot | [] [] [] [] | 7
+ jtag | [] | 3
+ jwhois | [] [] [] | 13
+ kbd | [] [] | 12
+ keytouch | [] | 4
+ keytouch-editor | | 2
+ keytouch-keyboa... | [] | 3
+ latrine | [] [] | 8
+ ld | [] [] [] [] | 8
+ leafpad | [] [] [] [] | 23
+ libc | [] [] [] | 23
+ libexif | [] | 4
+ libextractor | [] | 5
+ libgpewidget | [] [] [] | 19
+ libgpg-error | [] | 4
+ libgphoto2 | [] | 8
+ libgphoto2_port | [] [] [] | 11
+ libgsasl | [] | 8
+ libiconv | [] | 7
+ libidn | [] [] | 10
+ lifelines | | 4
+ lilypond | | 2
+ lingoteach | [] | 6
+ lynx | [] [] [] | 15
+ m4 | [] [] [] | 18
+ mailutils | [] | 8
+ make | [] [] [] | 20
+ man-db | [] | 6
+ minicom | [] | 14
+ mysecretdiary | [] [] | 12
+ nano | [] [] | 17
+ nano_1_0 | [] [] [] | 18
+ opcodes | [] [] | 10
+ parted | [] [] [] | 10
+ pilot-qof | [] | 3
+ psmisc | [] | 10
+ pwdutils | [] | 3
+ python | | 0
+ qof | [] | 4
+ radius | [] | 6
+ recode | [] [] [] | 25
+ rpm | [] [] [] [] | 14
+ screem | [] | 2
+ scrollkeeper | [] [] [] [] | 26
+ sed | [] [] [] | 22
+ sh-utils | [] | 15
+ shared-mime-info | [] [] [] [] | 24
+ sharutils | [] [] [] | 23
+ shishi | | 1
+ silky | [] | 4
+ skencil | [] | 7
+ sketch | | 6
+ solfege | | 2
+ soundtracker | [] [] | 9
+ sp | [] | 3
+ stardict | [] [] [] [] | 11
+ system-tools-ba... | [] [] [] [] [] [] [] | 37
+ tar | [] [] [] [] | 20
+ texinfo | [] [] [] | 15
+ textutils | [] [] [] | 17
+ tin | | 1
+ tp-robot | [] [] [] | 10
+ tuxpaint | [] [] [] | 16
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux | [] [] [] | 20
+ vorbis-tools | [] [] | 11
+ wastesedge | | 1
+ wdiff | [] [] | 22
+ wget | [] [] [] | 19
+ xchat | [] [] [] [] | 29
+ xkeyboard-config | [] [] [] [] | 11
+ xpad | [] [] [] | 14
+ +---------------------------------------------------+
+ 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ 170 domains 0 1 1 77 39 0 136 10 1 48 5 54 0 2028
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
@@ -562,15 +1075,15 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
- If May 2003 seems to be old, you may fetch a more recent copy of
+ If October 2006 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
-Using `gettext' in new packages
-===============================
+1.6 Using `gettext' in new packages
+===================================
- If you are writing a freely available program and want to
+If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
diff --git a/elfutils/ChangeLog b/elfutils/ChangeLog
index 760c4d2d..9a55c005 100644
--- a/elfutils/ChangeLog
+++ b/elfutils/ChangeLog
@@ -1,3 +1,13 @@
+2007-06-05 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am: Remove traces of mini builds.
+ * configure.ac: Don't use libelf-po/POTFILES.in as config file
+ anymore.
+
+2007-05-16 Roland McGrath <roland@redhat.com>
+
+ * configure.ac (AM_INIT_AUTOMAKE): Use -Wno-portability.
+
2006-11-02 Roland McGrath <roland@redhat.com>
* Makefile.am (EXTRA_DIST): Add EXCEPTION file.
diff --git a/elfutils/INSTALL b/elfutils/INSTALL
index b42a17ac..5458714e 100644
--- a/elfutils/INSTALL
+++ b/elfutils/INSTALL
@@ -1,38 +1,54 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
Basic Installation
==================
- These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -54,49 +70,49 @@ The simplest way to compile this package is:
Compilers and Options
=====================
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
- You can compile the package for more than one kind of computer at the
+You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
Installation Names
==================
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
+options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
@@ -107,7 +123,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
- Some packages pay attention to `--enable-FEATURE' options to
+Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
@@ -122,48 +138,86 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type
==========================
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
CPU-COMPANY-SYSTEM
-See the file `config.sub' for the possible values of each field. If
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
Sharing Defaults
================
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
-Operation Controls
+Defining Variables
==================
- `configure' recognizes the following options to control how it
-operates.
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
`--help'
+`-h'
Print a summary of the options to `configure', and exit.
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
`--quiet'
`--silent'
`-q'
@@ -175,8 +229,6 @@ operates.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
-`configure' also accepts some other, not widely useful, options.
diff --git a/elfutils/Makefile.am b/elfutils/Makefile.am
index 9bfce658..9306fe69 100644
--- a/elfutils/Makefile.am
+++ b/elfutils/Makefile.am
@@ -27,10 +27,9 @@
##
ACLOCAL_AMFLAGS = -I m4
-mini_SUBDIRS = config m4 lib libelf libelf-po
# Add doc back when we have some real content.
-all_SUBDIRS = libebl libdwfl libdw libcpu libasm backends src po tests
-SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS)
+SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
+ src po tests
EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
diff --git a/elfutils/Makefile.in b/elfutils/Makefile.in
index d793ba0b..fa650a7a 100644
--- a/elfutils/Makefile.in
+++ b/elfutils/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -13,15 +13,11 @@
# 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
@@ -41,23 +37,26 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(top_srcdir)/config/elfutils.spec.in $(top_srcdir)/configure \
ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = elfutils.spec
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -73,15 +72,11 @@ GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -94,13 +89,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -115,19 +106,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -139,20 +123,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -165,33 +147,45 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
-mini_SUBDIRS = config m4 lib libelf libelf-po
+
# Add doc back when we have some real content.
-all_SUBDIRS = libebl libdwfl libdw libcpu libasm backends src po tests
-SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS)
+SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
+ src po tests
+
EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
# Make sure the test install uses lib64 when $LIB will yield lib64.
@@ -242,7 +236,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@@ -257,7 +251,6 @@ distclean-hdr:
-rm -f config.h stamp-h1
elfutils.spec: $(top_builddir)/config.status $(top_srcdir)/config/elfutils.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
-uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -290,8 +283,7 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
+$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
@@ -399,24 +391,22 @@ distdir: $(DISTFILES)
exit 1;; \
esac
$(am__remove_distdir)
- mkdir $(distdir)
- $(mkdir_p) $(distdir)/config $(distdir)/libelf-po $(distdir)/m4 $(distdir)/po
- @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; \
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -430,7 +420,7 @@ distdir: $(DISTFILES)
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || $(mkdir_p) "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
@@ -438,6 +428,8 @@ distdir: $(DISTFILES)
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
@@ -445,7 +437,7 @@ distdir: $(DISTFILES)
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
@@ -521,7 +513,7 @@ distcheck: dist
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
@@ -590,12 +582,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-recursive
+
install-exec-am:
+install-html: install-html-recursive
+
install-info: install-info-recursive
install-man:
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -616,24 +616,25 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-recursive ctags \
- ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
- dist-tarZ dist-zip distcheck distclean distclean-generic \
- distclean-hdr distclean-recursive distclean-tags \
- distcleancheck distdir distuninstallcheck 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 installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-info-am
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-hdr distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
distcheck-hook:
diff --git a/elfutils/NEWS b/elfutils/NEWS
index b1e96856..ac86463a 100644
--- a/elfutils/NEWS
+++ b/elfutils/NEWS
@@ -1,3 +1,55 @@
+Version 0.131:
+
+libdw: DW_FORM_ref_addr support; dwarf_formref entry point now deprecated;
+ bug fixes for oddly-formatted DWARF
+
+libdwfl: bug fixes in offline archive support, symbol table handling;
+ apply partial relocations for dwfl_module_address_section on ET_REL
+
+libebl: powerpc backend support for Altivec registers
+
+Version 0.130:
+
+readelf: -p option can take an argument like -x for one section,
+ or no argument (as before) for all SHF_STRINGS sections;
+ new option --archive-index (or -c);
+ improved -n output for core files, on many machines
+
+libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk;
+ new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
+
+readelf, elflint: handle SHT_NOTE sections without requiring phdrs
+
+elflint: stricter checks on debug sections
+
+libdwfl: new functions dwfl_build_id_find_elf, dwfl_build_id_find_debuginfo,
+ dwfl_module_build_id, dwfl_module_report_build_id;
+ support dynamic symbol tables found via phdrs;
+ dwfl_standard_find_debuginfo now uses build IDs when available
+
+unstrip: new option --list (or -n)
+
+libebl: backend improvements for sparc, alpha, powerpc
+
+Version 0.129:
+
+readelf: new options --hex-dump (or -x), --strings (or -p)
+
+addr2line: new option --symbols (or -S)
+
+Version 0.128:
+
+new program: unstrip
+
+elfcmp: new option --hash-inexact
+
+Version 0.127:
+
+libdw: new function dwarf_getsrcdirs
+
+libdwfl: new functions dwfl_module_addrsym, dwfl_report_begin_add,
+ dwfl_module_address_section
+
Version 0.126:
new program: ar
diff --git a/elfutils/aclocal.m4 b/elfutils/aclocal.m4
index 0739649a..1e4396d4 100644
--- a/elfutils/aclocal.m4
+++ b/elfutils/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
+# 2005, 2006 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,7 +11,12 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf. If you want to use that,
+you should regenerate the build system entirely.], [63])])
+
+# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -21,14 +26,29 @@
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -85,14 +105,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
# 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 7
+# serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -101,8 +121,10 @@ AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
@@ -116,15 +138,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# 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 8
+# serial 9
# 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,
@@ -152,6 +173,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
@@ -217,6 +239,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
@@ -269,7 +292,8 @@ if test "x$enable_dependency_tracking" != xno; then
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
@@ -294,8 +318,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
@@ -342,8 +367,8 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -366,16 +391,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
+[AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
fi
# test whether we have cygpath
@@ -395,6 +424,9 @@ m4_ifval([$2],
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
@@ -430,6 +462,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
@@ -465,7 +501,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -593,14 +629,14 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Copyright (C) 1997, 1999, 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 4
+# serial 5
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -616,6 +652,7 @@ AC_SUBST($1)])
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
@@ -626,7 +663,7 @@ else
fi
])
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -634,60 +671,23 @@ fi
# AM_PROG_MKDIR_P
# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# 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).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
+# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
# Helper functions for option handling. -*- Autoconf -*-
@@ -799,9 +799,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
+# Copyright (C) 2006 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_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
@@ -898,5 +910,6 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-m4_include([m4/gettext.m4])
+m4_include([m4/nls.m4])
+m4_include([m4/po.m4])
m4_include([m4/progtest.m4])
diff --git a/elfutils/backends/ChangeLog b/elfutils/backends/ChangeLog
index 57f33608..2bb61f2b 100644
--- a/elfutils/backends/ChangeLog
+++ b/elfutils/backends/ChangeLog
@@ -1,3 +1,113 @@
+2007-10-18 Roland McGrath <roland@redhat.com>
+
+ * ppc_regs.c (ppc_register_info): Assign 67 to "vscr".
+ Return "vector" and 32 bits for vscr and vrsave.
+ * ppc_corenote.c (altivec_regs): New variable.
+ (EXTRA_NOTES): New macro, handle NT_PPC_VMX.
+
+ * linux-core-note.c (EXTRA_REGSET): New macro.
+ Remove NT_PRXFPREG case. Instead, use EXTRA_NOTES if defined.
+ * i386_corenote.c (EXTRA_NOTES): Define it.
+
+2007-10-09 Roland McGrath <roland@redhat.com>
+
+ * sparc_auxv.c: New file.
+ * Makefile.am (sparc_SRCS): Add it.
+ * sparc_init.c (sparc_init): Initialize auxv_info hook.
+
+2007-10-08 Roland McGrath <roland@redhat.com>
+
+ * linux-core-note.c (TIMEVAL_FIELD): New macro.
+ (prstatus_items): Use it.
+ * sparc_corenote.c: New file.
+ * sparc64_corenote.c: New file.
+ * Makefile.am (sparc_SRCS): Add them.
+ * sparc_init.c (sparc_init): Initialize core_note hook.
+
+ * sparc_symbol.c (sparc_machine_flag_check): New function.
+ * sparc_init.c (sparc_init): Use it.
+
+2007-09-27 Roland McGrath <roland@redhat.com>
+
+ * alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate.
+ * i386_retval.c: Likewise.
+ * ia64_retval.c: Likewise.
+ * ppc64_retval.c: Likewise.
+ * ppc_retval.c: Likewise.
+ * s390_retval.c: Likewise.
+ * sparc_retval.c: Likewise.
+ * x86_64_retval.c: Likewise.
+
+2007-08-23 Roland McGrath <roland@redhat.com>
+
+ * x86_64_regs.c (x86_64_register_info): Put %rflags in "integer" set.
+
+2007-08-22 Roland McGrath <roland@redhat.com>
+
+ * linux-core-note.c (prstatus_items): Add .group initializers.
+ (prpsinfo_items): Likewise.
+ * x86_64_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise.
+ * i386_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise.
+ * ppc_corenote.c (PRSTATUS_REGSET_ITEMS): Likewise.
+
+2007-08-20 Roland McGrath <roland@redhat.com>
+
+ * ppc_symbol.c (ppc_check_special_symbol): For _GLOBAL_OFFSET_TABLE_
+ when DT_PPC_GOT is not found, anywhere in the section is valid.
+
+2007-08-19 Roland McGrath <roland@redhat.com>
+
+ * i386_auxv.c: New file.
+ * Makefile.am (i386_SRCS, x86_64_SRCS): Add it.
+ * ppc_auxv.c: New file.
+ * Makefile.am (ppc_SRCS, ppc64_SRCS): Add it.
+ * i386_init.c (i386_init): Initialize auxv_info hook.
+ * x86_64_init.c (x86_64_init): Likewise.
+ * ppc_init.c (ppc_init): Likewise.
+ * ppc64_init.c (ppc64_init): Likewise.
+
+ * alpha_corenote.c: New file.
+ * Makefile.am (alpha_SRCS): Add it.
+ * alpha_init.c (alpha_init): Initialize core_note hook.
+
+ * ppc_corenote.c: New file.
+ * ppc64_corenote.c: New file.
+ * Makefile.am (ppc_SRCS, ppc64_SRCS): Add them.
+ * ppc_init.c (ppc_init): Initialize core_note hook.
+ * ppc64_init.c (ppc64_init): Likewise.
+
+ * linux-core-note.c: New file.
+ * Makefile.am (noinst_HEADERS): Add it.
+ * i386_corenote.c: Rewritten.
+ * x86_64_corenote.c: Likewise.
+
+2007-05-23 Roland McGrath <roland@redhat.com>
+
+ * alpha_regs.c (alpha_register_info): fp -> s6
+
+2007-04-26 Roland McGrath <roland@redhat.com>
+
+ * alpha_symbol.c (alpha_machine_section_flag_check): New function.
+ * alpha_init.c (alpha_init): Initialize hook.
+
+ * alpha_regs.c: New file.
+ * Makefile.am (alpha_SRCS): Add it.
+ * alpha_init.c (alpha_init): Initialize register_info hook.
+
+2007-04-22 Roland McGrath <roland@redhat.com>
+
+ * ppc_regs.c (ppc_register_info): Use some names instead of sprNNN:
+ mq, xer, lr, ctr, dsisr, dar, dec, vrsave.
+ Set *BITS to 64 for FPU registers.
+
+ * i386_regs.c (i386_register_info): Set *BITS to 16 for fctrl, fstat.
+ * x86_64_regs.c (x86_64_register_info): Likewise for fcw, fsw.
+
+2007-04-01 Roland McGrath <roland@redhat.com>
+
+ * x86_64_regs.c (x86_64_register_info): Add more registers from newer
+ ABI spec.
+
2007-01-11 Roland McGrath <roland@redhat.com>
* ia64_symbol.c (ia64_machine_section_flag_check): New function.
diff --git a/elfutils/backends/Makefile.am b/elfutils/backends/Makefile.am
index 8af59139..4174f8e3 100644
--- a/elfutils/backends/Makefile.am
+++ b/elfutils/backends/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
+## Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -70,7 +70,7 @@ libebl_%.map: Makefile
i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
- i386_retval.c i386_regs.c
+ i386_retval.c i386_regs.c i386_auxv.c
libebl_i386_pic_a_SOURCES = $(i386_SRCS)
am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
@@ -79,7 +79,7 @@ libebl_sh_pic_a_SOURCES = $(sh_SRCS)
am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \
- x86_64_retval.c x86_64_regs.c
+ x86_64_retval.c x86_64_regs.c i386_auxv.c
libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
@@ -87,7 +87,8 @@ ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
-alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c
+alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
+ alpha_corenote.c
libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
@@ -95,15 +96,18 @@ arm_SRCS = arm_init.c arm_symbol.c
libebl_arm_pic_a_SOURCES = $(arm_SRCS)
am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
-sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c
+sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
+ sparc_corenote.c sparc64_corenote.c sparc_auxv.c
libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
-ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c
+ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
+ ppc_corenote.c ppc_auxv.c
libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
-ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc_regs.c
+ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
+ ppc64_corenote.c ppc_regs.c ppc_auxv.c
libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
@@ -134,7 +138,7 @@ uninstall: uninstall-am
done
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
-noinst_HEADERS = libebl_CPU.h common-reloc.c
+noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c
EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
CLEANFILES = *.gcno *.gcda \
diff --git a/elfutils/backends/Makefile.in b/elfutils/backends/Makefile.in
index 195075a2..a1d50bcb 100644
--- a/elfutils/backends/Makefile.in
+++ b/elfutils/backends/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +16,11 @@
-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
@@ -42,11 +38,11 @@ subdir = backends
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -55,7 +51,8 @@ ARFLAGS = cru
libebl_alpha_pic_a_AR = $(AR) $(ARFLAGS)
libebl_alpha_pic_a_LIBADD =
am__objects_1 = alpha_init.$(OBJEXT) alpha_symbol.$(OBJEXT) \
- alpha_retval.$(OBJEXT)
+ alpha_retval.$(OBJEXT) alpha_regs.$(OBJEXT) \
+ alpha_corenote.$(OBJEXT)
libebl_alpha_pic_a_OBJECTS = $(am_libebl_alpha_pic_a_OBJECTS)
libebl_arm_pic_a_AR = $(AR) $(ARFLAGS)
libebl_arm_pic_a_LIBADD =
@@ -65,7 +62,7 @@ libebl_i386_pic_a_AR = $(AR) $(ARFLAGS)
libebl_i386_pic_a_LIBADD =
am__objects_3 = i386_init.$(OBJEXT) i386_symbol.$(OBJEXT) \
i386_corenote.$(OBJEXT) i386_retval.$(OBJEXT) \
- i386_regs.$(OBJEXT)
+ i386_regs.$(OBJEXT) i386_auxv.$(OBJEXT)
libebl_i386_pic_a_OBJECTS = $(am_libebl_i386_pic_a_OBJECTS)
libebl_ia64_pic_a_AR = $(AR) $(ARFLAGS)
libebl_ia64_pic_a_LIBADD =
@@ -75,12 +72,14 @@ libebl_ia64_pic_a_OBJECTS = $(am_libebl_ia64_pic_a_OBJECTS)
libebl_ppc64_pic_a_AR = $(AR) $(ARFLAGS)
libebl_ppc64_pic_a_LIBADD =
am__objects_5 = ppc64_init.$(OBJEXT) ppc64_symbol.$(OBJEXT) \
- ppc64_retval.$(OBJEXT) ppc_regs.$(OBJEXT)
+ ppc64_retval.$(OBJEXT) ppc64_corenote.$(OBJEXT) \
+ ppc_regs.$(OBJEXT) ppc_auxv.$(OBJEXT)
libebl_ppc64_pic_a_OBJECTS = $(am_libebl_ppc64_pic_a_OBJECTS)
libebl_ppc_pic_a_AR = $(AR) $(ARFLAGS)
libebl_ppc_pic_a_LIBADD =
am__objects_6 = ppc_init.$(OBJEXT) ppc_symbol.$(OBJEXT) \
- ppc_retval.$(OBJEXT) ppc_regs.$(OBJEXT)
+ ppc_retval.$(OBJEXT) ppc_regs.$(OBJEXT) ppc_corenote.$(OBJEXT) \
+ ppc_auxv.$(OBJEXT)
libebl_ppc_pic_a_OBJECTS = $(am_libebl_ppc_pic_a_OBJECTS)
libebl_s390_pic_a_AR = $(AR) $(ARFLAGS)
libebl_s390_pic_a_LIBADD =
@@ -94,15 +93,17 @@ libebl_sh_pic_a_OBJECTS = $(am_libebl_sh_pic_a_OBJECTS)
libebl_sparc_pic_a_AR = $(AR) $(ARFLAGS)
libebl_sparc_pic_a_LIBADD =
am__objects_9 = sparc_init.$(OBJEXT) sparc_symbol.$(OBJEXT) \
- sparc_regs.$(OBJEXT) sparc_retval.$(OBJEXT)
+ sparc_regs.$(OBJEXT) sparc_retval.$(OBJEXT) \
+ sparc_corenote.$(OBJEXT) sparc64_corenote.$(OBJEXT) \
+ sparc_auxv.$(OBJEXT)
libebl_sparc_pic_a_OBJECTS = $(am_libebl_sparc_pic_a_OBJECTS)
libebl_x86_64_pic_a_AR = $(AR) $(ARFLAGS)
libebl_x86_64_pic_a_LIBADD =
am__objects_10 = x86_64_init.$(OBJEXT) x86_64_symbol.$(OBJEXT) \
x86_64_corenote.$(OBJEXT) x86_64_retval.$(OBJEXT) \
- x86_64_regs.$(OBJEXT)
+ x86_64_regs.$(OBJEXT) i386_auxv.$(OBJEXT)
libebl_x86_64_pic_a_OBJECTS = $(am_libebl_x86_64_pic_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -126,15 +127,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -147,13 +144,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -168,19 +161,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -192,20 +178,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -218,28 +202,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@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 \
@@ -264,7 +259,7 @@ noinst_DATA = $(libebl_pic:_pic.a=.so)
@MUDFLAP_TRUE@libmudflap = -lmudflap
textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
- i386_retval.c i386_regs.c
+ i386_retval.c i386_regs.c i386_auxv.c
libebl_i386_pic_a_SOURCES = $(i386_SRCS)
am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
@@ -272,32 +267,40 @@ sh_SRCS = sh_init.c sh_symbol.c
libebl_sh_pic_a_SOURCES = $(sh_SRCS)
am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \
- x86_64_retval.c x86_64_regs.c
+ x86_64_retval.c x86_64_regs.c i386_auxv.c
libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
-alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c
+alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
+ alpha_corenote.c
+
libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
arm_SRCS = arm_init.c arm_symbol.c
libebl_arm_pic_a_SOURCES = $(arm_SRCS)
am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
-sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c
+sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
+ sparc_corenote.c sparc64_corenote.c sparc_auxv.c
+
libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
-ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c
+ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
+ ppc_corenote.c ppc_auxv.c
+
libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
-ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc_regs.c
+ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
+ ppc64_corenote.c ppc_regs.c ppc_auxv.c
+
libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c
libebl_s390_pic_a_SOURCES = $(s390_SRCS)
am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
-noinst_HEADERS = libebl_CPU.h common-reloc.c
+noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c
EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
CLEANFILES = *.gcno *.gcda \
$(foreach m,$(modules),\
@@ -386,11 +389,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_corenote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_regs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_retval.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_symbol.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arm_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arm_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_auxv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_corenote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_regs.Po@am__quote@
@@ -400,9 +406,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64_regs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64_retval.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc64_corenote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc64_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc64_retval.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc64_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_auxv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_corenote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_regs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppc_retval.Po@am__quote@
@@ -413,6 +422,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_symbol.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc64_corenote.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc_auxv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc_corenote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc_regs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc_retval.Po@am__quote@
@@ -424,19 +436,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x86_64_symbol.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -487,22 +498,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -562,12 +572,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -587,18 +605,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-tags 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 \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
+ uninstall-am
libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
diff --git a/elfutils/backends/alpha_corenote.c b/elfutils/backends/alpha_corenote.c
new file mode 100644
index 00000000..dcc62e9e
--- /dev/null
+++ b/elfutils/backends/alpha_corenote.c
@@ -0,0 +1,67 @@
+/* PowerPC specific core note handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <elf.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#define BACKEND alpha_
+#include "libebl_CPU.h"
+
+static const Ebl_Register_Location prstatus_regs[] =
+ {
+ { .offset = 0, .regno = 0, .count = 31, .bits = 64 }, /* r0-r30 */
+ { .offset = 32 * 8, .regno = 64, .count = 1, .bits = 64 }, /* pc */
+ { .offset = 33 * 8, .regno = 66, .count = 1, .bits = 64 }, /* unique */
+ };
+#define PRSTATUS_REGS_SIZE (33 * 8)
+
+static const Ebl_Register_Location fpregset_regs[] =
+ {
+ { .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f30, fpcr */
+ };
+#define FPREGSET_SIZE (32 * 8)
+
+#define ULONG uint64_t
+#define ALIGN_ULONG 8
+#define TYPE_ULONG ELF_T_XWORD
+#define TYPE_LONG ELF_T_SXWORD
+#define PID_T int32_t
+#define UID_T uint32_t
+#define GID_T uint32_t
+#define ALIGN_PID_T 4
+#define ALIGN_UID_T 4
+#define ALIGN_GID_T 4
+#define TYPE_PID_T ELF_T_SWORD
+#define TYPE_UID_T ELF_T_WORD
+#define TYPE_GID_T ELF_T_WORD
+
+#include "linux-core-note.c"
diff --git a/elfutils/backends/alpha_init.c b/elfutils/backends/alpha_init.c
index 1590fc88..794d412a 100644
--- a/elfutils/backends/alpha_init.c
+++ b/elfutils/backends/alpha_init.c
@@ -1,5 +1,5 @@
/* Initialization of Alpha specific backend library.
- Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -54,6 +54,9 @@ alpha_init (elf, machine, eh, ehlen)
HOOK (eh, dynamic_tag_check);
HOOK (eh, reloc_simple_type);
HOOK (eh, return_value_location);
+ HOOK (eh, machine_section_flag_check);
+ HOOK (eh, register_info);
+ HOOK (eh, core_note);
eh->sysvhash_entrysize = sizeof (Elf64_Xword);
return MODVERSION;
diff --git a/elfutils/backends/alpha_regs.c b/elfutils/backends/alpha_regs.c
new file mode 100644
index 00000000..3bb9a6cd
--- /dev/null
+++ b/elfutils/backends/alpha_regs.c
@@ -0,0 +1,161 @@
+/* Register names and numbers for Alpha DWARF.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#include <dwarf.h>
+
+#define BACKEND alpha_
+#include "libebl_CPU.h"
+
+ssize_t
+alpha_register_info (Ebl *ebl __attribute__ ((unused)),
+ int regno, char *name, size_t namelen,
+ const char **prefix, const char **setname,
+ int *bits, int *type)
+{
+ if (name == NULL)
+ return 67;
+
+ if (regno < 0 || regno > 66 || namelen < 7)
+ return -1;
+
+ *prefix = "$";
+
+ *bits = 64;
+ *type = DW_ATE_signed;
+ *setname = "integer";
+ if (regno >= 32 && regno < 64)
+ {
+ *setname = "FPU";
+ *type = DW_ATE_float;
+ }
+
+ switch (regno)
+ {
+ case 0:
+ name[0] = 'v';
+ name[1] = '0';
+ namelen = 2;
+ break;
+
+ case 1 ... 8:
+ name[0] = 't';
+ name[1] = regno - 1 + '0';
+ namelen = 2;
+ break;
+
+ case 9 ... 15:
+ name[0] = 's';
+ name[1] = regno - 9 + '0';
+ namelen = 2;
+ break;
+
+ case 16 ... 21:
+ name[0] = 'a';
+ name[1] = regno - 16 + '0';
+ namelen = 2;
+ break;
+
+ case 22 ... 23:
+ name[0] = 't';
+ name[1] = regno - 22 + '8';
+ namelen = 2;
+ break;
+
+ case 24 ... 25:
+ name[0] = 't';
+ name[1] = '1';
+ name[2] = regno - 24 + '0';
+ namelen = 3;
+ break;
+
+ case 26:
+ *type = DW_ATE_address;
+ return stpcpy (name, "ra") + 1 - name;
+
+ case 27:
+ return stpcpy (name, "t12") + 1 - name;
+
+ case 28:
+ return stpcpy (name, "at") + 1 - name;
+
+ case 29:
+ *type = DW_ATE_address;
+ return stpcpy (name, "gp") + 1 - name;
+
+ case 30:
+ *type = DW_ATE_address;
+ return stpcpy (name, "sp") + 1 - name;
+
+ case 31:
+ return stpcpy (name, "zero") + 1 - name;
+
+ case 32 ... 32 + 9:
+ name[0] = 'f';
+ name[1] = regno - 32 + '0';
+ namelen = 2;
+ break;
+
+ case 32 + 10 ... 32 + 19:
+ name[0] = 'f';
+ name[1] = '1';
+ name[2] = regno - 32 - 10 + '0';
+ namelen = 3;
+ break;
+
+ case 32 + 20 ... 32 + 29:
+ name[0] = 'f';
+ name[1] = '2';
+ name[2] = regno - 32 - 20 + '0';
+ namelen = 3;
+ break;
+
+ case 32 + 30:
+ return stpcpy (name, "f30") + 1 - name;
+
+ case 32 + 31:
+ *type = DW_ATE_unsigned;
+ return stpcpy (name, "fpcr") + 1 - name;
+
+ case 64:
+ *type = DW_ATE_address;
+ return stpcpy (name, "pc") + 1 - name;
+
+ case 66:
+ *type = DW_ATE_address;
+ return stpcpy (name, "unique") + 1 - name;
+
+ default:
+ *setname = NULL;
+ return 0;
+ }
+
+ name[namelen++] = '\0';
+ return namelen;
+}
diff --git a/elfutils/backends/alpha_retval.c b/elfutils/backends/alpha_retval.c
index 09f8bb4c..57ba867b 100644
--- a/elfutils/backends/alpha_retval.c
+++ b/elfutils/backends/alpha_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for Alpha ELF ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -66,7 +66,8 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -80,7 +81,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -91,9 +92,9 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -105,8 +106,8 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_ptr_to_member_type:
{
Dwarf_Word size;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
@@ -116,8 +117,9 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
*locp = loc_fpreg;
diff --git a/elfutils/backends/alpha_symbol.c b/elfutils/backends/alpha_symbol.c
index ca93e2a8..dc3cce56 100644
--- a/elfutils/backends/alpha_symbol.c
+++ b/elfutils/backends/alpha_symbol.c
@@ -1,5 +1,5 @@
/* Alpha specific symbolic name handling.
- Copyright (C) 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -69,3 +69,11 @@ alpha_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
return ELF_T_NUM;
}
}
+
+
+/* Check whether SHF_MASKPROC flags are valid. */
+bool
+alpha_machine_section_flag_check (GElf_Xword sh_flags)
+{
+ return (sh_flags &~ (SHF_ALPHA_GPREL)) == 0;
+}
diff --git a/elfutils/backends/i386_auxv.c b/elfutils/backends/i386_auxv.c
new file mode 100644
index 00000000..5f7b15ef
--- /dev/null
+++ b/elfutils/backends/i386_auxv.c
@@ -0,0 +1,49 @@
+/* i386 specific auxv handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND i386_
+#include "libebl_CPU.h"
+
+int
+EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
+{
+ if (a_type != AT_HWCAP)
+ return 0;
+
+ *name = "HWCAP";
+ *format = "b"
+ "fpu\0" "vme\0" "de\0" "pse\0" "tsc\0" "msr\0" "pae\0" "mce\0"
+ "cx8\0" "apic\0" "10\0" "sep\0" "mtrr\0" "pge\0" "mca\0" "cmov\0"
+ "pat\0" "pse36\0" "pn\0" "clflush\0" "20\0" "dts\0" "acpi\0" "mmx\0"
+ "fxsr\0" "sse\0" "sse2\0" "ss\0" "ht\0" "tm\0" "ia64\0" "pbe\0" "\0";
+ return 1;
+}
+
+__typeof (i386_auxv_info) x86_64_auxv_info
+ __attribute__ ((alias ("i386_auxv_info")));
diff --git a/elfutils/backends/i386_corenote.c b/elfutils/backends/i386_corenote.c
index c9d3e5fb..f6c4c1de 100644
--- a/elfutils/backends/i386_corenote.c
+++ b/elfutils/backends/i386_corenote.c
@@ -1,7 +1,6 @@
/* i386 specific core note handling.
- Copyright (C) 2002, 2005 Red Hat, Inc.
+ Copyright (C) 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2002.
Red Hat elfutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
@@ -38,138 +37,70 @@
#include "libebl_CPU.h"
-/* We cannot include <sys/procfs.h> since the definition would be for
- the host platform and not always x86 as required here. */
-struct elf_prstatus
+static const Ebl_Register_Location prstatus_regs[] =
{
- struct
- {
- int32_t si_signo; /* Signal number. */
- int32_t si_code; /* Extra code. */
- int32_t si_errno; /* Errno. */
- } pr_info; /* Info associated with signal. */
- int16_t pr_cursig; /* Current signal. */
- uint32_t pr_sigpend; /* Set of pending signals. */
- uint32_t pr_sighold; /* Set of held signals. */
- int32_t pr_pid;
- int32_t pr_ppid;
- int32_t pr_pgrp;
- int32_t pr_sid;
- struct i386_timeval
- {
- int32_t tv_sec;
- int32_t tv_usec;
- } pr_utime; /* User time. */
- struct i386_timeval pr_stime; /* System time. */
- struct i386_timeval pr_cutime; /* Cumulative user time. */
- struct i386_timeval pr_cstime; /* Cumulative system time. */
- uint32_t pr_reg[17]; /* GP registers. */
- int32_t pr_fpvalid; /* True if math copro being used. */
+#define GR(at, n, dwreg) \
+ { .offset = at * 4, .regno = dwreg, .count = n, .bits = 32 }
+#define SR(at, n, dwreg) \
+ { .offset = at * 4, .regno = dwreg, .count = n, .bits = 16, .pad = 2 }
+
+ GR (0, 1, 3), /* %ebx */
+ GR (1, 2, 1), /* %ecx-%edx */
+ GR (3, 2, 6), /* %esi-%edi */
+ GR (5, 1, 5), /* %ebp */
+ GR (6, 1, 0), /* %eax */
+ SR (7, 1, 43), /* %ds */
+ SR (8, 1, 40), /* %es */
+ SR (9, 1, 44), /* %fs */
+ SR (10, 1, 45), /* %gs */
+ /* 11, 1, orig_eax */
+ GR (12, 1, 8), /* %eip */
+ SR (13, 1, 41), /* %cs */
+ GR (14, 1, 9), /* eflags */
+ GR (15, 1, 4), /* %esp */
+ SR (16, 1, 42), /* %ss */
+
+#undef GR
+#undef SR
};
+#define PRSTATUS_REGS_SIZE (17 * 4)
+
+#define ULONG uint32_t
+#define PID_T int32_t
+#define UID_T uint16_t
+#define GID_T uint16_t
+#define ALIGN_ULONG 4
+#define ALIGN_PID_T 4
+#define ALIGN_UID_T 2
+#define ALIGN_GID_T 2
+#define TYPE_ULONG ELF_T_WORD
+#define TYPE_PID_T ELF_T_SWORD
+#define TYPE_UID_T ELF_T_HALF
+#define TYPE_GID_T ELF_T_HALF
+
+#define PRSTATUS_REGSET_ITEMS \
+ { \
+ .name = "orig_eax", .type = ELF_T_SWORD, .format = 'd', \
+ .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 11), \
+ .group = "register" \
+ }
+
+static const Ebl_Register_Location fpregset_regs[] =
+ {
+ { .offset = 0, .regno = 37, .count = 2, .bits = 32 }, /* fctrl-fstat */
+ { .offset = 7 * 4, .regno = 11, .count = 8, .bits = 80 }, /* stN */
+ };
+#define FPREGSET_SIZE 108
-
-struct elf_prpsinfo
+static const Ebl_Register_Location prxfpreg_regs[] =
{
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- uint32_t pr_flag; /* Flags. */
- uint16_t pr_uid;
- uint16_t pr_gid;
- int32_t pr_pid;
- int32_t pr_ppid;
- int32_t pr_pgrp;
- int32_t pr_sid;
- /* Lots missing */
- char pr_fname[16]; /* Filename of executable. */
- char pr_psargs[80]; /* Initial part of arg list. */
+ { .offset = 0, .regno = 37, .count = 2, .bits = 16 }, /* fctrl-fstat */
+ { .offset = 24, .regno = 39, .count = 1, .bits = 32 }, /* mxcsr */
+ { .offset = 32, .regno = 11, .count = 8, .bits = 80, .pad = 6 }, /* stN */
+ { .offset = 32 + 128, .regno = 21, .count = 8, .bits = 128 }, /* xmm */
};
+#define EXTRA_NOTES \
+ EXTRA_REGSET (NT_PRFPXREG, 512, prxfpreg_regs)
-bool
-i386_core_note (name, type, descsz, desc)
- const char *name __attribute__ ((unused));
- uint32_t type;
- uint32_t descsz;
- const char *desc;
-{
- bool result = false;
-
- switch (type)
- {
- case NT_PRSTATUS:
- if (descsz < sizeof (struct elf_prstatus))
- /* Not enough data. */
- break;
-
- struct elf_prstatus *stat = (struct elf_prstatus *) desc;
-
- printf (" SIGINFO: signo: %" PRId32 ", code = %" PRId32
- ", errno = %" PRId32 "\n"
- " signal: %" PRId16 ", pending: %08" PRIx32
- ", holding: %8" PRIx32 "\n"
- " pid: %" PRId32 ", ppid = %" PRId32 ", pgrp = %" PRId32
- ", sid = %" PRId32 "\n"
- " utime: %6" PRId32 ".%06" PRId32
- "s, stime: %6" PRId32 ".%06" PRId32 "s\n"
- " cutime: %6" PRId32 ".%06" PRId32
- "s, cstime: %6" PRId32 ".%06" PRId32 "s\n"
- " eax: %08" PRIx32 " ebx: %08" PRIx32 " ecx: %08" PRIx32
- " edx: %08" PRIx32 "\n"
- " esi: %08" PRIx32 " edi: %08" PRIx32 " ebp: %08" PRIx32
- " esp: %08" PRIx32 "\n"
- " eip: %08" PRIx32 " eflags: %08" PRIx32
- " original eax: %08" PRIx32 "\n"
- " cs: %04" PRIx32 " ds: %04" PRIx32 " es: %04" PRIx32
- " fs: %04" PRIx32 " gs: %04" PRIx32 " ss: %04" PRIx32 "\n\n",
- stat->pr_info.si_signo,
- stat->pr_info.si_code,
- stat->pr_info.si_errno,
- stat->pr_cursig,
- stat->pr_sigpend, stat->pr_sighold,
- stat->pr_pid, stat->pr_ppid, stat->pr_pgrp, stat->pr_sid,
- stat->pr_utime.tv_sec, stat->pr_utime.tv_usec,
- stat->pr_stime.tv_sec, stat->pr_stime.tv_usec,
- stat->pr_cutime.tv_sec, stat->pr_cutime.tv_usec,
- stat->pr_cstime.tv_sec, stat->pr_cstime.tv_usec,
- stat->pr_reg[6], stat->pr_reg[0], stat->pr_reg[1],
- stat->pr_reg[2], stat->pr_reg[3], stat->pr_reg[4],
- stat->pr_reg[5], stat->pr_reg[15], stat->pr_reg[12],
- stat->pr_reg[14], stat->pr_reg[11], stat->pr_reg[13] & 0xffff,
- stat->pr_reg[7] & 0xffff, stat->pr_reg[8] & 0xffff,
- stat->pr_reg[9] & 0xffff, stat->pr_reg[10] & 0xffff,
- stat->pr_reg[16]);
-
- /* We handled this entry. */
- result = true;
- break;
-
- case NT_PRPSINFO:
- if (descsz < sizeof (struct elf_prpsinfo))
- /* Not enough data. */
- break;
-
- struct elf_prpsinfo *info = (struct elf_prpsinfo *) desc;
-
- printf (" state: %c (%hhd), zombie: %hhd, nice: %hhd\n"
- " flags: %08" PRIx32 ", uid: %" PRId16 ", gid: %" PRId16"\n"
- " pid: %" PRId32 ", ppid: %" PRId32 ", pgrp: %" PRId32
- ", sid: %" PRId32 "\n"
- " fname: %.16s\n"
- " args: %.80s\n\n",
- info->pr_sname, info->pr_state, info->pr_zomb, info->pr_nice,
- info->pr_flag, info->pr_uid, info->pr_gid,
- info->pr_pid, info->pr_ppid, info->pr_pgrp, info->pr_sid,
- info->pr_fname, info->pr_psargs);
-
- /* We handled this entry. */
- result = true;
- break;
-
- default:
- break;
- }
-
- return result;
-}
+#include "linux-core-note.c"
diff --git a/elfutils/backends/i386_init.c b/elfutils/backends/i386_init.c
index 9f240075..f25e1eb9 100644
--- a/elfutils/backends/i386_init.c
+++ b/elfutils/backends/i386_init.c
@@ -1,5 +1,5 @@
/* Initialization of i386 specific backend library.
- Copyright (C) 2000, 2001, 2002, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -56,6 +56,7 @@ i386_init (elf, machine, eh, ehlen)
HOOK (eh, debugscn_p);
HOOK (eh, return_value_location);
HOOK (eh, register_info);
+ HOOK (eh, auxv_info);
return MODVERSION;
}
diff --git a/elfutils/backends/i386_regs.c b/elfutils/backends/i386_regs.c
index a63c5439..5cf0d810 100644
--- a/elfutils/backends/i386_regs.c
+++ b/elfutils/backends/i386_regs.c
@@ -1,5 +1,5 @@
/* Register names and numbers for i386 DWARF.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -125,8 +125,10 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)),
break;
case 37:
+ *bits = 16;
return stpcpy (name, "fctrl") + 1 - name;
case 38:
+ *bits = 16;
return stpcpy (name, "fstat") + 1 - name;
case 39:
return stpcpy (name, "mxcsr") + 1 - name;
diff --git a/elfutils/backends/i386_retval.c b/elfutils/backends/i386_retval.c
index cfd50579..c3bab108 100644
--- a/elfutils/backends/i386_retval.c
+++ b/elfutils/backends/i386_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for Linux/i386 ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -66,7 +66,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -80,7 +81,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -91,9 +92,9 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -105,8 +106,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_ptr_to_member_type:
{
Dwarf_Word size;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 4;
@@ -116,8 +117,9 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
diff --git a/elfutils/backends/ia64_retval.c b/elfutils/backends/ia64_retval.c
index 4100328c..238cd9ef 100644
--- a/elfutils/backends/ia64_retval.c
+++ b/elfutils/backends/ia64_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for IA64 ABI.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -119,8 +119,8 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used)
return -1;
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem), &encoding) != 0)
return -1;
switch (encoding)
@@ -174,8 +174,9 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used)
case DW_TAG_member:;
Dwarf_Die child_type_mem;
Dwarf_Die *child_typedie
- = dwarf_formref_die (dwarf_attr (&child_mem, DW_AT_type,
- &attr_mem),
+ = dwarf_formref_die (dwarf_attr_integrate (&child_mem,
+ DW_AT_type,
+ &attr_mem),
&child_type_mem);
if (tag == DW_TAG_union_type)
{
@@ -207,10 +208,10 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used)
break;
Dwarf_Die base_type_mem;
- Dwarf_Die *base_typedie = dwarf_formref_die (dwarf_attr (typedie,
- DW_AT_type,
- &attr_mem),
- &base_type_mem);
+ Dwarf_Die *base_typedie
+ = dwarf_formref_die (dwarf_attr_integrate (typedie, DW_AT_type,
+ &attr_mem),
+ &base_type_mem);
int used = hfa_type (base_typedie, locp, 0);
if (used < 0 || used > 8)
@@ -235,7 +236,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -261,9 +263,9 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -273,8 +275,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
@@ -284,8 +286,9 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
switch (encoding)
@@ -343,8 +346,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
return -1;
/* If this qualifies as an homogeneous floating-point aggregate
diff --git a/elfutils/backends/linux-core-note.c b/elfutils/backends/linux-core-note.c
new file mode 100644
index 00000000..3dc41373
--- /dev/null
+++ b/elfutils/backends/linux-core-note.c
@@ -0,0 +1,222 @@
+/* Common core note type descriptions for Linux.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+/* The including CPU_corenote.c file provides prstatus_regs and
+ defines macros ULONG, [PUG]ID_T, and ALIGN_*, TYPE_*.
+
+ Here we describe the common layout used in <linux/elfcore.h>. */
+
+#define CHAR int8_t
+#define ALIGN_CHAR 1
+#define TYPE_CHAR ELF_T_BYTE
+#define SHORT uint16_t
+#define ALIGN_SHORT 2
+#define TYPE_SHORT ELF_T_HALF
+#define INT int32_t
+#define ALIGN_INT 4
+#define TYPE_INT ELF_T_SWORD
+
+#define FIELD(type, name) type name __attribute__ ((aligned (ALIGN_##type)))
+
+struct EBLHOOK(siginfo)
+{
+ FIELD (INT, si_signo);
+ FIELD (INT, si_code);
+ FIELD (INT, si_errno);
+};
+
+struct EBLHOOK(timeval)
+{
+ FIELD (ULONG, tv_sec);
+ FIELD (ULONG, tv_usec);
+};
+
+/* On sparc64, tv_usec (suseconds_t) is actually 32 bits with 32 bits padding.
+ The 'T'|0x80 value for .format indicates this as a special kludge. */
+#if SUSECONDS_HALF
+# define TIMEVAL_FIELD(name) FIELD (time, ULONG, name, 'T'|0x80, .count = 2)
+#else
+# define TIMEVAL_FIELD(name) FIELD (time, ULONG, name, 'T', .count = 2)
+#endif
+
+
+struct EBLHOOK(prstatus)
+{
+ struct EBLHOOK(siginfo) pr_info;
+ FIELD (SHORT, pr_cursig);
+ FIELD (ULONG, pr_sigpend);
+ FIELD (ULONG, pr_sighold);
+ FIELD (PID_T, pr_pid);
+ FIELD (PID_T, pr_ppid);
+ FIELD (PID_T, pr_pgrp);
+ FIELD (PID_T, pr_sid);
+ struct EBLHOOK(timeval) pr_utime;
+ struct EBLHOOK(timeval) pr_stime;
+ struct EBLHOOK(timeval) pr_cutime;
+ struct EBLHOOK(timeval) pr_cstime;
+ FIELD (ULONG, pr_reg[PRSTATUS_REGS_SIZE / sizeof (ULONG)]);
+ FIELD (INT, pr_fpvalid);
+};
+
+#define FNAMESZ 16
+#define PRARGSZ 80
+
+struct EBLHOOK(prpsinfo)
+{
+ FIELD (CHAR, pr_state);
+ FIELD (CHAR, pr_sname);
+ FIELD (CHAR, pr_zomb);
+ FIELD (CHAR, pr_nice);
+ FIELD (ULONG, pr_flag);
+ FIELD (UID_T, pr_uid);
+ FIELD (GID_T, pr_gid);
+ FIELD (PID_T, pr_pid);
+ FIELD (PID_T, pr_ppid);
+ FIELD (PID_T, pr_pgrp);
+ FIELD (PID_T, pr_sid);
+ FIELD (CHAR, pr_fname[FNAMESZ]);
+ FIELD (CHAR, pr_psargs[PRARGSZ]);
+};
+
+#undef FIELD
+
+#define FIELD(igroup, itype, item, fmt, ...) \
+ { \
+ .name = #item, \
+ .group = #igroup, \
+ .offset = offsetof (struct EBLHOOK(prstatus), pr_##item), \
+ .type = TYPE_##itype, \
+ .format = fmt, \
+ __VA_ARGS__ \
+ }
+
+static const Ebl_Core_Item prstatus_items[] =
+ {
+ FIELD (signal, INT, info.si_signo, 'd'),
+ FIELD (signal, INT, info.si_code, 'd'),
+ FIELD (signal, INT, info.si_errno, 'd'),
+ FIELD (signal, SHORT, cursig, 'd'),
+ FIELD (signal, ULONG, sigpend, 'b'),
+ FIELD (signal, ULONG, sighold, 'b'),
+ FIELD (identity, PID_T, pid, 'd', .thread_identifier = true),
+ FIELD (identity, PID_T, ppid, 'd'),
+ FIELD (identity, PID_T, pgrp, 'd'),
+ FIELD (identity, PID_T, sid, 'd'),
+ TIMEVAL_FIELD (utime),
+ TIMEVAL_FIELD (stime),
+ TIMEVAL_FIELD (cutime),
+ TIMEVAL_FIELD (cstime),
+#ifdef PRSTATUS_REGSET_ITEMS
+ PRSTATUS_REGSET_ITEMS,
+#endif
+ FIELD (register, INT, fpvalid, 'd'),
+ };
+
+#undef FIELD
+
+#define FIELD(igroup, itype, item, fmt, ...) \
+ { \
+ .name = #item, \
+ .group = #igroup, \
+ .offset = offsetof (struct EBLHOOK(prpsinfo), pr_##item), \
+ .type = TYPE_##itype, \
+ .format = fmt, \
+ __VA_ARGS__ \
+ }
+
+static const Ebl_Core_Item prpsinfo_items[] =
+ {
+ FIELD (state, CHAR, state, 'd'),
+ FIELD (state, CHAR, sname, 'c'),
+ FIELD (state, CHAR, zomb, 'd'),
+ FIELD (state, CHAR, nice, 'd'),
+ FIELD (state, ULONG, flag, 'x'),
+ FIELD (identity, UID_T, uid, 'd'),
+ FIELD (identity, GID_T, gid, 'd'),
+ FIELD (identity, PID_T, pid, 'd'),
+ FIELD (identity, PID_T, ppid, 'd'),
+ FIELD (identity, PID_T, pgrp, 'd'),
+ FIELD (identity, PID_T, sid, 'd'),
+ FIELD (command, CHAR, fname, 's', .count = FNAMESZ),
+ FIELD (command, CHAR, psargs, 's', .count = PRARGSZ),
+ };
+
+#undef FIELD
+
+int
+EBLHOOK(core_note) (n_type, descsz,
+ regs_offset, nregloc, reglocs, nitems, items)
+ GElf_Word n_type;
+ GElf_Word descsz;
+ GElf_Word *regs_offset;
+ size_t *nregloc;
+ const Ebl_Register_Location **reglocs;
+ size_t *nitems;
+ const Ebl_Core_Item **items;
+{
+ switch (n_type)
+ {
+ case NT_PRSTATUS:
+ if (descsz != sizeof (struct EBLHOOK(prstatus)))
+ return 0;
+ *regs_offset = offsetof (struct EBLHOOK(prstatus), pr_reg);
+ *nregloc = sizeof prstatus_regs / sizeof prstatus_regs[0];
+ *reglocs = prstatus_regs;
+ *nitems = sizeof prstatus_items / sizeof prstatus_items[0];
+ *items = prstatus_items;
+ return 1;
+
+ case NT_PRPSINFO:
+ if (descsz != sizeof (struct EBLHOOK(prpsinfo)))
+ return 0;
+ *regs_offset = 0;
+ *nregloc = 0;
+ *reglocs = NULL;
+ *nitems = sizeof prpsinfo_items / sizeof prpsinfo_items[0];
+ *items = prpsinfo_items;
+ return 1;
+
+#define EXTRA_REGSET(type, size, table) \
+ case type: \
+ if (descsz != size) \
+ return 0; \
+ *regs_offset = 0; \
+ *nregloc = sizeof table / sizeof table[0]; \
+ *reglocs = table; \
+ *nitems = 0; \
+ *items = NULL; \
+ return 1;
+
+#ifdef FPREGSET_SIZE
+ EXTRA_REGSET (NT_FPREGSET, FPREGSET_SIZE, fpregset_regs)
+#endif
+
+#ifdef EXTRA_NOTES
+ EXTRA_NOTES
+#endif
+ }
+
+ return 0;
+}
diff --git a/elfutils/backends/ppc64_corenote.c b/elfutils/backends/ppc64_corenote.c
new file mode 100644
index 00000000..9d6a6a44
--- /dev/null
+++ b/elfutils/backends/ppc64_corenote.c
@@ -0,0 +1,2 @@
+#define BITS 64
+#include "ppc_corenote.c"
diff --git a/elfutils/backends/ppc64_init.c b/elfutils/backends/ppc64_init.c
index 8cd75357..02a592fd 100644
--- a/elfutils/backends/ppc64_init.c
+++ b/elfutils/backends/ppc64_init.c
@@ -1,5 +1,5 @@
/* Initialization of PPC64 specific backend library.
- Copyright (C) 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -58,6 +58,8 @@ ppc64_init (elf, machine, eh, ehlen)
HOOK (eh, bss_plt_p);
HOOK (eh, return_value_location);
HOOK (eh, register_info);
+ HOOK (eh, core_note);
+ HOOK (eh, auxv_info);
return MODVERSION;
}
diff --git a/elfutils/backends/ppc64_retval.c b/elfutils/backends/ppc64_retval.c
index 7f5e6f83..454897cc 100644
--- a/elfutils/backends/ppc64_retval.c
+++ b/elfutils/backends/ppc64_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for Linux/PPC64 ABI.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -69,7 +69,8 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -83,7 +84,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -95,9 +96,9 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -107,8 +108,8 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
@@ -118,8 +119,9 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float || encoding == DW_ATE_complex_float)
@@ -150,20 +152,22 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_string_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size <= 8)
{
if (tag == DW_TAG_array_type)
{
/* Check if it's a character array. */
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
if (tag != DW_TAG_base_type)
goto aggregate;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie,
+ DW_AT_byte_size,
+ &attr_mem),
+ &size) != 0)
return -1;
if (size != 1)
goto aggregate;
diff --git a/elfutils/backends/ppc_auxv.c b/elfutils/backends/ppc_auxv.c
new file mode 100644
index 00000000..1c0a5cfc
--- /dev/null
+++ b/elfutils/backends/ppc_auxv.c
@@ -0,0 +1,52 @@
+/* i386 specific auxv handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND ppc_
+#include "libebl_CPU.h"
+
+int
+EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
+{
+ if (a_type != AT_HWCAP)
+ return 0;
+
+ *name = "HWCAP";
+ *format = "b"
+ "ppcle\0" "truele\0" "3\0" "4\0" "5\0" "6\0" "7\0" "8\0" "9\0"
+ "power6x\0" "dfp\0" "pa6t\0" "arch_2_05\0"
+ "ic_snoop\0" "smt\0" "booke\0" "cellbe\0"
+ "power5+\0" "power5\0" "power4\0" "notb\0"
+ "efpdouble\0" "efpsingle\0" "spe\0" "ucache\0"
+ "4xxmac\0" "mmu\0" "fpu\0" "altivec\0"
+ "ppc601\0" "ppc64\0" "ppc32\0" "\0";
+ return 1;
+}
+
+__typeof (ppc_auxv_info) ppc64_auxv_info
+ __attribute__ ((alias ("ppc_auxv_info")));
diff --git a/elfutils/backends/ppc_corenote.c b/elfutils/backends/ppc_corenote.c
new file mode 100644
index 00000000..daadbb48
--- /dev/null
+++ b/elfutils/backends/ppc_corenote.c
@@ -0,0 +1,115 @@
+/* PowerPC specific core note handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <elf.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#ifndef BITS
+# define BITS 32
+# define BACKEND ppc_
+#else
+# define BITS 64
+# define BACKEND ppc64_
+#endif
+#include "libebl_CPU.h"
+
+static const Ebl_Register_Location prstatus_regs[] =
+ {
+#define GR(at, n, dwreg) \
+ { .offset = at * BITS/8, .regno = dwreg, .count = n, .bits = BITS }
+
+ GR (0, 32, 0), /* r0-r31 */
+ /* 32, 1, nip */
+ GR (33, 1, 66), /* msr */
+ /* 34, 1, orig_gpr3 */
+ GR (35, 1, 109), /* ctr */
+ GR (36, 1, 108), /* lr */
+ GR (37, 1, 101), /* xer */
+ GR (38, 1, 64), /* cr */
+ GR (39, 1, 100), /* mq */
+ /* 40, 1, trap */
+ GR (41, 1, 119), /* dar */
+ GR (42, 1, 118), /* dsisr */
+
+#undef GR
+ };
+#define PRSTATUS_REGS_SIZE (BITS / 8 * 48)
+
+static const Ebl_Register_Location fpregset_regs[] =
+ {
+ { .offset = 0, .regno = 32, .count = 32, .bits = 64 }, /* f0-f31 */
+ { .offset = 32 * 8 + 4, .regno = 65, .count = 1, .bits = 32 } /* fpscr */
+ };
+#define FPREGSET_SIZE (33 * 8)
+
+static const Ebl_Register_Location altivec_regs[] =
+ {
+ /* vr0-vr31 */
+ { .offset = 0, .regno = 1124, .count = 32, .bits = 128 },
+ /* vscr XXX 67 is an unofficial assignment */
+ { .offset = 32 * 16, .regno = 67, .count = 1, .bits = 32, .pad = 12 },
+ /* vrsave */
+ { .offset = 33 * 16, .regno = 356, .count = 1, .bits = 32, .pad = 12 }
+ };
+
+#define EXTRA_NOTES \
+ EXTRA_REGSET (NT_PPC_VMX, 34 * 16, altivec_regs)
+
+#if BITS == 32
+# define ULONG uint32_t
+# define ALIGN_ULONG 4
+# define TYPE_ULONG ELF_T_WORD
+# define TYPE_LONG ELF_T_SWORD
+#else
+# define ULONG uint64_t
+# define ALIGN_ULONG 8
+# define TYPE_ULONG ELF_T_XWORD
+# define TYPE_LONG ELF_T_SXWORD
+#endif
+#define PID_T int32_t
+#define UID_T uint32_t
+#define GID_T uint32_t
+#define ALIGN_PID_T 4
+#define ALIGN_UID_T 4
+#define ALIGN_GID_T 4
+#define TYPE_PID_T ELF_T_SWORD
+#define TYPE_UID_T ELF_T_WORD
+#define TYPE_GID_T ELF_T_WORD
+
+#define PRSTATUS_REGSET_ITEMS \
+ { \
+ .name = "orig_gpr3", .type = TYPE_LONG, .format = 'd', \
+ .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 34), \
+ .group = "register" \
+ }
+
+#include "linux-core-note.c"
diff --git a/elfutils/backends/ppc_init.c b/elfutils/backends/ppc_init.c
index 1dfd5ec9..7edc8fad 100644
--- a/elfutils/backends/ppc_init.c
+++ b/elfutils/backends/ppc_init.c
@@ -1,5 +1,5 @@
/* Initialization of PPC specific backend library.
- Copyright (C) 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -57,6 +57,8 @@ ppc_init (elf, machine, eh, ehlen)
HOOK (eh, bss_plt_p);
HOOK (eh, return_value_location);
HOOK (eh, register_info);
+ HOOK (eh, core_note);
+ HOOK (eh, auxv_info);
return MODVERSION;
}
diff --git a/elfutils/backends/ppc_regs.c b/elfutils/backends/ppc_regs.c
index 3d47d3d0..cc7d84fa 100644
--- a/elfutils/backends/ppc_regs.c
+++ b/elfutils/backends/ppc_regs.c
@@ -1,5 +1,5 @@
/* Register names and numbers for PowerPC DWARF.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -53,14 +53,18 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
if (regno < 32 || regno == 64 || regno == 66)
*setname = "integer";
else if (regno < 64 || regno == 65)
- *setname = "FPU";
- else if (regno < 1124)
- *setname = "privileged";
- else
+ {
+ *setname = "FPU";
+ if (ebl->machine != EM_PPC64 && regno < 64)
+ *bits = 64;
+ }
+ else if (regno == 67 || regno == 356 || regno >= 1124)
{
*setname = "vector";
- *bits = 128;
+ *bits = regno >= 1124 ? 128 : 32;
}
+ else
+ *setname = "privileged";
switch (regno)
{
@@ -96,6 +100,8 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
return stpcpy (name, "fpscr") + 1 - name;
case 66:
return stpcpy (name, "msr") + 1 - name;
+ case 67: /* XXX unofficial assignment */
+ return stpcpy (name, "vscr") + 1 - name;
case 70 + 0 ... 70 + 9:
name[0] = 's';
@@ -112,7 +118,25 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
namelen = 4;
break;
- case 100 ... 109:
+ case 101:
+ return stpcpy (name, "xer") + 1 - name;
+ case 108:
+ return stpcpy (name, "lr") + 1 - name;
+ case 109:
+ return stpcpy (name, "ctr") + 1 - name;
+ case 118:
+ return stpcpy (name, "dsisr") + 1 - name;
+ case 119:
+ return stpcpy (name, "dar") + 1 - name;
+ case 122:
+ return stpcpy (name, "dec") + 1 - name;
+ case 356:
+ return stpcpy (name, "vrsave") + 1 - name;
+ case 100:
+ if (*bits == 32)
+ return stpcpy (name, "mq") + 1 - name;
+
+ case 102 ... 107:
name[0] = 's';
name[1] = 'p';
name[2] = 'r';
@@ -120,7 +144,9 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
namelen = 4;
break;
- case 110 ... 199:
+ case 110 ... 117:
+ case 120 ... 121:
+ case 123 ... 199:
name[0] = 's';
name[1] = 'p';
name[2] = 'r';
@@ -129,7 +155,8 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
namelen = 5;
break;
- case 200 ... 999:
+ case 200 ... 355:
+ case 357 ... 999:
name[0] = 's';
name[1] = 'p';
name[2] = 'r';
diff --git a/elfutils/backends/ppc_retval.c b/elfutils/backends/ppc_retval.c
index b8d86aca..fa0e303c 100644
--- a/elfutils/backends/ppc_retval.c
+++ b/elfutils/backends/ppc_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for Linux/PPC ABI.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -71,7 +71,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -85,7 +86,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -97,9 +98,9 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -109,8 +110,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 4;
@@ -122,8 +123,10 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie,
+ DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
@@ -145,8 +148,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_union_type:
case DW_TAG_array_type:
if (SVR4_STRUCT_RETURN
- && dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ && dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size > 0 && size <= 8)
goto intreg;
goto aggregate;
diff --git a/elfutils/backends/ppc_symbol.c b/elfutils/backends/ppc_symbol.c
index 8a1950c0..9540a3e9 100644
--- a/elfutils/backends/ppc_symbol.c
+++ b/elfutils/backends/ppc_symbol.c
@@ -1,5 +1,5 @@
/* PPC specific symbolic name handling.
- Copyright (C) 2004, 2005 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -122,10 +122,13 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym,
if (strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
{
+ /* In -msecure-plt mode, DT_PPC_GOT is present and must match. */
GElf_Addr gotaddr;
if (find_dyn_got (elf, ehdr, &gotaddr))
return sym->st_value == gotaddr;
- return sym->st_value == destshdr->sh_addr + 4;
+
+ /* In -mbss-plt mode, any place in the section is valid. */
+ return true;
}
const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name);
diff --git a/elfutils/backends/s390_retval.c b/elfutils/backends/s390_retval.c
index 6c430828..15bd97bf 100644
--- a/elfutils/backends/s390_retval.c
+++ b/elfutils/backends/s390_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for S/390 ABI.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -67,7 +67,8 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -81,7 +82,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -93,7 +94,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
@@ -122,8 +123,9 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float && size <= 8)
{
diff --git a/elfutils/backends/sparc64_corenote.c b/elfutils/backends/sparc64_corenote.c
new file mode 100644
index 00000000..cef6431e
--- /dev/null
+++ b/elfutils/backends/sparc64_corenote.c
@@ -0,0 +1,2 @@
+#define BITS 64
+#include "sparc_corenote.c"
diff --git a/elfutils/backends/sparc_auxv.c b/elfutils/backends/sparc_auxv.c
new file mode 100644
index 00000000..a22b3cea
--- /dev/null
+++ b/elfutils/backends/sparc_auxv.c
@@ -0,0 +1,43 @@
+/* SPARC-specific auxv handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND sparc_
+#include "libebl_CPU.h"
+
+int
+EBLHOOK(auxv_info) (GElf_Xword a_type, const char **name, const char **format)
+{
+ if (a_type != AT_HWCAP)
+ return 0;
+
+ *name = "HWCAP";
+ *format = "b"
+ "flush\0" "stbar\0" "swap\0" "muldiv\0" "v9\0" "ultra3\0" "v9v\0" "\0";
+ return 1;
+}
diff --git a/elfutils/backends/sparc_corenote.c b/elfutils/backends/sparc_corenote.c
new file mode 100644
index 00000000..55aed8f4
--- /dev/null
+++ b/elfutils/backends/sparc_corenote.c
@@ -0,0 +1,109 @@
+/* PowerPC specific core note handling.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <elf.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#ifndef BITS
+# define BITS 32
+# define BACKEND sparc_
+#else
+# define BITS 64
+# define BACKEND sparc64_
+#endif
+#include "libebl_CPU.h"
+
+#define GR(at, n, dwreg) \
+ { .offset = at * BITS/8, .regno = dwreg, .count = n, .bits = BITS }
+
+static const Ebl_Register_Location prstatus_regs[] =
+ {
+ GR (0, 32, 0), /* %g0-%g7, %o0-%o7, %i0-%i7 */
+#if BITS == 32
+ GR (32, 1, 65), /* %psr */
+ GR (33, 2, 68), /* %pc, %npc */
+ GR (35, 1, 64), /* %y */
+ GR (36, 1, 66), /* %wim, %tbr */
+#else
+ GR (32, 1, 82), /* %state */
+ GR (33, 2, 80), /* %pc, %npc */
+ GR (35, 1, 85), /* %y */
+#endif
+ };
+#define PRSTATUS_REGS_SIZE (BITS / 8 * (32 + (BITS == 32 ? 6 : 4)))
+
+static const Ebl_Register_Location fpregset_regs[] =
+ {
+#if BITS == 32
+ GR (0, 32, 32), /* %f0-%f31 */
+ /* padding word */
+ GR (33, 1, 70), /* %fsr */
+ /* qcnt, q_entrysize, en, q, padding */
+# define FPREGSET_SIZE (34 * 4 + 4 + 64 * 4 + 4)
+#else
+ GR (0, 32, 32), /* %f0-%f31 */
+ GR (32, 1, 83), /* %fsr */
+ /* 33, 1, %gsr */
+ GR (34, 1, 84), /* %fprs */
+# define FPREGSET_SIZE (35 * 8)
+#endif
+ };
+
+#if BITS == 32
+# define ULONG uint32_t
+# define ALIGN_ULONG 4
+# define TYPE_ULONG ELF_T_WORD
+# define TYPE_LONG ELF_T_SWORD
+# define UID_T uint16_t
+# define GID_T uint16_t
+# define ALIGN_UID_T 2
+# define ALIGN_GID_T 2
+# define TYPE_UID_T ELF_T_HALF
+# define TYPE_GID_T ELF_T_HALF
+#else
+# define ULONG uint64_t
+# define ALIGN_ULONG 8
+# define TYPE_ULONG ELF_T_XWORD
+# define TYPE_LONG ELF_T_SXWORD
+# define UID_T uint32_t
+# define GID_T uint32_t
+# define ALIGN_UID_T 4
+# define ALIGN_GID_T 4
+# define TYPE_UID_T ELF_T_WORD
+# define TYPE_GID_T ELF_T_WORD
+# define SUSECONDS_HALF 1
+#endif
+#define PID_T int32_t
+#define ALIGN_PID_T 4
+#define TYPE_PID_T ELF_T_SWORD
+
+#include "linux-core-note.c"
diff --git a/elfutils/backends/sparc_init.c b/elfutils/backends/sparc_init.c
index ba0e08a3..8da845e2 100644
--- a/elfutils/backends/sparc_init.c
+++ b/elfutils/backends/sparc_init.c
@@ -1,5 +1,5 @@
/* Initialization of SPARC specific backend library.
- Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -34,6 +34,7 @@
/* This defines the common reloc hooks based on sparc_reloc.def. */
#include "common-reloc.c"
+extern __typeof (EBLHOOK (core_note)) sparc64_core_note attribute_hidden;
const char *
sparc_init (elf, machine, eh, ehlen)
@@ -55,7 +56,12 @@ sparc_init (elf, machine, eh, ehlen)
eh->name = "SPARC";
sparc_init_reloc (eh);
HOOK (eh, reloc_simple_type);
- //HOOK (eh, core_note);
+ HOOK (eh, machine_flag_check);
+ if (eh->class == ELFCLASS64)
+ eh->core_note = sparc64_core_note;
+ else
+ HOOK (eh, core_note);
+ HOOK (eh, auxv_info);
HOOK (eh, register_info);
HOOK (eh, return_value_location);
diff --git a/elfutils/backends/sparc_retval.c b/elfutils/backends/sparc_retval.c
index cfde0d2f..7cd38273 100644
--- a/elfutils/backends/sparc_retval.c
+++ b/elfutils/backends/sparc_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for SPARC.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 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
@@ -59,7 +59,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -73,7 +74,7 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -85,9 +86,9 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -97,8 +98,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
uint8_t asize;
Dwarf_Die cudie;
@@ -111,8 +112,9 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
@@ -140,8 +142,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size > 0 && size <= 8)
goto intreg;
goto aggregate;
diff --git a/elfutils/backends/sparc_symbol.c b/elfutils/backends/sparc_symbol.c
index 3a261a00..237620c9 100644
--- a/elfutils/backends/sparc_symbol.c
+++ b/elfutils/backends/sparc_symbol.c
@@ -1,5 +1,5 @@
/* SPARC specific symbolic name handling.
- Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Jakub Jelinek <jakub@redhat.com>, 2002.
@@ -55,3 +55,14 @@ sparc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
return ELF_T_NUM;
}
}
+
+/* Check whether machine flags are valid. */
+bool
+sparc_machine_flag_check (GElf_Word flags)
+{
+ return ((flags &~ (EF_SPARCV9_MM
+ | EF_SPARC_LEDATA
+ | EF_SPARC_32PLUS
+ | EF_SPARC_SUN_US1
+ | EF_SPARC_SUN_US3)) == 0);
+}
diff --git a/elfutils/backends/x86_64_corenote.c b/elfutils/backends/x86_64_corenote.c
index 1a37c07b..c2bc72e9 100644
--- a/elfutils/backends/x86_64_corenote.c
+++ b/elfutils/backends/x86_64_corenote.c
@@ -1,7 +1,6 @@
/* x86-64 specific core note handling.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2005.
Red Hat elfutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
@@ -38,147 +37,70 @@
#include "libebl_CPU.h"
-/* We cannot include <sys/procfs.h> since the definition would be for
- the host platform and not always x86-64 as required here. */
-struct elf_prstatus
+static const Ebl_Register_Location prstatus_regs[] =
{
- struct
- {
- int32_t si_signo; /* Signal number. */
- int32_t si_code; /* Extra code. */
- int32_t si_errno; /* Errno. */
- } pr_info; /* Info associated with signal. */
- int16_t pr_cursig; /* Current signal. */
- uint64_t pr_sigpend; /* Set of pending signals. */
- uint64_t pr_sighold; /* Set of held signals. */
- int32_t pr_pid;
- int32_t pr_ppid;
- int32_t pr_pgrp;
- int32_t pr_sid;
- struct x86_64_timeval
- {
- int64_t tv_sec;
- int32_t tv_usec;
- } pr_utime; /* User time. */
- struct x86_64_timeval pr_stime; /* System time. */
- struct x86_64_timeval pr_cutime; /* Cumulative user time. */
- struct x86_64_timeval pr_cstime; /* Cumulative system time. */
- uint64_t pr_reg[27]; /* GP registers. */
- int32_t pr_fpvalid; /* True if math copro being used. */
+#define GR(at, n, dwreg) \
+ { .offset = at * 8, .regno = dwreg, .count = n, .bits = 64 }
+#define SR(at, n, dwreg) \
+ { .offset = at * 8, .regno = dwreg, .count = n, .bits = 16, .pad = 6 }
+
+ GR (0, 1, 15), /* %r15 */
+ GR (1, 1, 14), /* %r14 */
+ GR (2, 1, 13), /* %r13 */
+ GR (3, 1, 12), /* %r12 */
+ GR (4, 1, 6), /* %rbp */
+ GR (5, 1, 3), /* %rbx */
+ GR (6, 1, 11), /* %r11 */
+ GR (7, 1, 10), /* %r10 */
+ GR (8, 1, 9), /* %r9 */
+ GR (9, 1, 8), /* %r8 */
+ GR (10,1, 0), /* %rax */
+ GR (11,1, 2), /* %rcx */
+ GR (12,1, 1), /* %rdx */
+ GR (13,2, 4), /* %rsi-%rdi */
+ /* 15,1, orig_rax */
+ GR (16,1, 16), /* %rip */
+ SR (17,1, 51), /* %cs */
+ GR (18,1, 49), /* %rFLAGS */
+ GR (19,1, 7), /* %rsp */
+ SR (20,1, 52), /* %ss */
+ GR (21,2, 58), /* %fs.base-%gs.base */
+ SR (23,1, 53), /* %ds */
+ SR (24,1, 50), /* %es */
+ SR (25,2, 54), /* %fs-%gs */
+
+#undef GR
+#undef SR
};
-
-
-struct elf_prpsinfo
+#define PRSTATUS_REGS_SIZE (27 * 8)
+
+#define ULONG uint64_t
+#define PID_T int32_t
+#define UID_T uint32_t
+#define GID_T uint32_t
+#define ALIGN_ULONG 8
+#define ALIGN_PID_T 4
+#define ALIGN_UID_T 4
+#define ALIGN_GID_T 4
+#define TYPE_ULONG ELF_T_XWORD
+#define TYPE_PID_T ELF_T_SWORD
+#define TYPE_UID_T ELF_T_SWORD
+#define TYPE_GID_T ELF_T_SWORD
+
+#define PRSTATUS_REGSET_ITEMS \
+ { \
+ .name = "orig_rax", .type = ELF_T_SXWORD, .format = 'd', \
+ .offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (8 * 15), \
+ .group = "register" \
+ }
+
+static const Ebl_Register_Location fpregset_regs[] =
{
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- uint64_t pr_flag; /* Flags. */
- uint32_t pr_uid;
- uint32_t pr_gid;
- int32_t pr_pid;
- int32_t pr_ppid;
- int32_t pr_pgrp;
- int32_t pr_sid;
- /* Lots missing */
- char pr_fname[16]; /* Filename of executable. */
- char pr_psargs[80]; /* Initial part of arg list. */
+ { .offset = 0, .regno = 65, .count = 2, .bits = 16 }, /* fcw-fsw */
+ { .offset = 24, .regno = 64, .count = 1, .bits = 32 }, /* mxcsr */
+ { .offset = 32, .regno = 33, .count = 8, .bits = 80, .pad = 6 }, /* stN */
+ { .offset = 32 + 128, .regno = 17, .count = 16, .bits = 128 }, /* xmm */
};
+#define FPREGSET_SIZE 512
-
-bool
-x86_64_core_note (name, type, descsz, desc)
- const char *name __attribute__ ((unused));
- uint32_t type;
- uint32_t descsz;
- const char *desc;
-{
- bool result = false;
-
- switch (type)
- {
- case NT_PRSTATUS:
- if (descsz < sizeof (struct elf_prstatus))
- /* Not enough data. */
- break;
-
- struct elf_prstatus *stat = (struct elf_prstatus *) desc;
-
- printf (" SIGINFO: signo: %" PRId32 ", code = %" PRId32
- ", errno = %" PRId32 "\n"
- " signal: %" PRId16 ", pending: %#08" PRIx64 ", holding: %#08"
- PRIx64 "\n"
- " pid: %" PRId32 ", ppid = %" PRId32 ", pgrp = %" PRId32
- ", sid = %" PRId32 "\n"
- " utime: %6" PRId64 ".%06" PRId32
- "s, stime: %6" PRId64 ".%06" PRId32 "s\n"
- " cutime: %6" PRId64 ".%06" PRId32
- "s, cstime: %6" PRId64 ".%06" PRId32 "s\n"
- " rax: %016" PRIx64 " rbx: %016" PRIx64 "\n"
- " rcx: %016" PRIx64 " rdx: %016" PRIx64 "\n"
- " rsi: %016" PRIx64 " rdi: %016" PRIx64 "\n"
- " rbp: %016" PRIx64 " rsp: %016" PRIx64 "\n"
- " r8: %016" PRIx64 " r9: %016" PRIx64 "\n"
- " r10: %016" PRIx64 " r11: %016" PRIx64 "\n"
- " r12: %016" PRIx64 " r13: %016" PRIx64 "\n"
- " r14: %016" PRIx64 " r15: %016" PRIx64 "\n"
- " rip: %016" PRIx64 " eflags: %08" PRIx64 "\n"
- " original rax: %016" PRIx64 "\n"
- " cs: %04" PRIx64 " ds: %04" PRIx64 " es: %04" PRIx64
- " ss: %04" PRIx64 "\n"
- " fs: %04" PRIx64 " fs_base: %016" PRIx64
- " gs: %04" PRIx64 " gs_base: %016" PRIx64 "\n\n",
- stat->pr_info. si_signo,
- stat->pr_info. si_code,
- stat->pr_info. si_errno,
- stat->pr_cursig,
- stat->pr_sigpend, stat->pr_sighold,
- stat->pr_pid, stat->pr_ppid, stat->pr_pgrp, stat->pr_sid,
- stat->pr_utime.tv_sec, stat->pr_utime.tv_usec,
- stat->pr_stime.tv_sec, stat->pr_stime.tv_usec,
- stat->pr_cutime.tv_sec, stat->pr_cutime.tv_usec,
- stat->pr_cstime.tv_sec, stat->pr_cstime.tv_usec,
- stat->pr_reg[10], stat->pr_reg[5], stat->pr_reg[11],
- stat->pr_reg[12], stat->pr_reg[13], stat->pr_reg[14],
- stat->pr_reg[4], stat->pr_reg[10], stat->pr_reg[9],
- stat->pr_reg[7], stat->pr_reg[6], stat->pr_reg[5],
- stat->pr_reg[3], stat->pr_reg[2], stat->pr_reg[1],
- stat->pr_reg[0], stat->pr_reg[16], stat->pr_reg[18],
- stat->pr_reg[15], stat->pr_reg[17], stat->pr_reg[23],
- stat->pr_reg[24], stat->pr_reg[20],
- stat->pr_reg[25], stat->pr_reg[21],
- stat->pr_reg[26], stat->pr_reg[22]);
-
- /* We handled this entry. */
- result = true;
- break;
-
- case NT_PRPSINFO:
- if (descsz < sizeof (struct elf_prpsinfo))
- /* Not enough data. */
- break;
-
- struct elf_prpsinfo *info = (struct elf_prpsinfo *) desc;
-
- printf (" state: %c (%hhd), zombie: %hhd, nice: %hhd\n"
- " flags: %08" PRIx64 " uid: %" PRIu32 " gid: %" PRIu32 "\n"
- " pid: %" PRId32 " ppid: %" PRId32 " pgrp: %" PRId32
- " sid: %" PRId32 "\n"
- " fname: %.16s\n"
- " args: %.80s\n\n",
- info->pr_sname, info->pr_state, info->pr_zomb, info->pr_nice,
- info->pr_flag, info->pr_uid, info->pr_gid,
- info->pr_pid, info->pr_ppid, info->pr_pgrp, info->pr_sid,
- info->pr_fname, info->pr_psargs);
-
- /* We handled this entry. */
- result = true;
- break;
-
- default:
- break;
- }
-
- return result;
-}
+#include "linux-core-note.c"
diff --git a/elfutils/backends/x86_64_init.c b/elfutils/backends/x86_64_init.c
index 476f4ed2..b1764832 100644
--- a/elfutils/backends/x86_64_init.c
+++ b/elfutils/backends/x86_64_init.c
@@ -1,5 +1,5 @@
/* Initialization of x86-64 specific backend library.
- Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2002, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -35,8 +35,6 @@
/* This defines the common reloc hooks based on x86_64_reloc.def. */
#include "common-reloc.c"
-
-
const char *
x86_64_init (elf, machine, eh, ehlen)
Elf *elf __attribute__ ((unused));
@@ -55,6 +53,7 @@ x86_64_init (elf, machine, eh, ehlen)
HOOK (eh, core_note);
HOOK (eh, return_value_location);
HOOK (eh, register_info);
+ HOOK (eh, auxv_info);
return MODVERSION;
}
diff --git a/elfutils/backends/x86_64_regs.c b/elfutils/backends/x86_64_regs.c
index 1128a352..8eb0d33f 100644
--- a/elfutils/backends/x86_64_regs.c
+++ b/elfutils/backends/x86_64_regs.c
@@ -1,5 +1,5 @@
/* Register names and numbers for x86-64 DWARF.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -29,6 +29,7 @@
#include <assert.h>
#include <dwarf.h>
+#include <string.h>
#define BACKEND x86_64_
#include "libebl_CPU.h"
@@ -40,9 +41,9 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
int *bits, int *type)
{
if (name == NULL)
- return 49;
+ return 67;
- if (regno < 0 || regno > 48 || namelen < 6)
+ if (regno < 0 || regno > 66 || namelen < 7)
return -1;
*prefix = "%";
@@ -51,10 +52,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
if (regno < 17)
{
*setname = "integer";
- if (regno == 16 || regno == 6 || regno == 7)
- *type = DW_ATE_address;
- else
- *type = DW_ATE_signed;
+ *type = DW_ATE_signed;
}
else if (regno < 33)
{
@@ -67,11 +65,15 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
*type = DW_ATE_float;
*bits = 80;
}
- else
+ else if (regno < 49)
+ *setname = "MMX";
+ else if (regno > 49 && regno < 60)
{
- *setname = "MMX";
- *bits = 64;
+ *setname = "segment";
+ *bits = 16;
}
+ else
+ *setname = "control";
switch (regno)
{
@@ -80,7 +82,9 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
"ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
};
- case 0 ... 7:
+ case 6 ... 7:
+ *type = DW_ATE_address;
+ case 0 ... 5:
name[0] = 'r';
name[1] = baseregs[regno][0];
name[2] = baseregs[regno][1];
@@ -101,6 +105,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
break;
case 16:
+ *type = DW_ATE_address;
name[0] = 'r';
name[1] = 'i';
name[2] = 'p';
@@ -137,6 +142,39 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
name[2] = regno - 41 + '0';
namelen = 3;
break;
+
+ case 50 ... 55:
+ name[0] = "ecsdfg"[regno - 50];
+ name[1] = 's';
+ namelen = 2;
+ break;
+
+ case 58 ... 59:
+ *type = DW_ATE_address;
+ *bits = 64;
+ name[0] = regno - 58 + 'f';
+ return stpcpy (&name[1], "s.base") + 1 - name;
+
+ case 49:
+ *setname = "integer";
+ return stpcpy (name, "rflags") + 1 - name;
+ case 62:
+ return stpcpy (name, "tr") + 1 - name;
+ case 63:
+ return stpcpy (name, "ldtr") + 1 - name;
+ case 64:
+ return stpcpy (name, "mxcsr") + 1 - name;
+
+ case 65 ... 66:
+ *bits = 16;
+ name[0] = 'f';
+ name[1] = "cs"[regno - 65];
+ name[2] = 'w';
+ namelen = 3;
+ break;
+
+ default:
+ return 0;
}
name[namelen++] = '\0';
diff --git a/elfutils/backends/x86_64_retval.c b/elfutils/backends/x86_64_retval.c
index 1920abf9..3109431e 100644
--- a/elfutils/backends/x86_64_retval.c
+++ b/elfutils/backends/x86_64_retval.c
@@ -1,5 +1,5 @@
/* Function return value location for Linux/x86-64 ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -80,7 +80,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
@@ -94,7 +95,7 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -106,9 +107,9 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
@@ -118,8 +119,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
@@ -129,8 +130,9 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
switch (encoding)
@@ -179,8 +181,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
return -1;
if (size > 16)
goto large;
diff --git a/elfutils/config/ChangeLog b/elfutils/config/ChangeLog
index 43d44ac9..e61bac2c 100644
--- a/elfutils/config/ChangeLog
+++ b/elfutils/config/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-08 Roland McGrath <roland@redhat.com>
+
+ * elfutils.spec.in (License): Canonicalize.
+
+2007-04-23 Roland McGrath <roland@redhat.com>
+
+ * elfutils.spec.in: Distribute eu-unstrip.
+
2005-08-13 Roland McGrath <roland@redhat.com>
* Makefile.am ($(srcdir)/elfutils.spec.in): Add missing $.
diff --git a/elfutils/config/Makefile.in b/elfutils/config/Makefile.in
index afff925d..0458ffd5 100644
--- a/elfutils/config/Makefile.in
+++ b/elfutils/config/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -13,15 +13,11 @@
# 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
@@ -37,29 +33,24 @@ build_triplet = @build@
host_triplet = @host@
subdir = config
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \
- config.guess config.sub depcomp install-sh missing \
- mkinstalldirs
+ config.guess config.sub depcomp install-sh missing ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -72,13 +63,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -93,19 +80,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -117,20 +97,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -143,28 +121,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
EXTRA_DIST = elfutils.spec.in
all: all-am
@@ -198,7 +187,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
tags: TAGS
TAGS:
@@ -207,22 +195,21 @@ 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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -281,12 +268,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -305,16 +300,19 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.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 install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
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
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
$(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS
diff --git a/elfutils/config/config.guess b/elfutils/config/config.guess
index dd1688b7..396482d6 100644..100755
--- a/elfutils/config/config.guess
+++ b/elfutils/config/config.guess
@@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
-timestamp='2004-06-11'
+timestamp='2006-07-02'
# 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
@@ -17,13 +18,15 @@ timestamp='2004-06-11'
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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.
+
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
@@ -53,7 +56,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -66,11 +69,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -104,7 +107,7 @@ 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" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$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 ; } ;
@@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -196,64 +199,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# 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 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -306,40 +268,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
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 ;;
+ exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit 0 ;;
+ exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit 0 ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit 0 ;;
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
- exit 0 ;;
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
+ exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -347,32 +312,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
else
echo pyramid-pyramid-bsd
fi
- exit 0 ;;
+ exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit 0 ;;
+ exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
@@ -381,10 +346,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
+ exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -396,10 +361,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -410,40 +375,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -467,32 +432,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit 0 ;;
+ exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit 0 ;;
+ exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit 0 ;;
+ exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit 0 ;;
+ exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -508,29 +474,29 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit 0 ;;
+ exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit 0 ;;
+ exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit 0 ;;
+ exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
@@ -538,7 +504,7 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
@@ -553,14 +519,18 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit 0 ;;
+ exit ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -574,28 +544,28 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit 0 ;;
+ exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit 0 ;;
+ exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit 0 ;;
+ exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit 0 ;;
+ exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
@@ -657,9 +627,19 @@ EOF
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
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
@@ -667,11 +647,11 @@ EOF
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -699,166 +679,179 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
+ exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit 0 ;;
+ exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit 0 ;;
+ exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit 0 ;;
+ exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit 0 ;;
+ exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit 0 ;;
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit 0 ;;
+ exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
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 ;;
+ exit ;;
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 ;;
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^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 ;;
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
+ exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
+ exit ;;
+ x86:Interix*:[3456]*)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T:Interix*:[3456]*)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
+ exit ;;
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 i586-pc-interix
- exit 0 ;;
+ exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit 0 ;;
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
+ exit ;;
*: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 ;;
+ exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
+ exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit 0 ;;
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -875,8 +868,12 @@ EOF
#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
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
@@ -894,15 +891,22 @@ EOF
#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
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -916,7 +920,7 @@ EOF
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -924,25 +928,28 @@ EOF
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit 0 ;;
+ exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
+ exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -960,15 +967,15 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
+ exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
+ exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -985,7 +992,7 @@ EOF
LIBC=gnulibc1
# endif
#else
- #ifdef __INTEL_COMPILER
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
@@ -995,16 +1002,23 @@ EOF
LIBC=dietlibc
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit 0 ;;
+ exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -1012,27 +1026,27 @@ EOF
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
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 ;;
+ exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
+ exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
+ exit ;;
+ i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
+ exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
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
@@ -1040,15 +1054,16 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit 0 ;;
- i*86:*:5:[78]*)
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1066,73 +1081,73 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit 0 ;;
+ exit ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit 0 ;;
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit 0 ;;
+ exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit 0 ;;
+ exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit 0 ;;
+ exit ;;
M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 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)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 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 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
+ && { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1140,68 +1155,72 @@ EOF
else
echo ns32k-sni-sysv
fi
- exit 0 ;;
+ exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit 0 ;;
+ exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
- exit 0 ;;
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit 0 ;;
+ exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit 0 ;;
+ exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit 0 ;;
+ exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit 0 ;;
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1209,22 +1228,25 @@ EOF
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit 0 ;;
+ exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1235,31 +1257,47 @@ EOF
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit 0 ;;
+ exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit 0 ;;
+ exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit 0 ;;
+ exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit 0 ;;
+ exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit 0 ;;
+ exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit 0 ;;
+ exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1291,7 +1329,7 @@ main ()
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
+ printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
@@ -1380,11 +1418,12 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
@@ -1393,22 +1432,22 @@ then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
c34*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
c38*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
c4*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
esac
fi
@@ -1419,7 +1458,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- ftp://ftp.gnu.org/pub/gnu/config/
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/elfutils/config/config.sub b/elfutils/config/config.sub
index ba331039..fab0aa35 100644..100755
--- a/elfutils/config/config.sub
+++ b/elfutils/config/config.sub
@@ -1,9 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
-timestamp='2004-03-12'
+timestamp='2006-09-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +22,15 @@ timestamp='2004-03-12'
#
# 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.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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.
+
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@@ -70,7 +72,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -83,11 +85,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -99,7 +101,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
- exit 0;;
+ exit ;;
* )
break ;;
@@ -118,8 +120,9 @@ 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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | 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/'`
;;
@@ -145,7 +148,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -170,6 +173,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +193,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -230,14 +241,16 @@ case $basic_machine in
| 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 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | m32r | m32rle | m68000 | m68k | m88k | mcore \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -246,6 +259,7 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
@@ -254,20 +268,24 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | mt \
| msp430 \
+ | nios | nios2 \
| ns16k | ns32k \
- | openrisc | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
- | strongarm \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -278,6 +296,9 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -297,10 +318,10 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
@@ -308,9 +329,9 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
- | m32r-* | m32rle-* \
+ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -319,6 +340,7 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
@@ -326,24 +348,28 @@ case $basic_machine in
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -445,6 +471,10 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
cr16c)
basic_machine=cr16c-unknown
os=-elf
@@ -452,6 +482,9 @@ case $basic_machine in
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
@@ -481,6 +514,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -659,10 +696,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -675,6 +708,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -743,10 +779,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -754,9 +786,8 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
- or32 | or32-*)
+ openrisc | openrisc-*)
basic_machine=or32-unknown
- os=-coff
;;
os400)
basic_machine=powerpc-ibm
@@ -787,6 +818,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -843,6 +880,10 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -869,6 +910,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
sei)
basic_machine=mips-sei
os=-seiux
@@ -1029,6 +1074,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1059,6 +1108,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1075,13 +1127,10 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b)
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
@@ -1154,20 +1203,23 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
| -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* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1185,7 +1237,7 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
@@ -1294,6 +1346,9 @@ case $os in
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
-none)
;;
*)
@@ -1316,6 +1371,12 @@ else
# system, and we'll never get to this point.
case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
*-acorn)
os=-riscix1.2
;;
@@ -1325,9 +1386,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@@ -1371,9 +1432,15 @@ case $basic_machine in
*-be)
os=-beos
;;
+ *-haiku)
+ os=-haiku
+ ;;
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
@@ -1539,7 +1606,7 @@ case $basic_machine in
esac
echo $basic_machine$os
-exit 0
+exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/elfutils/config/depcomp b/elfutils/config/depcomp
index 368e3be9..ca5ea4e1 100644..100755
--- a/elfutils/config/depcomp
+++ b/elfutils/config/depcomp
@@ -1,7 +1,10 @@
#! /bin/sh
-
# depcomp - compile a program generating dependencies as side-effects
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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
@@ -15,8 +18,8 @@
# 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.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -25,22 +28,45 @@
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
-# `libtool' can also be set to `yes' or `no'.
-
-if test -z "$depfile"; then
- base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
- dir=`echo "$object" | sed 's,/.*$,/,'`
- if test "$dir" = "$object"; then
- dir=
- fi
- # FIXME: should be _deps on DOS.
- depfile="$dir.deps/$base"
-fi
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
@@ -66,7 +92,20 @@ gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
stat=$?
if test $stat -eq 0; then :
else
@@ -172,19 +211,25 @@ sgi)
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. This file always lives in the current directory.
- # Also, the AIX compiler puts `$object:' at the start of each line;
- # $object doesn't have directory information.
- stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
- outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
-
stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
@@ -192,6 +237,7 @@ aix)
fi
if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
@@ -206,38 +252,136 @@ aix)
rm -f "$tmpdepfile"
;;
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
tru64)
- # The Tru64 AIX compiler uses -MD to generate dependencies as a side
+ # The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- base=`echo "$object" | sed -e 's/\.o$/.d/' -e 's/\.lo$/.d/'`
- tmpdepfile1="$base.o.d"
- tmpdepfile2="$base.d"
if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- else
- tmpdepfile="$tmpdepfile2"
- fi
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a space and a tab in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
@@ -250,34 +394,42 @@ tru64)
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- test -z "$dashmflag" && dashmflag=-M
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*) # this is libtool, let us make it quiet
- for arg
- do # cycle over the arguments
- case "$arg" in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
;;
esac
- "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
@@ -295,33 +447,37 @@ dashXmstdout)
;;
makedepend)
- # X makedepend
- (
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in no)
- set ""; shift
- cleared=yes
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift;;
- -*)
- ;;
- *)
- set fnord "$@" "$arg"; shift;;
- esac
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
@@ -334,35 +490,40 @@ makedepend)
cpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
;;
esac
- "$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@@ -372,49 +533,27 @@ cpp)
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
+ # always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
- ;;
- esac
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
- *)
+ *)
set fnord "$@" "$arg"
shift
shift
;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
@@ -434,3 +573,12 @@ none)
esac
exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/elfutils/config/elfutils.spec.in b/elfutils/config/elfutils.spec.in
index f3e88228..4f8f3cf7 100644
--- a/elfutils/config/elfutils.spec.in
+++ b/elfutils/config/elfutils.spec.in
@@ -1,9 +1,9 @@
# -*- rpm-spec-*-
-Summary: A collection of utilities and DSOs to handle compiled objects.
+Summary: A collection of utilities and DSOs to handle compiled objects
Name: elfutils
Version: @PACKAGE_VERSION@
Release: 1
-License: GPL
+License: GPLv2 with exceptions
Group: Development/Tools
Source: elfutils-%{version}.tar.gz
Obsoletes: libelf libelf-devel
@@ -139,6 +139,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_bindir}/eu-strings
%{_bindir}/eu-objdump
%{_bindir}/eu-ar
+%{_bindir}/eu-unstrip
#%{_bindir}/eu-ld
#%{_libdir}/libasm-%{version}.so
%{_libdir}/libdw-%{version}.so
@@ -179,6 +180,39 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a
%changelog
+* Sun Nov 11 2007 Ulrich Drepper <drepper@redhat.com> 0.131-1
+- libdw: DW_FORM_ref_addr support; dwarf_formref entry point now depreca
+ted; bug fixes for oddly-formatted DWARF
+- libdwfl: bug fixes in offline archive support, symbol table handling;
+ apply partial relocations for dwfl_module_address_section on
+ET_REL
+- libebl: powerpc backend support for Altivec registers
+
+* Mon Oct 15 2007 Ulrich Drepper <drepper@redhat.com> 0.130-1
+- readelf: -p option can take an argument like -x for one section,
+ or no argument (as before) for all SHF_STRINGS sections;
+ new option --archive-index (or -c); improved -n output fo
+r core files, on many machines
+- libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk;
+ new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
+- readelf, elflint: handle SHT_NOTE sections without requiring phdrs
+- elflint: stricter checks on debug sections
+- libdwfl: new functions dwfl_build_id_find_elf, dwfl_build_id_find_debu
+ginfo, dwfl_module_build_id, dwfl_module_report_build_id; suppo
+rt dynamic symbol tables found via phdrs; dwfl_standard_find_de
+buginfo now uses build IDs when available
+- unstrip: new option --list (or -n)
+- libebl: backend improvements for sparc, alpha, powerpc
+
+* Tue Aug 14 2007 Ulrich Drepper <drepper@redhat.com> 0.129-1
+- readelf: new options --hex-dump (or -x), --strings (or -p)
+- addr2line: new option --symbols (or -S)
+
+* Wed Apr 18 2007 Ulrich Drepper <drepper@redhat.com> 0.127-1
+- libdw: new function dwarf_getsrcdirs
+- libdwfl: new functions dwfl_module_addrsym, dwfl_report_begin_add,
+ dwfl_module_address_section
+
* Mon Feb 5 2007 Ulrich Drepper <drepper@redhat.com> 0.126-1
- new program: ar
@@ -220,7 +254,7 @@ hes.
- Bug fixes.
- dwarf.h updated for DWARF 3.0 final specification.
- libdwfl: New function dwfl_version.
-- The license is now GPL for most files. The libelf, libebl, libdw,and
+- The license is now GPL for most files. The libelf, libebl, libdw,and
libdwfl libraries have additional exceptions. Add reference toOIN.
* Thu Jan 12 2006 Roland McGrath <roland@redhat.com> 0.119-1
diff --git a/elfutils/config/install-sh b/elfutils/config/install-sh
index 398a88e1..4fbbae7b 100644..100755
--- a/elfutils/config/install-sh
+++ b/elfutils/config/install-sh
@@ -1,36 +1,62 @@
#!/bin/sh
-#
# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
+
+scriptversion=2006-10-14.15
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
#
-# Copyright 1991 by the Massachusetts Institute of Technology
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+nl='
+'
+IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
@@ -41,211 +67,441 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+chowncmd=
+chgrpcmd=
+stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ shift
+ shift
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- :
-fi
+ -T) no_target_directory=true
+ shift
+ continue;;
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=$mkdirprog
- fi
-else
+ --version) echo "$0 $scriptversion"; exit $?;;
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
+ --) shift
+ break;;
- if [ -f $src -o -d $src ]
- then
- :
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- :
- fi
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
+ *) break;;
+ esac
+done
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- :
- fi
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
fi
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
- '
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- :
- fi
-
- pathcomp="${pathcomp}/"
-done
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
fi
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
-else
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
-# If we're going to rename the final executable, determine the name now.
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
+ mkdir_mode=
fi
-# don't allow the sed command to completely eliminate the filename
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix=/ ;;
+ -*) prefix=./ ;;
+ *) prefix= ;;
+ esac
+
+ case $posix_glob in
+ '')
+ if (set -f) 2>/dev/null; then
+ posix_glob=true
+ else
+ posix_glob=false
+ fi ;;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob && set -f
+ set fnord $dstdir
+ shift
+ $posix_glob && set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
else
- :
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dst"; then
+ $doit $rmcmd -f "$dst" 2>/dev/null \
+ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+ || {
+ echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ } || exit 1
+
+ trap '' 0
+ fi
+done
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/elfutils/config/missing b/elfutils/config/missing
index dd583709..1c8ff704 100644..100755
--- a/elfutils/config/missing
+++ b/elfutils/config/missing
@@ -1,6 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -15,8 +19,8 @@
# 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.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -29,6 +33,8 @@ if test $# -eq 0; then
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -38,18 +44,24 @@ else
configure_ac=configure.in
fi
-case "$1" in
+msg="missing on your system"
+
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -67,6 +79,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -74,11 +87,15 @@ Supported PROGRAM values:
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.4 - GNU automake"
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
;;
-*)
@@ -87,14 +104,44 @@ Supported PROGRAM values:
exit 1
;;
- aclocal*)
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
fi
+ ;;
+esac
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
@@ -102,13 +149,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autoconf)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
@@ -116,13 +158,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autoheader)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
@@ -130,7 +167,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -140,13 +177,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
automake*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
@@ -156,20 +188,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autom4te)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
proper tools for further handling them.
- You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+ You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -185,74 +212,67 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
bison|yacc)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -262,54 +282,58 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
tar)
shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
- gnutar ${1+"$@"} && exit 0
+ gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
- gtar ${1+"$@"} && exit 0
+ gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
fi
@@ -323,10 +347,10 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
*)
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
+ it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
@@ -334,3 +358,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
esac
exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/elfutils/config/mkinstalldirs b/elfutils/config/mkinstalldirs
deleted file mode 100644
index 4fbbc3e8..00000000
--- a/elfutils/config/mkinstalldirs
+++ /dev/null
@@ -1,101 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id: mkinstalldirs,v 1.1.1.1 2003/08/12 06:44:46 drepper Exp $
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* ) # -h for help
- echo "${usage}" 1>&2; exit 0 ;;
- -m ) # -m PERM arg
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- dirmode="${1}"
- shift ;;
- -- ) shift; break ;; # stop option processing
- -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
- * ) break ;; # first non-opt arg
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
-0) exit 0 ;;
-esac
-
-case $dirmode in
-'')
- if mkdir -p -- . 2>/dev/null; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- fi ;;
-*)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- fi ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
-
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 3
-# End:
-# mkinstalldirs ends here
diff --git a/elfutils/config/ylwrap b/elfutils/config/ylwrap
new file mode 100755
index 00000000..102bd893
--- /dev/null
+++ b/elfutils/config/ylwrap
@@ -0,0 +1,223 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case "$1" in
+ '')
+ echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
+ exit 1
+ ;;
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+ INPUT is the input file
+ OUTPUT is one file PROG generates
+ DESIRED is the file we actually want instead of OUTPUT
+ PROGRAM is program to run
+ ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "ylwrap $scriptversion"
+ exit $?
+ ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+ [\\/]* | ?:[\\/]*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute.
+ input="`pwd`/$input"
+ ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+ if test "$1" = "--"; then
+ shift
+ break
+ fi
+ pairlist="$pairlist $1"
+ shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines. But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+ 0) $prog "$input" ;;
+ *) $prog "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+ set X $pairlist
+ shift
+ first=yes
+ # Since DOS filename conventions don't allow two dots,
+ # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+ # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+ y_tab_nodot="no"
+ if test -f y_tab.c || test -f y_tab.h; then
+ y_tab_nodot="yes"
+ fi
+
+ # The directory holding the input.
+ input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+ # Quote $INPUT_DIR so we can use it in a regexp.
+ # FIXME: really we should care about more than `.' and `\'.
+ input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+ while test "$#" -ne 0; do
+ from="$1"
+ # Handle y_tab.c and y_tab.h output by DOS
+ if test $y_tab_nodot = "yes"; then
+ if test $from = "y.tab.c"; then
+ from="y_tab.c"
+ else
+ if test $from = "y.tab.h"; then
+ from="y_tab.h"
+ fi
+ fi
+ fi
+ if test -f "$from"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend `../'.
+ case "$2" in
+ [\\/]* | ?:[\\/]*) target="$2";;
+ *) target="../$2";;
+ esac
+
+ # We do not want to overwrite a header file if it hasn't
+ # changed. This avoid useless recompilations. However the
+ # parser itself (the first file) should always be updated,
+ # because it is the destination of the .y.c rule in the
+ # Makefile. Divert the output of all other files to a temporary
+ # file so we can compare them to existing versions.
+ if test $first = no; then
+ realtarget="$target"
+ target="tmp-`echo $target | sed s/.*[\\/]//g`"
+ fi
+ # Edit out `#line' or `#' directives.
+ #
+ # We don't want the resulting debug information to point at
+ # an absolute srcdir; it is better for it to just mention the
+ # .y file with no path.
+ #
+ # We want to use the real output file name, not yy.lex.c for
+ # instance.
+ #
+ # We want the include guards to be adjusted too.
+ FROM=`echo "$from" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ TARGET=`echo "$2" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+ sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+ # Check whether header files must be updated.
+ if test $first = no; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$2" is unchanged
+ rm -f "$target"
+ else
+ echo updating "$2"
+ mv -f "$target" "$realtarget"
+ fi
+ fi
+ else
+ # A missing file is only an error for the first file. This
+ # is a blatant hack to let us support using "yacc -d". If -d
+ # is not specified, we don't want an error when the header
+ # file is "missing".
+ if test $first = yes; then
+ ret=1
+ fi
+ fi
+ shift
+ shift
+ first=no
+ done
+else
+ ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/elfutils/configure b/elfutils/configure
index 85e897ac..2777582e 100755
--- a/elfutils/configure
+++ b/elfutils/configure
@@ -1,10 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for Red Hat elfutils 0.126.
+# Generated by GNU Autoconf 2.61 for Red Hat elfutils 0.131.
#
# Report bugs to <http://bugzilla.redhat.com/bugzilla/>.
#
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
#
@@ -13,17 +14,45 @@
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -33,8 +62,43 @@ else
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
@@ -48,18 +112,19 @@ do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -67,157 +132,388 @@ fi
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# CDPATH.
+$as_unset CDPATH
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
fi
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
+ case $as_dir in
/*)
- if ("$as_dir/$as_base" -c '
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
+ chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
@@ -226,7 +522,28 @@ else
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -235,49 +552,172 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
+exec 7<&0 </dev/null 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-exec 6>&1
-
#
# Initializations.
#
ac_default_prefix=/usr/local
+ac_clean_files=
ac_config_libobj_dir=.
+LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
# Identity of this package.
PACKAGE_NAME='Red Hat elfutils'
PACKAGE_TARNAME='elfutils'
-PACKAGE_VERSION='0.126'
-PACKAGE_STRING='Red Hat elfutils 0.126'
+PACKAGE_VERSION='0.131'
+PACKAGE_STRING='Red Hat elfutils 0.131'
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 MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT MODVERSION 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 NEVER_TRUE NEVER_FALSE MUDFLAP_TRUE MUDFLAP_FALSE GPROF_TRUE GPROF_FALSE GCOV_TRUE GCOV_FALSE BUILD_STATIC_TRUE BUILD_STATIC_FALSE TESTS_RPATH_TRUE TESTS_RPATH_FALSE LIBEBL_SUBDIR HAVE_LIBASM_TRUE HAVE_LIBASM_FALSE STANDALONE_TRUE STANDALONE_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+MODVERSION
+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
+YACC
+YFLAGS
+LEX
+LEX_OUTPUT_ROOT
+LEXLIB
+LOCALEDIR
+DATADIRNAME
+NATIVE_LD_TRUE
+NATIVE_LD_FALSE
+base_cpu
+NEVER_TRUE
+NEVER_FALSE
+MUDFLAP_TRUE
+MUDFLAP_FALSE
+GPROF_TRUE
+GPROF_FALSE
+GCOV_TRUE
+GCOV_FALSE
+BUILD_STATIC_TRUE
+BUILD_STATIC_FALSE
+TESTS_RPATH_TRUE
+TESTS_RPATH_FALSE
+LIBEBL_SUBDIR
+HAVE_LIBASM_TRUE
+HAVE_LIBASM_FALSE
+STANDALONE_TRUE
+STANDALONE_FALSE
+USE_NLS
+MSGFMT
+GMSGFMT
+MSGFMT_015
+GMSGFMT_015
+XGETTEXT
+XGETTEXT_015
+MSGMERGE
+LIBOBJS
+LTLIBOBJS'
ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+YACC
+YFLAGS'
+
# Initialize some variables set by options.
ac_init_help=
@@ -304,34 +744,48 @@ x_libraries=NONE
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
ac_prev=
+ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
+ eval $ac_prev=\$ac_option
ac_prev=
continue
fi
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_option in
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -353,33 +807,45 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ -datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -406,6 +872,12 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -430,13 +902,16 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
+ | --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -501,6 +976,16 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
@@ -553,24 +1038,20 @@ do
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=no ;;
--x)
# Obsolete; use --with-x.
@@ -601,8 +1082,7 @@ Try \`$0 --help' for more information." >&2
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
+ eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
@@ -622,27 +1102,19 @@ if test -n "$ac_prev"; then
{ (exit 1); exit 1; }; }
fi
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
do
- eval ac_val=$`echo $ac_var`
+ eval ac_val=\$$ac_var
case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
done
# There might be people who depend on the old broken behavior: `$host'
@@ -669,70 +1141,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
+ if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
- fi
fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
#
# Report the --help message.
@@ -741,7 +1219,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.126 to adapt to many kinds of systems.
+\`configure' configures Red Hat elfutils 0.131 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -761,9 +1239,6 @@ Configuration:
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
-_ACEOF
-
- cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -781,15 +1256,22 @@ Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/elfutils]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -807,7 +1289,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Red Hat elfutils 0.126:";;
+ short | recursive ) echo "Configuration of Red Hat elfutils 0.131:";;
esac
cat <<\_ACEOF
@@ -827,136 +1309,109 @@ Optional Features:
--enable-tests-rpath build $ORIGIN-using rpath into tests
--enable-libebl-subdir=DIR
install libebl_CPU modules in $(libdir)/DIR
+ --disable-nls do not use Native Language Support
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ YACC The `Yet Another C Compiler' implementation to use. Defaults to
+ the first program found out of: `bison -y', `byacc', `yacc'.
+ YFLAGS The list of arguments that will be passed by default to $YACC.
+ This script will default YFLAGS to the empty string to avoid a
+ default value of `-d' given by some make applications.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <http://bugzilla.redhat.com/bugzilla/>.
_ACEOF
+ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
+ test -d "$ac_dir" || continue
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Red Hat elfutils configure 0.126
-generated by GNU Autoconf 2.59
+Red Hat elfutils configure 0.131
+generated by GNU Autoconf 2.61
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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, 2005, 2006, 2007 Red Hat, Inc.
_ACEOF
- exit 0
+ exit
fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_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.126, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+It was created by Red Hat elfutils $as_me 0.131, which was
+generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
_ACEOF
+exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
@@ -975,7 +1430,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
@@ -989,6 +1444,7 @@ do
test -z "$as_dir" && as_dir=.
echo "PATH: $as_dir"
done
+IFS=$as_save_IFS
} >&5
@@ -1010,7 +1466,6 @@ _ACEOF
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
-ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -1021,7 +1476,7 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ *\'*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
@@ -1043,9 +1498,7 @@ do
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
+ ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
@@ -1056,8 +1509,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
@@ -1070,20 +1523,34 @@ trap 'exit_status=$?
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
(set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
*)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-}
+ esac |
+ sort
+)
echo
cat <<\_ASBOX
@@ -1094,22 +1561,28 @@ _ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
@@ -1121,26 +1594,24 @@ _ASBOX
## ----------- ##
_ASBOX
echo
- sed "/^$/d" confdefs.h | sort
+ cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
- ' 0
+' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
# Predefined preprocessor variables.
@@ -1171,14 +1642,17 @@ _ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1194,8 +1668,8 @@ if test -r "$cache_file"; then
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
esac
fi
else
@@ -1207,12 +1681,11 @@ fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1237,8 +1710,7 @@ echo "$as_me: current value: $ac_new_val" >&2;}
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -1255,12 +1727,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
{ (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
-
@@ -1285,40 +1751,52 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+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
ac_aux_dir=
-for ac_dir in config $srcdir/config; do
- if test -f $ac_dir/install-sh; then
+for ac_dir in config "$srcdir"/config; do
+ if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
- elif test -f $ac_dir/install.sh; then
+ elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
- elif test -f $ac_dir/shtool; then
+ elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;}
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
{ (exit 1); exit 1; }; }
fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
- ac_config_files="$ac_config_files config/Makefile"
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+ac_config_files="$ac_config_files config/Makefile"
+
+am__api_version='1.10'
-am__api_version="1.9"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -1332,8 +1810,8 @@ am__api_version="1.9"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1355,7 +1833,7 @@ case $as_dir/ in
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -1374,21 +1852,22 @@ case $as_dir/ in
;;
esac
done
+IFS=$as_save_IFS
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
- # removed, or if the path is relative.
+ # removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -1398,8 +1877,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
@@ -1441,20 +1920,20 @@ echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
test "$program_prefix" != NONE &&
- program_transform_name="s,^,$program_prefix,;$program_transform_name"
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $. echo might interpret backslashes.
# By default was `s,x,x', remove it if useless.
cat <<\_ACEOF >conftest.sed
s/[\\$]/&&/g;s/;s,x,x,$//
_ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -1469,45 +1948,60 @@ else
echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
else
- mkdir_p='$(install_sh) -d'
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
fi
fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1520,54 +2014,57 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$AWK" && break
done
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
all:
- @echo 'ac_maketemp="$(MAKE)"'
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
rm -f conftest.make
fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
SET_MAKE=
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -1580,12 +2077,16 @@ else
fi
rmdir .tst 2>/dev/null
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
+ fi
fi
# test whether we have cygpath
@@ -1600,7 +2101,7 @@ fi
# Define the identity of the package.
PACKAGE='elfutils'
- VERSION='0.126'
+ VERSION='0.131'
cat >>confdefs.h <<_ACEOF
@@ -1628,7 +2129,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
@@ -1638,8 +2139,8 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1652,32 +2153,34 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+ { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1690,33 +2193,47 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- STRIP=$ac_ct_STRIP
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
else
STRIP="$ac_cv_prog_STRIP"
fi
fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -1730,20 +2247,18 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
- # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+ # Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
- enableval="$enable_maintainer_mode"
- USE_MAINTAINER_MODE=$enableval
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
-fi;
- echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
-
+fi
-if test $USE_MAINTAINER_MODE = yes; then
+ { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
@@ -1765,92 +2280,111 @@ _ACEOF
- ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile"
- ac_config_headers="$ac_config_headers config.h"
+ac_config_headers="$ac_config_headers config.h"
-case m4 in
- [\\/]* | ?:[\\/]* ) ac_macro_dir=m4 ;;
- *) ac_macro_dir=$srcdir/m4 ;;
-esac
-if test -d "$ac_macro_dir"; then :
-else
- { { echo "$as_me:$LINENO: error: cannot find macro directory \`m4'" >&5
-echo "$as_me: error: cannot find macro directory \`m4'" >&2;}
- { (exit 1); exit 1; }; }
-fi
- ac_config_files="$ac_config_files m4/Makefile"
+ac_config_files="$ac_config_files m4/Makefile"
- ac_config_files="$ac_config_files elfutils.spec:config/elfutils.spec.in"
+ac_config_files="$ac_config_files elfutils.spec:config/elfutils.spec.in"
# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
{ (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
if test "${ac_cv_build+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
{ { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
if test "${ac_cv_host+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
+fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-# Check whether --enable-tls or --disable-tls was given.
+# Check whether --enable-tls was given.
if test "${enable_tls+set}" = set; then
- enableval="$enable_tls"
- cat >>confdefs.h <<\_ACEOF
+ enableval=$enable_tls; cat >>confdefs.h <<\_ACEOF
#define USE_TLS 1
_ACEOF
-fi;
+fi
+
@@ -1864,8 +2398,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1878,32 +2412,34 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1916,36 +2452,51 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1958,74 +2509,34 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; 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_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-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_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
+ fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2039,7 +2550,7 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -2050,6 +2561,7 @@ do
fi
done
done
+IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -2067,22 +2579,23 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2095,36 +2608,38 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2137,29 +2652,45 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$ac_ct_CC" && break
done
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
fi
fi
@@ -2172,21 +2703,35 @@ See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
@@ -2211,47 +2756,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
break;;
* )
break;;
esac
done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -2263,19 +2838,21 @@ See \`config.log' for more details." >&2;}
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -2294,22 +2871,27 @@ See \`config.log' for more details." >&2;}
fi
fi
fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
@@ -2320,9 +2902,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
break;;
* ) break;;
esac
@@ -2336,14 +2917,14 @@ See \`config.log' for more details." >&2;}
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2363,14 +2944,20 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
@@ -2388,12 +2975,12 @@ fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2416,50 +3003,49 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2475,38 +3061,118 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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 -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_prog_cc_g=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -2522,12 +3188,12 @@ else
CFLAGS=
fi
fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_prog_cc_stdc=no
+ ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -2561,12 +3227,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
+ as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
+ that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -2581,205 +3252,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
return 0;
}
_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
- ac_cv_prog_cc_stdc=$ac_arg
-break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
*)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
esac
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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_objext'
- { (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
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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_objext'
- { (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
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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_objext'
- { (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
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2787,7 +3310,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
DEPDIR="${am__leading_dot}deps"
- ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
@@ -2797,8 +3320,8 @@ am__doit:
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
am__include="#"
am__quote=
_am_result=none
@@ -2825,22 +3348,20 @@ if test "$am__include" = "#"; then
fi
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
rm -f confinc confmf
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
+ enableval=$enable_dependency_tracking;
+fi
-fi;
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
+ if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
@@ -2850,11 +3371,10 @@ fi
-
depcc="$CC" am_compiler_list=
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2918,6 +3438,7 @@ else
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
@@ -2943,13 +3464,11 @@ else
fi
fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-if
+ if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
am__fastdepCC_TRUE=
@@ -2963,8 +3482,8 @@ fi
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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2977,32 +3496,34 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+ { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3015,27 +3536,41 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- RANLIB=$ac_ct_RANLIB
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
@@ -3044,8 +3579,8 @@ for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_YACC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3058,25 +3593,27 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_YACC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
- echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6
+ { echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
@@ -3086,8 +3623,8 @@ for ac_prog in flex lex
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_LEX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3100,253 +3637,182 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_LEX="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
LEX=$ac_cv_prog_LEX
if test -n "$LEX"; then
- echo "$as_me:$LINENO: result: $LEX" >&5
-echo "${ECHO_T}$LEX" >&6
+ { echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$LEX" && break
done
test -n "$LEX" || LEX=":"
-if test -z "$LEXLIB"
-then
- echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
-echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
-if test "${ac_cv_lib_fl_yywrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
+if test "x$LEX" != "x:"; then
+ cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char yywrap ();
int
-main ()
+main (void)
{
-yywrap ();
- ;
- return 0;
+ return ! yylex () + ! yywrap ();
}
_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_try="$LEX conftest.l"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$LEX conftest.l") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_fl_yywrap=yes
+ (exit $ac_status); }
+{ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_fl_yywrap=no
+if test -f lex.yy.c; then
+ ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+ ac_cv_prog_lex_root=lexyy
+else
+ { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
-if test $ac_cv_lib_fl_yywrap = yes; then
- LEXLIB="-lfl"
-else
- echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
-echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
-if test "${ac_cv_lib_l_yywrap+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+ { echo "$as_me:$LINENO: checking lex library" >&5
+echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ll $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char yywrap ();
-int
-main ()
-{
-yywrap ();
- ;
- return 0;
-}
+ ac_save_LIBS=$LIBS
+ ac_cv_lib_lex='none needed'
+ for ac_lib in '' -lfl -ll; do
+ LIBS="$ac_lib $ac_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cv_lib_l_yywrap=yes
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_lex=$ac_lib
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_l_yywrap=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
-if test $ac_cv_lib_l_yywrap = yes; then
- LEXLIB="-ll"
-fi
fi
-fi
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ test "$ac_cv_lib_lex" != 'none needed' && break
+ done
+ LIBS=$ac_save_LIBS
-if test "x$LEX" != "x:"; then
- echo "$as_me:$LINENO: checking lex output file root" >&5
-echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
-if test "${ac_cv_prog_lex_root+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # The minimal lex program is just a single line: %%. But some broken lexes
-# (Solaris, I think it was) want two %% lines, so accommodate them.
-cat >conftest.l <<_ACEOF
-%%
-%%
-_ACEOF
-{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
- (eval $LEX conftest.l) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-if test -f lex.yy.c; then
- ac_cv_prog_lex_root=lex.yy
-elif test -f lexyy.c; then
- ac_cv_prog_lex_root=lexyy
-else
- { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
-echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
- { (exit 1); exit 1; }; }
fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
+ test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
-rm -f conftest.l
-LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
-echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
-echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
+
+{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# POSIX says lex can declare yytext either as a pointer or an array; the
-# default is implementation-dependent. Figure out which it is, since
+# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
-echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS=$LIBS
-LIBS="$LIBS $LEXLIB"
+LIBS="$LEXLIB $ac_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
ac_cv_prog_lex_yytext_pointer=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_save_LIBS
-rm -f "${LEX_OUTPUT_ROOT}.c"
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
if test $ac_cv_prog_lex_yytext_pointer = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -3354,14 +3820,15 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
fi
if test "$LEX" = :; then
LEX=${am_missing_run}flex
fi
-echo "$as_me:$LINENO: checking for gcc with C99 support" >&5
-echo $ECHO_N "checking for gcc with C99 support... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for gcc with C99 support" >&5
+echo $ECHO_N "checking for gcc with C99 support... $ECHO_C" >&6; }
if test "${ac_cv_c99+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3371,39 +3838,35 @@ cat >conftest.$ac_ext <<_ACEOF
int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_c99=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_c99=no
+ ac_cv_c99=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$old_CFLAGS"
fi
-echo "$as_me:$LINENO: result: $ac_cv_c99" >&5
-echo "${ECHO_T}$ac_cv_c99" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c99" >&5
+echo "${ECHO_T}$ac_cv_c99" >&6; }
if test "x$ac_cv_c99" != xyes; then
{ { echo "$as_me:$LINENO: error: gcc with C99 support required" >&5
echo "$as_me: error: gcc with C99 support required" >&2;}
@@ -3423,15 +3886,15 @@ _ACEOF
DATADIRNAME=$datadir
-# Check whether --enable-largefile or --disable-largefile was given.
+# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then
- enableval="$enable_largefile"
+ enableval=$enable_largefile;
+fi
-fi;
if test "$enable_largefile" != no; then
- echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+ { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
if test "${ac_cv_sys_largefile_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3439,8 +3902,8 @@ else
if test "$GCC" != yes; then
ac_save_CC=$CC
while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3464,84 +3927,77 @@ main ()
return 0;
}
_ACEOF
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext
- CC="$CC -n32"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_sys_largefile_CC=' -n32'; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
break
done
CC=$ac_save_CC
rm -f conftest.$ac_ext
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
if test "$ac_cv_sys_largefile_CC" != no; then
CC=$CC$ac_cv_sys_largefile_CC
fi
- echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+ { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
if test "${ac_cv_sys_file_offset_bits+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
while :; do
- ac_cv_sys_file_offset_bits=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3566,34 +4022,31 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
- break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_file_offset_bits=no; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3619,54 +4072,53 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_sys_file_offset_bits=64; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
break
done
fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
-
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
-
-fi
+;;
+esac
rm -f conftest*
- echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
if test "${ac_cv_sys_large_files+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
while :; do
- ac_cv_sys_large_files=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3691,34 +4143,31 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
- break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_sys_large_files=no; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3744,55 +4193,54 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_sys_large_files=1; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
break
done
fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
-
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
cat >>confdefs.h <<_ACEOF
#define _LARGE_FILES $ac_cv_sys_large_files
_ACEOF
-
-fi
+;;
+esac
rm -f conftest*
+ fi
fi
native_ld=no
-# Check whether --enable-generic or --disable-generic was given.
+# Check whether --enable-generic was given.
if test "${enable_generic+set}" = set; then
- enableval="$enable_generic"
- if test "$enable_generic" = no; then
+ enableval=$enable_generic; if test "$enable_generic" = no; then
case "$host_cpu" in
i?86)
cat >>confdefs.h <<\_ACEOF
@@ -3809,12 +4257,11 @@ echo "$as_me: error: no machine-specific linker for this configuration available
;;
esac
fi
-fi;
-
+fi
-if test "$native_ld" = yes; then
+ if test "$native_ld" = yes; then
NATIVE_LD_TRUE=
NATIVE_LD_FALSE='#'
else
@@ -3827,9 +4274,7 @@ if test -z "$base_cpu"; then
fi
-
-
-if false; then
+ if false; then
NEVER_TRUE=
NEVER_FALSE='#'
else
@@ -3839,10 +4284,9 @@ fi
use_mudflap=no
-# Check whether --enable-mudflap or --disable-mudflap was given.
+# Check whether --enable-mudflap was given.
if test "${enable_mudflap+set}" = set; then
- enableval="$enable_mudflap"
- if test "x$enable_mudflap" = xyes; then
+ enableval=$enable_mudflap; if test "x$enable_mudflap" = xyes; then
# Check whether the compiler support -fmudflap.
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fmudflap"
@@ -3862,38 +4306,35 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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_objext'
- { (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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
use_mudflap=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-use_mudflap=fail
+ use_mudflap=fail
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$old_CFLAGS"
fi
-fi;
+fi
+
if test "$use_mudflap" = fail; then
{ { echo "$as_me:$LINENO: error: --enable-mudflap requires a compiler which understands this option
See \`config.log' for more details." >&5
@@ -3901,9 +4342,7 @@ echo "$as_me: error: --enable-mudflap requires a compiler which understands this
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-
-
-if test "$use_mudflap" = yes; then
+ if test "$use_mudflap" = yes; then
MUDFLAP_TRUE=
MUDFLAP_FALSE='#'
else
@@ -3913,20 +4352,18 @@ fi
# Enable gprof suport.
-# Check whether --enable-gprof or --disable-gprof was given.
+# Check whether --enable-gprof was given.
if test "${enable_gprof+set}" = set; then
- enableval="$enable_gprof"
- use_gprof=yes
+ enableval=$enable_gprof; use_gprof=yes
else
use_gprof=no
-fi;
+fi
+
if test "$use_gprof" = yes; then
CFLAGS="$CFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
fi
-
-
-if test "$use_gprof" = yes; then
+ if test "$use_gprof" = yes; then
GPROF_TRUE=
GPROF_FALSE='#'
else
@@ -3936,20 +4373,18 @@ fi
# Enable gcov suport.
-# Check whether --enable-gcov or --disable-gcov was given.
+# Check whether --enable-gcov was given.
if test "${enable_gcov+set}" = set; then
- enableval="$enable_gcov"
- use_gcov=yes
+ enableval=$enable_gcov; use_gcov=yes
else
use_gcov=no
-fi;
+fi
+
if test "$use_gcov" = yes; then
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
LDFLAGS="$LDFLAGS -fprofile-arcs"
fi
-
-
-if test "$use_gcov" = yes; then
+ if test "$use_gcov" = yes; then
GCOV_TRUE=
GCOV_FALSE='#'
else
@@ -3958,9 +4393,7 @@ else
fi
-
-
-if test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes; then
+ if test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes; then
BUILD_STATIC_TRUE=
BUILD_STATIC_FALSE='#'
else
@@ -3969,16 +4402,14 @@ else
fi
-# Check whether --enable-tests-rpath or --disable-tests-rpath was given.
+# Check whether --enable-tests-rpath was given.
if test "${enable_tests_rpath+set}" = set; then
- enableval="$enable_tests_rpath"
- tests_use_rpath=yes
+ enableval=$enable_tests_rpath; tests_use_rpath=yes
else
tests_use_rpath=no
-fi;
-
+fi
-if test "$tests_use_rpath" = yes; then
+ if test "$tests_use_rpath" = yes; then
TESTS_RPATH_TRUE=
TESTS_RPATH_FALSE='#'
else
@@ -3988,11 +4419,11 @@ fi
LIBEBL_SUBDIR="$PACKAGE"
-# Check whether --enable-libebl-subdir or --disable-libebl-subdir was given.
+# Check whether --enable-libebl-subdir was given.
if test "${enable_libebl_subdir+set}" = set; then
- enableval="$enable_libebl_subdir"
- LIBEBL_SUBDIR="$enable_libebl_subdir"
-fi;
+ enableval=$enable_libebl_subdir; LIBEBL_SUBDIR="$enable_libebl_subdir"
+fi
+
cat >>confdefs.h <<_ACEOF
#define LIBEBL_SUBDIR "$LIBEBL_SUBDIR"
@@ -4003,52 +4434,48 @@ _ACEOF
- ac_config_files="$ac_config_files lib/Makefile"
+ac_config_files="$ac_config_files lib/Makefile"
- ac_config_files="$ac_config_files libelf/Makefile libelf-po/Makefile.in"
+ac_config_files="$ac_config_files libelf/Makefile"
- ac_config_files="$ac_config_files libebl/Makefile"
+ac_config_files="$ac_config_files libebl/Makefile"
- ac_config_files="$ac_config_files libdw/Makefile"
+ac_config_files="$ac_config_files libdw/Makefile"
- ac_config_files="$ac_config_files libdwfl/Makefile"
+ac_config_files="$ac_config_files libdwfl/Makefile"
- ac_config_files="$ac_config_files libcpu/Makefile"
+ac_config_files="$ac_config_files libcpu/Makefile"
-
-
-if true; then
+ if true; then
HAVE_LIBASM_TRUE=
HAVE_LIBASM_FALSE='#'
else
HAVE_LIBASM_TRUE='#'
HAVE_LIBASM_FALSE=
fi
- ac_config_files="$ac_config_files libasm/Makefile"
-
+ac_config_files="$ac_config_files libasm/Makefile"
- ac_config_files="$ac_config_files backends/Makefile"
+ac_config_files="$ac_config_files backends/Makefile"
- ac_config_files="$ac_config_files src/Makefile po/Makefile.in"
+ac_config_files="$ac_config_files src/Makefile po/Makefile.in"
-
-if false; then
+ if false; then
STANDALONE_TRUE=
STANDALONE_FALSE='#'
else
STANDALONE_TRUE='#'
STANDALONE_FALSE=
fi
- ac_config_files="$ac_config_files tests/Makefile"
+ac_config_files="$ac_config_files tests/Makefile"
# Get the definitions necessary to create the Makefiles in the po
@@ -4056,59 +4483,96 @@ fi
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
+ { 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 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; }
+
- # Extract the first word of "msgfmt", so it can be a program name with args.
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# 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
+{ 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.
- ;;
+ [\\/]* | ?:[\\/]*)
+ 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 &&
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --statistics /dev/null >&5 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"
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ 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
+ { 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
+ { 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
+{ 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
@@ -4123,130 +4587,193 @@ 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
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
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
+ { 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
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
- # Extract the first word of "xgettext", so it can be a program name with args.
+# 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
+{ 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.
- ;;
+ [\\/]* | ?:[\\/]*)
+ 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"
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /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$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ 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
+ { 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
+ { 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.
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# 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
+{ 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.
- ;;
+ [\\/]* | ?:[\\/]*)
+ 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"
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ 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
+ { 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
+ { 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
+ test -n "$localedir" || localedir='${datadir}/locale'
- 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"
+ ac_config_commands="$ac_config_commands po-directories"
@@ -4272,39 +4799,58 @@ _ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
+ ;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-} |
+ esac |
+ sort
+) |
sed '
+ /^ac_cv_env_/b end
t clear
- : clear
+ :clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- echo "not updating unwritable cache $cache_file"
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -4313,32 +4859,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
@@ -4453,17 +4985,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -4473,8 +5033,43 @@ else
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
@@ -4488,18 +5083,19 @@ do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -4507,159 +5103,120 @@ fi
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
+# CDPATH.
+$as_unset CDPATH
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
@@ -4668,7 +5225,28 @@ else
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -4677,31 +5255,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
exec 6>&1
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by Red Hat elfutils $as_me 0.126, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+# values after options handling.
+ac_log="
+This file was extended by Red Hat elfutils $as_me 0.131, which was
+generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -4709,30 +5270,20 @@ generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
-
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
@@ -4740,7 +5291,7 @@ current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number, then exit
+ -V, --version print version number and configuration settings, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
@@ -4759,19 +5310,22 @@ Configuration commands:
$config_commands
Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-Red Hat elfutils config.status 0.126
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+Red Hat elfutils config.status 0.131
+configured by $0, generated by GNU Autoconf 2.61,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
@@ -4782,39 +5336,24 @@ while test $# != 0
do
case $1 in
--*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- -*)
+ *)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
@@ -4824,18 +5363,24 @@ Try \`$0 --help' for more information." >&2;}
$ac_shift
CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
- *) ac_config_targets="$ac_config_targets $1" ;;
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
esac
shift
@@ -4851,60 +5396,71 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
#
-# INIT-COMMANDS section.
+# INIT-COMMANDS
#
-
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
- # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
- # from automake.
- eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
# Capture the value of LINGUAS because we need it to compute CATALOGS.
LINGUAS="${LINGUAS-%UNSET%}"
_ACEOF
-
-
cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
for ac_config_target in $ac_config_targets
do
- case "$ac_config_target" in
- # Handling of arguments.
- "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
- "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" ;;
- "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" ;;
- "libebl/Makefile" ) CONFIG_FILES="$CONFIG_FILES libebl/Makefile" ;;
- "libdw/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdw/Makefile" ;;
- "libdwfl/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdwfl/Makefile" ;;
- "libcpu/Makefile" ) CONFIG_FILES="$CONFIG_FILES libcpu/Makefile" ;;
- "libasm/Makefile" ) CONFIG_FILES="$CONFIG_FILES libasm/Makefile" ;;
- "backends/Makefile" ) CONFIG_FILES="$CONFIG_FILES backends/Makefile" ;;
- "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
- "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ case $ac_config_target in
+ "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
+ "elfutils.spec") CONFIG_FILES="$CONFIG_FILES elfutils.spec:config/elfutils.spec.in" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "libelf/Makefile") CONFIG_FILES="$CONFIG_FILES libelf/Makefile" ;;
+ "libebl/Makefile") CONFIG_FILES="$CONFIG_FILES libebl/Makefile" ;;
+ "libdw/Makefile") CONFIG_FILES="$CONFIG_FILES libdw/Makefile" ;;
+ "libdwfl/Makefile") CONFIG_FILES="$CONFIG_FILES libdwfl/Makefile" ;;
+ "libcpu/Makefile") CONFIG_FILES="$CONFIG_FILES libcpu/Makefile" ;;
+ "libasm/Makefile") CONFIG_FILES="$CONFIG_FILES libasm/Makefile" ;;
+ "backends/Makefile") CONFIG_FILES="$CONFIG_FILES backends/Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
+
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
@@ -4916,619 +5472,617 @@ if $ac_need_defaults; then
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
-
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
} ||
{
echo "$me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
#
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s,@MAINT@,$MAINT,;t t
-s,@MODVERSION@,$MODVERSION,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-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,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@YACC@,$YACC,;t t
-s,@LEX@,$LEX,;t t
-s,@LEXLIB@,$LEXLIB,;t t
-s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
-s,@LOCALEDIR@,$LOCALEDIR,;t t
-s,@DATADIRNAME@,$DATADIRNAME,;t t
-s,@NATIVE_LD_TRUE@,$NATIVE_LD_TRUE,;t t
-s,@NATIVE_LD_FALSE@,$NATIVE_LD_FALSE,;t t
-s,@base_cpu@,$base_cpu,;t t
-s,@NEVER_TRUE@,$NEVER_TRUE,;t t
-s,@NEVER_FALSE@,$NEVER_FALSE,;t t
-s,@MUDFLAP_TRUE@,$MUDFLAP_TRUE,;t t
-s,@MUDFLAP_FALSE@,$MUDFLAP_FALSE,;t t
-s,@GPROF_TRUE@,$GPROF_TRUE,;t t
-s,@GPROF_FALSE@,$GPROF_FALSE,;t t
-s,@GCOV_TRUE@,$GCOV_TRUE,;t t
-s,@GCOV_FALSE@,$GCOV_FALSE,;t t
-s,@BUILD_STATIC_TRUE@,$BUILD_STATIC_TRUE,;t t
-s,@BUILD_STATIC_FALSE@,$BUILD_STATIC_FALSE,;t t
-s,@TESTS_RPATH_TRUE@,$TESTS_RPATH_TRUE,;t t
-s,@TESTS_RPATH_FALSE@,$TESTS_RPATH_FALSE,;t t
-s,@LIBEBL_SUBDIR@,$LIBEBL_SUBDIR,;t t
-s,@HAVE_LIBASM_TRUE@,$HAVE_LIBASM_TRUE,;t t
-s,@HAVE_LIBASM_FALSE@,$HAVE_LIBASM_FALSE,;t t
-s,@STANDALONE_TRUE@,$STANDALONE_TRUE,;t t
-s,@STANDALONE_FALSE@,$STANDALONE_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
+if test -n "$CONFIG_FILES"; then
_ACEOF
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+MODVERSION!$MODVERSION$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+RANLIB!$RANLIB$ac_delim
+YACC!$YACC$ac_delim
+YFLAGS!$YFLAGS$ac_delim
+LEX!$LEX$ac_delim
+LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+LEXLIB!$LEXLIB$ac_delim
+LOCALEDIR!$LOCALEDIR$ac_delim
+DATADIRNAME!$DATADIRNAME$ac_delim
+NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
+NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+base_cpu!$base_cpu$ac_delim
+NEVER_TRUE!$NEVER_TRUE$ac_delim
+NEVER_FALSE!$NEVER_FALSE$ac_delim
+MUDFLAP_TRUE!$MUDFLAP_TRUE$ac_delim
+MUDFLAP_FALSE!$MUDFLAP_FALSE$ac_delim
+GPROF_TRUE!$GPROF_TRUE$ac_delim
+GPROF_FALSE!$GPROF_FALSE$ac_delim
+GCOV_TRUE!$GCOV_TRUE$ac_delim
+GCOV_FALSE!$GCOV_FALSE$ac_delim
+BUILD_STATIC_TRUE!$BUILD_STATIC_TRUE$ac_delim
+BUILD_STATIC_FALSE!$BUILD_STATIC_FALSE$ac_delim
+TESTS_RPATH_TRUE!$TESTS_RPATH_TRUE$ac_delim
+TESTS_RPATH_FALSE!$TESTS_RPATH_FALSE$ac_delim
+LIBEBL_SUBDIR!$LIBEBL_SUBDIR$ac_delim
+HAVE_LIBASM_TRUE!$HAVE_LIBASM_TRUE$ac_delim
+HAVE_LIBASM_FALSE!$HAVE_LIBASM_FALSE$ac_delim
+STANDALONE_TRUE!$STANDALONE_TRUE$ac_delim
+STANDALONE_FALSE!$STANDALONE_FALSE$ac_delim
+USE_NLS!$USE_NLS$ac_delim
+MSGFMT!$MSGFMT$ac_delim
+GMSGFMT!$GMSGFMT$ac_delim
+MSGFMT_015!$MSGFMT_015$ac_delim
+GMSGFMT_015!$GMSGFMT_015$ac_delim
+XGETTEXT!$XGETTEXT$ac_delim
+XGETTEXT_015!$XGETTEXT_015$ac_delim
+MSGMERGE!$MSGMERGE$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input="Generated from "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
-
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
esac
+_ACEOF
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
esac
-
- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- # Do quote $f, to prevent DOS paths from being IFS'd.
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
- # Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
-
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
_ACEOF
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h. The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status. Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless. Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments. This is necessary, for
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status. If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless. But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
+ac_dB='\\)[ (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+ sed -n '
+ t rset
+ :rset
+ s/^[ ]*#[ ]*define[ ][ ]*//
+ t ok
+ d
+ :ok
+ s/[\\&,]/\\&/g
+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+ ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo ' :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[ #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
do
- # Write a limited-size here document to $tmp/defines.sed.
- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ # Write a here document:
+ cat >>$CONFIG_STATUS <<_ACEOF
+ # First, check the format of the line:
+ cat >"\$tmp/defines.sed" <<\\CEOF
+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
+b
+:def
+_ACEOF
+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
echo 'CEOF
- sed -f $tmp/defines.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+ grep . conftest.tail >/dev/null || break
rm -f conftest.defines
mv conftest.tail conftest.defines
done
-rm -f conftest.defines
-echo ' fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
- # Write a limited-size here document to $tmp/undefs.sed.
- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
- rm -f conftest.undefs
- mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
cat >>$CONFIG_STATUS <<\_ACEOF
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- echo "/* Generated by configure. */" >$tmp/config.h
- else
- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
- fi
- cat $tmp/in >>$tmp/config.h
- rm -f $tmp/in
if test x"$ac_file" != x-; then
- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ echo "/* $configure_input */" >"$tmp/config.h"
+ cat "$ac_result" >>"$tmp/config.h"
+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
rm -f $ac_file
- mv $tmp/config.h $ac_file
+ mv "$tmp/config.h" $ac_file
fi
else
- cat $tmp/config.h
- rm -f $tmp/config.h
+ echo "/* $configure_input */"
+ cat "$ac_result"
fi
+ rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
@@ -5539,135 +6093,39 @@ for _am_header in $config_headers :; do
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$ac_file : 'X\(//\)[^/]' \| \
X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
echo X$ac_file |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
+ :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
@@ -5675,20 +6133,32 @@ echo "$as_me: executing $ac_dest commands" >&6;}
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`(dirname "$mf") 2>/dev/null ||
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
else
continue
fi
@@ -5710,49 +6180,76 @@ echo X"$mf" |
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
- fdir=`(dirname "$file") 2>/dev/null ||
+ fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p $dirpart/$fdir
- else
- as_dir=$dirpart/$fdir
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
-
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
;;
- default-1 )
+ "po-directories":C)
for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"
case "$ac_file" in
@@ -5772,35 +6269,52 @@ done
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
- # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
# on $ac_dir but don't depend on user-specified configuration
# parameters.
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
# The LINGUAS file contains the set of available languages.
- if test -n "$ALL_LINGUAS"; then
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi
- ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
- # Hide the ALL_LINGUAS assigment from automake.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
case "$ac_given_srcdir" in
.) srcdirpre= ;;
*) srcdirpre='$(srcdir)/' ;;
esac
POFILES=
- GMOFILES=
UPDATEPOFILES=
DUMMYPOFILES=
+ GMOFILES=
for lang in $ALL_LINGUAS; do
POFILES="$POFILES $srcdirpre$lang.po"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
done
# CATALOGS depends on both $ac_dir and the user's LINGUAS
# environment variable.
@@ -5835,7 +6349,7 @@ done
done
fi
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
if test -f "$f"; then
case "$f" in
@@ -5848,11 +6362,10 @@ done
;;
esac
done ;;
+
esac
-done
-_ACEOF
+done # for ac_tag
-cat >>$CONFIG_STATUS <<\_ACEOF
{ (exit 0); exit 0; }
_ACEOF
diff --git a/elfutils/configure.ac b/elfutils/configure.ac
index 7b41b9db..b89f9a42 100644
--- a/elfutils/configure.ac
+++ b/elfutils/configure.ac
@@ -16,7 +16,7 @@ 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
dnl
-AC_INIT([Red Hat elfutils],[0.126],[http://bugzilla.redhat.com/bugzilla/],
+AC_INIT([Red Hat elfutils],[0.131],[http://bugzilla.redhat.com/bugzilla/],
[elfutils])
AC_CONFIG_AUX_DIR([config])
@@ -25,7 +25,8 @@ AC_CONFIG_FILES([config/Makefile])
AC_COPYRIGHT([Copyright (C) 1996-2003, 2004, 2005, 2006, 2007 Red Hat, Inc.])
AC_PREREQ(2.59) dnl Minimum Autoconf version required.
-AM_INIT_AUTOMAKE([gnits 1.7])
+dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
+AM_INIT_AUTOMAKE([gnits 1.7 -Wno-portability])
AM_MAINTAINER_MODE
dnl Unique ID for this build.
@@ -180,7 +181,7 @@ dnl Support library.
AC_CONFIG_FILES([lib/Makefile])
dnl ELF library.
-AC_CONFIG_FILES([libelf/Makefile libelf-po/Makefile.in])
+AC_CONFIG_FILES([libelf/Makefile])
dnl Higher-level ELF support library.
AC_CONFIG_FILES([libebl/Makefile])
diff --git a/elfutils/elfutils.spec b/elfutils/elfutils.spec
index cf1952da..25c87bfa 100644
--- a/elfutils/elfutils.spec
+++ b/elfutils/elfutils.spec
@@ -1,9 +1,9 @@
# -*- rpm-spec-*-
-Summary: A collection of utilities and DSOs to handle compiled objects.
+Summary: A collection of utilities and DSOs to handle compiled objects
Name: elfutils
-Version: 0.126
+Version: 0.131
Release: 1
-License: GPL
+License: GPLv2 with exceptions
Group: Development/Tools
Source: elfutils-%{version}.tar.gz
Obsoletes: libelf libelf-devel
@@ -139,6 +139,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_bindir}/eu-strings
%{_bindir}/eu-objdump
%{_bindir}/eu-ar
+%{_bindir}/eu-unstrip
#%{_bindir}/eu-ld
#%{_libdir}/libasm-%{version}.so
%{_libdir}/libdw-%{version}.so
@@ -179,6 +180,39 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a
%changelog
+* Sun Nov 11 2007 Ulrich Drepper <drepper@redhat.com> 0.131-1
+- libdw: DW_FORM_ref_addr support; dwarf_formref entry point now depreca
+ted; bug fixes for oddly-formatted DWARF
+- libdwfl: bug fixes in offline archive support, symbol table handling;
+ apply partial relocations for dwfl_module_address_section on
+ET_REL
+- libebl: powerpc backend support for Altivec registers
+
+* Mon Oct 15 2007 Ulrich Drepper <drepper@redhat.com> 0.130-1
+- readelf: -p option can take an argument like -x for one section,
+ or no argument (as before) for all SHF_STRINGS sections;
+ new option --archive-index (or -c); improved -n output fo
+r core files, on many machines
+- libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk;
+ new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
+- readelf, elflint: handle SHT_NOTE sections without requiring phdrs
+- elflint: stricter checks on debug sections
+- libdwfl: new functions dwfl_build_id_find_elf, dwfl_build_id_find_debu
+ginfo, dwfl_module_build_id, dwfl_module_report_build_id; suppo
+rt dynamic symbol tables found via phdrs; dwfl_standard_find_de
+buginfo now uses build IDs when available
+- unstrip: new option --list (or -n)
+- libebl: backend improvements for sparc, alpha, powerpc
+
+* Tue Aug 14 2007 Ulrich Drepper <drepper@redhat.com> 0.129-1
+- readelf: new options --hex-dump (or -x), --strings (or -p)
+- addr2line: new option --symbols (or -S)
+
+* Wed Apr 18 2007 Ulrich Drepper <drepper@redhat.com> 0.127-1
+- libdw: new function dwarf_getsrcdirs
+- libdwfl: new functions dwfl_module_addrsym, dwfl_report_begin_add,
+ dwfl_module_address_section
+
* Mon Feb 5 2007 Ulrich Drepper <drepper@redhat.com> 0.126-1
- new program: ar
@@ -220,7 +254,7 @@ hes.
- Bug fixes.
- dwarf.h updated for DWARF 3.0 final specification.
- libdwfl: New function dwfl_version.
-- The license is now GPL for most files. The libelf, libebl, libdw,and
+- The license is now GPL for most files. The libelf, libebl, libdw,and
libdwfl libraries have additional exceptions. Add reference toOIN.
* Thu Jan 12 2006 Roland McGrath <roland@redhat.com> 0.119-1
diff --git a/elfutils/lib/Makefile.in b/elfutils/lib/Makefile.in
index 180943f3..4ffe6b0b 100644
--- a/elfutils/lib/Makefile.in
+++ b/elfutils/lib/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -15,15 +15,11 @@
@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
@@ -41,11 +37,11 @@ subdir = lib
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -56,7 +52,7 @@ libeu_a_LIBADD =
am_libeu_a_OBJECTS = xstrndup.$(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)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -70,15 +66,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -91,13 +83,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -112,19 +100,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -136,20 +117,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -162,28 +141,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS)
@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
@@ -250,19 +240,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -313,22 +302,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -389,12 +377,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -414,18 +410,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-tags 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 \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
+ uninstall-am
# 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.
diff --git a/elfutils/libasm/Makefile.in b/elfutils/libasm/Makefile.in
index a9872b0e..b15c689c 100644
--- a/elfutils/libasm/Makefile.in
+++ b/elfutils/libasm/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +16,11 @@
-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
@@ -44,11 +40,11 @@ subdir = libasm
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -86,7 +82,7 @@ PROGRAMS = $(noinst_PROGRAMS)
am_libasm_so_OBJECTS =
libasm_so_OBJECTS = $(am_libasm_so_OBJECTS)
libasm_so_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -103,15 +99,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -124,13 +116,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -145,19 +133,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -169,20 +150,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = 1
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -195,28 +174,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \
@MUDFLAP_FALSE@ -Wextra -Wformat=2
@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -std=gnu99 -Wall -Wshadow -Werror \
@@ -287,7 +277,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
@@ -330,7 +320,7 @@ clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
@MUDFLAP_TRUE@libasm.so$(EXEEXT): $(libasm_so_OBJECTS) $(libasm_so_DEPENDENCIES)
@MUDFLAP_TRUE@ @rm -f libasm.so$(EXEEXT)
-@MUDFLAP_TRUE@ $(LINK) $(libasm_so_LDFLAGS) $(libasm_so_OBJECTS) $(libasm_so_LDADD) $(LIBS)
+@MUDFLAP_TRUE@ $(LINK) $(libasm_so_OBJECTS) $(libasm_so_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -367,22 +357,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbolhash.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
install-euincludeHEADERS: $(euinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)"
+ test -z "$(euincludedir)" || $(MKDIR_P) "$(DESTDIR)$(euincludedir)"
@list='$(euinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -447,22 +436,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -478,7 +466,7 @@ check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
@MUDFLAP_TRUE@install: install-am
install-exec: install-exec-am
@@ -528,12 +516,20 @@ info-am:
install-data-am: install-euincludeHEADERS
+install-dvi: install-dvi-am
+
install-exec-am: install-libLIBRARIES
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -553,21 +549,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \
- uninstall-libLIBRARIES
+uninstall-am: uninstall-euincludeHEADERS uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
ctags distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-euincludeHEADERS install-exec install-exec-am \
- install-info install-info-am install-libLIBRARIES install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-euincludeHEADERS \
- uninstall-info-am uninstall-libLIBRARIES
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-euincludeHEADERS install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-libLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-euincludeHEADERS uninstall-libLIBRARIES
@MUDFLAP_FALSE@libasm.so: libasm_pic.a libasm.map
@MUDFLAP_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
diff --git a/elfutils/libcpu/Makefile.in b/elfutils/libcpu/Makefile.in
index 3f2febcf..689c4062 100644
--- a/elfutils/libcpu/Makefile.in
+++ b/elfutils/libcpu/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +14,11 @@
@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
@@ -39,11 +35,11 @@ host_triplet = @host@
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -53,7 +49,7 @@ libcpu_i386_a_AR = $(AR) $(ARFLAGS)
libcpu_i386_a_LIBADD =
am_libcpu_i386_a_OBJECTS = i386_dis.$(OBJEXT)
libcpu_i386_a_OBJECTS = $(am_libcpu_i386_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -66,15 +62,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -87,13 +79,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -108,19 +96,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -132,20 +113,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -158,28 +137,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
INCLUDES = -I$(srcdir)
noinst_LIBRARIES = libcpu_i386.a
@@ -234,19 +224,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_dis.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -297,22 +286,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -373,12 +361,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -398,18 +394,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-tags 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 \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
+ uninstall-am
# 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.
diff --git a/elfutils/libdw/ChangeLog b/elfutils/libdw/ChangeLog
index 814299b8..b7cd6285 100644
--- a/elfutils/libdw/ChangeLog
+++ b/elfutils/libdw/ChangeLog
@@ -1,3 +1,99 @@
+2007-10-17 Roland McGrath <roland@redhat.com>
+
+ * libdw.h (__deprecated_attribute__): New macro.
+ (dwarf_formref): Mark it deprecated.
+ * dwarf_formref.c (__libdw_formref): New function, broken out of ...
+ (dwarf_formref): ... here. Call it. Remove INTDEF.
+ * libdwP.h: Remove INTDECL.
+ Declare __libdw_formref.
+ * dwarf_siblingof.c (dwarf_siblingof): Call __libdw_formref instead.
+ * dwarf_formref_die.c: Likewise. Handle DW_FORM_ref_addr here.
+
+ * libdw_form.c (__libdw_form_val_len): Fix DW_FORM_ref_addr result,
+ needs to check CU->version.
+
+ * libdwP.h (struct Dwarf_CU): New member `version'.
+ * libdw_findcu.c (__libdw_findcu): Initialize it.
+
+ * dwarf_child.c: Return 1 for null entry as first child.
+
+2007-10-05 Roland McGrath <roland@redhat.com>
+
+ * dwarf_begin_elf.c (check_section): Punt on SHT_NOBITS sections.
+
+ * libdw.h (__extern_inline): Rename to __libdw_extern_inline.
+ [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Update uses.
+
+2007-10-03 Roland McGrath <roland@redhat.com>
+
+ * libdw.map (ELFUTILS_0.130: Add dwfl_build_id_find_elf
+ and dwfl_build_id_find_debuginfo.
+
+ * libdw.map (ELFUTILS_0.130): New version set, inherits from
+ ELFUTILS_0.127. Add dwfl_module_build_id, dwfl_module_report_build_id.
+
+2007-10-02 Roland McGrath <roland@redhat.com>
+
+ * libdw_visit_scopes.c (classify_die): Return walk for class_type and
+ structure_type.
+
+2007-08-07 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getscopes.c (pc_match): Swallow dwarf_haspc error return when
+ error code is DWARF_E_NOERROR (0).
+
+ * dwarf_getscopes.c (pc_record): Always bail early if DIE->prune.
+ Fix typo in __libdw_visit_scopes argument.
+
+ * dwarf_getscopes.c (pc_match): Check dwarf_haspc error return,
+ swallow DWARF_E_NO_DEBUG_RANGES but not other errors.
+
+2007-07-03 Roland McGrath <roland@redhat.com>
+
+ * libdw.h (__extern_inline): New macro.
+ [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
+
+2007-04-16 Roland McGrath <roland@redhat.com>
+
+ * libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
+
+2007-04-05 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getsrcdirs.c: New file.
+ * Makefile.am (libdw_a_SOURCES): Add it.
+ * libdw.h: Declare dwarf_getsrcdirs.
+ * libdw.map (ELFUTILS_0.127): Add it.
+
+ * libdwP.h (struct Dwarf_Files_s): New member ndirs.
+ * dwarf_getsrclines.c (dwarf_getsrclines): Don't clobber NDIRLIST to
+ zero before we use it to check for DWARF_E_INVALID_DIR_IDX.
+ Save DIRARRAY in the Dwarf_Files.
+
+ * dwarf_ranges.c (dwarf_ranges): Don't sign-extend 32-bit BEGIN
+ address to check for all-ones base address entry. Check directly.
+ Reported by Sébastien Dugué <sebastien.dugue@bull.net>.
+
+2007-03-25 Roland McGrath <roland@redhat.com>
+
+ * dwarf_begin_elf.c (check_section): Return Dwarf * instead of void.
+ Return NULL when freeing RESULT on error.
+ (global_read, scngrp_read): Check return value from check_section,
+ break out of loop after it has freed RESULT.
+ (valid_p): Handle null argument.
+
+2007-03-12 Roland McGrath <roland@redhat.com>
+
+ * libdw.map (ELFUTILS_0.127): Add dwfl_report_begin_add.
+
+2007-03-04 Roland McGrath <roland@redhat.com>
+
+ * libdw.map (ELFUTILS_0.127): New version set, inherits from
+ ELFUTILS_0.126. Add dwfl_module_addrsym.
+
+2007-02-10 Roland McGrath <roland@redhat.com>
+
+ * dwarf.h (DW_OP_fbreg): Comment fix.
+
2007-02-03 Roland McGrath <roland@redhat.com>
* dwarf_getelf.c (dwarf_getelf): Renamed from dwarf_get_elf.
diff --git a/elfutils/libdw/Makefile.am b/elfutils/libdw/Makefile.am
index 04d15bbf..62057dc9 100644
--- a/elfutils/libdw/Makefile.am
+++ b/elfutils/libdw/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
+## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -73,7 +73,7 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
dwarf_lineendsequence.c dwarf_lineblock.c \
dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \
dwarf_onesrcline.c dwarf_formblock.c \
- dwarf_getsrcfiles.c dwarf_filesrc.c \
+ dwarf_getsrcfiles.c dwarf_filesrc.c dwarf_getsrcdirs.c \
dwarf_getlocation.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 \
diff --git a/elfutils/libdw/Makefile.in b/elfutils/libdw/Makefile.in
index 8f68c953..25df03a3 100644
--- a/elfutils/libdw/Makefile.in
+++ b/elfutils/libdw/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +16,11 @@
-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
@@ -46,11 +42,11 @@ DIST_COMMON = $(euinclude_HEADERS) $(include_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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -66,9 +62,8 @@ LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
libdw_a_AR = $(AR) $(ARFLAGS)
-am__DEPENDENCIES_1 = ar
-libdw_a_DEPENDENCIES = $(addprefix ../libdwfl/,$(shell \
- $(am__DEPENDENCIES_1) t ../libdwfl/libdwfl.a))
+libdw_a_DEPENDENCIES = $(addprefix ../libdwfl/,$(shell $(AR) t \
+ ../libdwfl/libdwfl.a))
am_libdw_a_OBJECTS = dwarf_begin.$(OBJEXT) dwarf_begin_elf.$(OBJEXT) \
dwarf_end.$(OBJEXT) dwarf_getelf.$(OBJEXT) \
dwarf_getpubnames.$(OBJEXT) dwarf_getabbrev.$(OBJEXT) \
@@ -102,20 +97,20 @@ am_libdw_a_OBJECTS = dwarf_begin.$(OBJEXT) dwarf_begin_elf.$(OBJEXT) \
dwarf_lineprologueend.$(OBJEXT) \
dwarf_lineepiloguebegin.$(OBJEXT) dwarf_onesrcline.$(OBJEXT) \
dwarf_formblock.$(OBJEXT) dwarf_getsrcfiles.$(OBJEXT) \
- dwarf_filesrc.$(OBJEXT) dwarf_getlocation.$(OBJEXT) \
- dwarf_getstring.$(OBJEXT) dwarf_offabbrev.$(OBJEXT) \
- dwarf_getaranges.$(OBJEXT) dwarf_onearange.$(OBJEXT) \
- dwarf_getarangeinfo.$(OBJEXT) dwarf_getarange_addr.$(OBJEXT) \
- dwarf_getattrs.$(OBJEXT) dwarf_formflag.$(OBJEXT) \
- dwarf_getmacros.$(OBJEXT) dwarf_macro_opcode.$(OBJEXT) \
- dwarf_macro_param1.$(OBJEXT) dwarf_macro_param2.$(OBJEXT) \
- dwarf_addrdie.$(OBJEXT) dwarf_getfuncs.$(OBJEXT) \
- dwarf_decl_file.$(OBJEXT) dwarf_decl_line.$(OBJEXT) \
- dwarf_decl_column.$(OBJEXT) dwarf_func_inline.$(OBJEXT) \
- dwarf_getsrc_file.$(OBJEXT) libdw_findcu.$(OBJEXT) \
- libdw_form.$(OBJEXT) libdw_alloc.$(OBJEXT) \
- memory-access.$(OBJEXT) libdw_visit_scopes.$(OBJEXT) \
- dwarf_entry_breakpoints.$(OBJEXT)
+ dwarf_filesrc.$(OBJEXT) dwarf_getsrcdirs.$(OBJEXT) \
+ dwarf_getlocation.$(OBJEXT) dwarf_getstring.$(OBJEXT) \
+ dwarf_offabbrev.$(OBJEXT) dwarf_getaranges.$(OBJEXT) \
+ dwarf_onearange.$(OBJEXT) dwarf_getarangeinfo.$(OBJEXT) \
+ dwarf_getarange_addr.$(OBJEXT) dwarf_getattrs.$(OBJEXT) \
+ dwarf_formflag.$(OBJEXT) dwarf_getmacros.$(OBJEXT) \
+ dwarf_macro_opcode.$(OBJEXT) dwarf_macro_param1.$(OBJEXT) \
+ dwarf_macro_param2.$(OBJEXT) dwarf_addrdie.$(OBJEXT) \
+ dwarf_getfuncs.$(OBJEXT) dwarf_decl_file.$(OBJEXT) \
+ dwarf_decl_line.$(OBJEXT) dwarf_decl_column.$(OBJEXT) \
+ dwarf_func_inline.$(OBJEXT) dwarf_getsrc_file.$(OBJEXT) \
+ libdw_findcu.$(OBJEXT) libdw_form.$(OBJEXT) \
+ libdw_alloc.$(OBJEXT) memory-access.$(OBJEXT) \
+ libdw_visit_scopes.$(OBJEXT) dwarf_entry_breakpoints.$(OBJEXT)
libdw_a_OBJECTS = $(am_libdw_a_OBJECTS)
libdw_pic_a_AR = $(AR) $(ARFLAGS)
libdw_pic_a_LIBADD =
@@ -125,7 +120,7 @@ PROGRAMS = $(noinst_PROGRAMS)
am_libdw_so_OBJECTS =
libdw_so_OBJECTS = $(am_libdw_so_OBJECTS)
libdw_so_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -143,15 +138,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -164,13 +155,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -185,19 +172,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -209,20 +189,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = 1
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -235,28 +213,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \
@MUDFLAP_FALSE@ -Wunused -Wformat=2 -Wextra -std=gnu99
@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Werror \
@@ -293,7 +282,7 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
dwarf_lineendsequence.c dwarf_lineblock.c \
dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \
dwarf_onesrcline.c dwarf_formblock.c \
- dwarf_getsrcfiles.c dwarf_filesrc.c \
+ dwarf_getsrcfiles.c dwarf_filesrc.c dwarf_getsrcdirs.c \
dwarf_getlocation.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 \
@@ -348,7 +337,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
@@ -391,7 +380,7 @@ clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
@MUDFLAP_TRUE@libdw.so$(EXEEXT): $(libdw_so_OBJECTS) $(libdw_so_DEPENDENCIES)
@MUDFLAP_TRUE@ @rm -f libdw.so$(EXEEXT)
-@MUDFLAP_TRUE@ $(LINK) $(libdw_so_LDFLAGS) $(libdw_so_OBJECTS) $(libdw_so_LDADD) $(LIBS)
+@MUDFLAP_TRUE@ $(LINK) $(libdw_so_OBJECTS) $(libdw_so_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -451,6 +440,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_getscopevar.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_getsrcdirs.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@
@@ -491,22 +481,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory-access.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
install-euincludeHEADERS: $(euinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)"
+ test -z "$(euincludedir)" || $(MKDIR_P) "$(DESTDIR)$(euincludedir)"
@list='$(euinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -523,7 +512,7 @@ uninstall-euincludeHEADERS:
done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -588,22 +577,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -619,7 +607,7 @@ check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)" "$(DESTDIR)$(includedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
@MUDFLAP_TRUE@install: install-am
install-exec: install-exec-am
@@ -669,12 +657,20 @@ info-am:
install-data-am: install-euincludeHEADERS install-includeHEADERS
+install-dvi: install-dvi-am
+
install-exec-am: install-libLIBRARIES
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -695,22 +691,25 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-euincludeHEADERS uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLIBRARIES
+ uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
ctags distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-euincludeHEADERS install-exec install-exec-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-euincludeHEADERS install-exec \
+ install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
- install-libLIBRARIES install-man install-strip installcheck \
+ install-libLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-euincludeHEADERS \
- uninstall-includeHEADERS uninstall-info-am \
- uninstall-libLIBRARIES
+ uninstall-includeHEADERS uninstall-libLIBRARIES
@MUDFLAP_FALSE@libdw.so: $(srcdir)/libdw.map libdw_pic.a \
@MUDFLAP_FALSE@ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
diff --git a/elfutils/libdw/dwarf.h b/elfutils/libdw/dwarf.h
index 7791ca17..4b763ffa 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, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2000, 2002, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -418,7 +418,7 @@ enum
DW_OP_breg30 = 0x8e, /* Base register 30. */
DW_OP_breg31 = 0x8f, /* Base register 31. */
DW_OP_regx = 0x90, /* Unsigned LEB128 register. */
- DW_OP_fbreg = 0x91, /* Signed LEB128 register. */
+ DW_OP_fbreg = 0x91, /* Signed LEB128 offset. */
DW_OP_bregx = 0x92, /* ULEB128 register followed by SLEB128 off. */
DW_OP_piece = 0x93, /* ULEB128 size of piece addressed. */
DW_OP_deref_size = 0x94, /* 1-byte size of data retrieved. */
diff --git a/elfutils/libdw/dwarf_begin_elf.c b/elfutils/libdw/dwarf_begin_elf.c
index 312164ca..aaac3999 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, 2005 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -84,7 +84,7 @@ static const char dwarf_scnnames[IDX_last][17] =
#define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
-static void
+static Dwarf *
check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
{
GElf_Shdr shdr_mem;
@@ -97,6 +97,11 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
wrong in the libelf library. */
abort ();
+ /* Ignore any SHT_NOBITS sections. Debugging sections should not
+ have been stripped, but in case of a corrupt file we won't try
+ to look at the missing data. */
+ if (unlikely (shdr->sh_type == SHT_NOBITS))
+ return result;
/* Make sure the section is part of a section group only iff we
really need it. If we are looking for the global (= non-section
@@ -105,7 +110,7 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
a section which isn't part of the section group. */
if (! inscngrp && (shdr->sh_flags & SHF_GROUP) != 0)
/* Ignore the section. */
- return;
+ return result;
/* We recognize the DWARF section by their names. This is not very
@@ -118,7 +123,7 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
invalid. */
__libdw_seterrno (DWARF_E_INVALID_ELF);
free (result);
- return;
+ return NULL;
}
@@ -140,6 +145,8 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
break;
}
+
+ return result;
}
@@ -153,9 +160,11 @@ valid_p (Dwarf *result)
XXX Which sections are absolutely necessary? Add tests if
necessary. For now we require only .debug_info. Hopefully this
is correct. */
- if (unlikely (result->sectiondata[IDX_debug_info] == NULL))
+ if (likely (result != NULL)
+ && unlikely (result->sectiondata[IDX_debug_info] == NULL))
{
__libdw_seterrno (DWARF_E_NO_DWARF);
+ free (result);
result = NULL;
}
@@ -168,8 +177,8 @@ global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr)
{
Elf_Scn *scn = NULL;
- while ((scn = elf_nextscn (elf, scn)) != NULL)
- check_section (result, ehdr, scn, false);
+ while (result != NULL && (scn = elf_nextscn (elf, scn)) != NULL)
+ result = check_section (result, ehdr, scn, false);
return valid_p (result);
}
@@ -204,7 +213,9 @@ scngrp_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Elf_Scn *scngrp)
return NULL;
}
- check_section (result, ehdr, scn, true);
+ result = check_section (result, ehdr, scn, true);
+ if (result == NULL)
+ break;
}
return valid_p (result);
diff --git a/elfutils/libdw/dwarf_child.c b/elfutils/libdw/dwarf_child.c
index 42b38137..b22b010e 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, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -177,6 +177,15 @@ dwarf_child (die, result)
if (addr == NULL)
return -1;
+ /* It's kosher (just suboptimal) to have a null entry first thing (7.5.3).
+ So if this starts with ULEB128 of 0 (even with silly encoding of 0),
+ it is a kosher null entry and we do not really have any children. */
+ const unsigned char *code = addr;
+ while (unlikely (*code == 0x80))
+ ++code;
+ if (unlikely (*code == '\0'))
+ return 1;
+
/* RESULT can be the same as DIE. So preserve what we need. */
struct Dwarf_CU *cu = die->cu;
diff --git a/elfutils/libdw/dwarf_formref.c b/elfutils/libdw/dwarf_formref.c
index ac905c82..7c4fb71a 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, 2005 Red Hat, Inc.
+ Copyright (C) 2003, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -55,15 +55,11 @@
#include <dwarf.h>
#include "libdwP.h"
-
int
-dwarf_formref (attr, return_offset)
+__libdw_formref (attr, return_offset)
Dwarf_Attribute *attr;
Dwarf_Off *return_offset;
{
- if (attr == NULL)
- return -1;
-
const unsigned char *datap;
switch (attr->form)
@@ -100,4 +96,16 @@ dwarf_formref (attr, return_offset)
return 0;
}
-INTDEF(dwarf_formref)
+
+/* This is the old public entry point.
+ It is now deprecated in favor of dwarf_formref_die. */
+int
+dwarf_formref (attr, return_offset)
+ Dwarf_Attribute *attr;
+ Dwarf_Off *return_offset;
+{
+ if (attr == NULL)
+ return -1;
+
+ return __libdw_formref (attr, return_offset);
+}
diff --git a/elfutils/libdw/dwarf_formref_die.c b/elfutils/libdw/dwarf_formref_die.c
index 18ffe2fb..90a4b2d3 100644
--- a/elfutils/libdw/dwarf_formref_die.c
+++ b/elfutils/libdw/dwarf_formref_die.c
@@ -1,5 +1,5 @@
/* Look up the DIE in a reference-form attribute.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -52,13 +52,39 @@
#endif
#include "libdwP.h"
+#include <dwarf.h>
+
Dwarf_Die *
-dwarf_formref_die (Dwarf_Attribute *attr, Dwarf_Die *die_mem)
+dwarf_formref_die (attr, die_mem)
+ Dwarf_Attribute *attr;
+ Dwarf_Die *die_mem;
{
+ if (attr == NULL)
+ return NULL;
+
Dwarf_Off offset;
- return (unlikely (INTUSE(dwarf_formref) (attr, &offset) != 0) ? NULL
- : INTUSE(dwarf_offdie) (attr->cu->dbg, attr->cu->start + offset,
- die_mem));
+ if (attr->form == DW_FORM_ref_addr)
+ {
+ /* This has an absolute offset. */
+
+ uint8_t ref_size = (attr->cu->version == 2
+ ? attr->cu->address_size
+ : attr->cu->offset_size);
+
+ if (ref_size == 8)
+ offset = read_8ubyte_unaligned (attr->cu->dbg, attr->valp);
+ else
+ offset = read_4ubyte_unaligned (attr->cu->dbg, attr->valp);
+ }
+ else
+ {
+ /* Other forms produce an offset from the CU. */
+ if (unlikely (__libdw_formref (attr, &offset) != 0))
+ return NULL;
+ offset += attr->cu->start;
+ }
+
+ return INTUSE(dwarf_offdie) (attr->cu->dbg, offset, die_mem);
}
INTDEF (dwarf_formref_die)
diff --git a/elfutils/libdw/dwarf_getscopes.c b/elfutils/libdw/dwarf_getscopes.c
index f9fa5132..73431ba7 100644
--- a/elfutils/libdw/dwarf_getscopes.c
+++ b/elfutils/libdw/dwarf_getscopes.c
@@ -1,5 +1,5 @@
/* Return scope DIEs containing PC address.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -71,10 +71,32 @@ pc_match (unsigned int depth, struct Dwarf_Die_Chain *die, void *arg)
{
struct args *a = arg;
- if (a->scopes != NULL || INTUSE(dwarf_haspc) (&die->die, a->pc) <= 0)
+ if (a->scopes != NULL)
die->prune = true;
- else if (INTUSE (dwarf_tag) (&die->die) == DW_TAG_inlined_subroutine)
- a->inlined = depth;
+ else
+ {
+ /* dwarf_haspc returns an error if there are no appropriate attributes.
+ But we use it indiscriminantly instead of presuming which tags can
+ have PC attributes. So when it fails for that reason, treat it just
+ as a nonmatching return. */
+ int result = INTUSE(dwarf_haspc) (&die->die, a->pc);
+ if (result < 0)
+ {
+ int error = INTUSE(dwarf_errno) ();
+ if (error != DWARF_E_NOERROR && error != DWARF_E_NO_DEBUG_RANGES)
+ {
+ __libdw_seterrno (error);
+ return -1;
+ }
+ result = 0;
+ }
+ if (result == 0)
+ die->prune = true;
+
+ if (!die->prune
+ && INTUSE (dwarf_tag) (&die->die) == DW_TAG_inlined_subroutine)
+ a->inlined = depth;
+ }
return 0;
}
@@ -119,11 +141,11 @@ pc_record (unsigned int depth, struct Dwarf_Die_Chain *die, void *arg)
{
struct args *a = arg;
+ if (die->prune)
+ return 0;
+
if (a->scopes == NULL)
{
- if (die->prune)
- return 0;
-
/* We have hit the innermost DIE that contains the target PC. */
a->nscopes = depth + 1 - a->inlined;
@@ -175,7 +197,7 @@ pc_record (unsigned int depth, struct Dwarf_Die_Chain *die, void *arg)
If we don't find it, return to search the containing scope.
If we do find it, the nonzero return value will bail us out
of the postorder traversal. */
- return __libdw_visit_scopes (depth, die, &origin_match, NULL, &a);
+ return __libdw_visit_scopes (depth, die, &origin_match, NULL, a);
}
diff --git a/elfutils/libelf/gelf_freechunk.c b/elfutils/libdw/dwarf_getsrcdirs.c
index 7b293ab0..74786dd0 100644
--- a/elfutils/libelf/gelf_freechunk.c
+++ b/elfutils/libdw/dwarf_getsrcdirs.c
@@ -1,7 +1,6 @@
-/* Release uninterpreted chunk of the file contents.
- Copyright (C) 2002 Red Hat, Inc.
+/* Find include directories in source file information.
+ Copyright (C) 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Red Hat elfutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
@@ -52,27 +51,19 @@
# include <config.h>
#endif
-#include <libelf.h>
-#include <stddef.h>
-#include <stdlib.h>
+#include "libdwP.h"
-#include "libelfP.h"
-
-void
-gelf_freechunk (elf, ptr)
- Elf *elf;
- char *ptr;
+int
+dwarf_getsrcdirs (files, result, ndirs)
+ Dwarf_Files *files;
+ const char *const **result;
+ size_t *ndirs;
{
- if (elf == NULL)
- /* No valid descriptor. */
- return;
+ if (files == NULL)
+ return -1;
- /* We do not have to do anything if the pointer returned by
- gelf_rawchunk points into the memory allocated for the ELF
- descriptor. */
- if (ptr < (char *) elf->map_address + elf->start_offset
- || ptr >= ((char *) elf->map_address + elf->start_offset
- + elf->maximum_size))
- free (ptr);
+ *result = (void *) &files->info[files->nfiles];
+ *ndirs = files->ndirs;
+ return 0;
}
diff --git a/elfutils/libdw/dwarf_getsrclines.c b/elfutils/libdw/dwarf_getsrclines.c
index 2aed5d93..666cca22 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, 2005 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -256,13 +256,10 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
/* Rearrange the list in array form. */
struct dirlist **dirarray
= (struct dirlist **) alloca (ndirlist * sizeof (*dirarray));
- while (ndirlist-- > 0)
- {
- dirarray[ndirlist] = dirlist;
- dirlist = dirlist->next;
- }
+ for (unsigned int n = ndirlist; n-- > 0; dirlist = dirlist->next)
+ dirarray[n] = dirlist;
- /* Now read the files. */
+ /* Now read the files. */
struct filelist null_file =
{
.info =
@@ -618,8 +615,11 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
/* Put all the files in an array. */
Dwarf_Files *files = libdw_alloc (dbg, Dwarf_Files,
sizeof (Dwarf_Files)
- + nfilelist * sizeof (Dwarf_Fileinfo),
- 1);
+ + nfilelist * sizeof (Dwarf_Fileinfo)
+ + (ndirlist + 1) * sizeof (char *),
+ 1);
+ const char **dirs = (void *) &files->info[nfilelist];
+
files->nfiles = nfilelist;
while (nfilelist-- > 0)
{
@@ -628,6 +628,12 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
}
assert (filelist == NULL);
+ /* Put all the directory strings in an array. */
+ files->ndirs = ndirlist;
+ for (unsigned int i = 0; i < ndirlist; ++i)
+ dirs[i] = dirarray[i]->dir;
+ dirs[ndirlist] = NULL;
+
/* Remember the debugging descriptor. */
files->dbg = dbg;
diff --git a/elfutils/libdw/dwarf_ranges.c b/elfutils/libdw/dwarf_ranges.c
index 57788da0..89da0af4 100644
--- a/elfutils/libdw/dwarf_ranges.c
+++ b/elfutils/libdw/dwarf_ranges.c
@@ -1,5 +1,5 @@
/* Enumerate the PC ranges covered by a DIE.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -141,18 +141,21 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
{
begin = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
end = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
+ if (begin == (uint64_t) -1l) /* Base address entry. */
+ {
+ *basep = end;
+ goto next;
+ }
}
else
{
- begin = (Dwarf_Sword) read_4sbyte_unaligned_inc (die->cu->dbg,
- readp);
+ begin = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
end = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
- }
-
- if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
- {
- *basep = end;
- goto next;
+ if (begin == (uint32_t) -1) /* Base address entry. */
+ {
+ *basep = end;
+ goto next;
+ }
}
if (begin == 0 && end == 0) /* End of list entry. */
diff --git a/elfutils/libdw/dwarf_siblingof.c b/elfutils/libdw/dwarf_siblingof.c
index 00e5a1c7..a6cca394 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, 2005 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -92,7 +92,7 @@ dwarf_siblingof (die, result)
{
Dwarf_Off offset;
sibattr.valp = addr;
- if (INTUSE(dwarf_formref) (&sibattr, &offset) != 0)
+ if (__libdw_formref (&sibattr, &offset) != 0)
/* Something went wrong. */
return -1;
diff --git a/elfutils/libdw/libdw.h b/elfutils/libdw/libdw.h
index d44f427d..6242d04f 100644
--- a/elfutils/libdw/libdw.h
+++ b/elfutils/libdw/libdw.h
@@ -1,5 +1,5 @@
/* Interfaces for libdw.
- Copyright (C) 2002, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -57,8 +57,17 @@
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
+# define __deprecated_attribute__ __attribute__ ((__deprecated__))
#else
# define __nonnull_attribute__(args...)
+# define __deprecated_attribute__
+#endif
+
+
+#ifdef __GNUC_STDC_INLINE__
+# define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
+#else
+# define __libdw_extern_inline extern __inline
#endif
@@ -304,9 +313,10 @@ extern int dwarf_formsdata (Dwarf_Attribute *attr, Dwarf_Sword *return_uval)
extern int dwarf_formaddr (Dwarf_Attribute *attr, Dwarf_Addr *return_addr)
__nonnull_attribute__ (2);
-/* Return reference offset represented by attribute. */
+/* This function is deprecated. Always use dwarf_formref_die instead.
+ Return reference offset represented by attribute. */
extern int dwarf_formref (Dwarf_Attribute *attr, Dwarf_Off *return_offset)
- __nonnull_attribute__ (2);
+ __nonnull_attribute__ (2) __deprecated_attribute__;
/* Look up the DIE in a reference-form attribute. */
extern Dwarf_Die *dwarf_formref_die (Dwarf_Attribute *attr, Dwarf_Die *die_mem)
@@ -473,6 +483,14 @@ extern const char *dwarf_linesrc (Dwarf_Line *line,
extern const char *dwarf_filesrc (Dwarf_Files *file, size_t idx,
Dwarf_Word *mtime, Dwarf_Word *length);
+/* Return the directory list used in the file information extracted.
+ (*RESULT)[0] is the CU's DW_AT_comp_dir value, and may be null.
+ (*RESULT)[0..*NDIRS-1] are the compile-time include directory path
+ encoded by the compiler. */
+extern int dwarf_getsrcdirs (Dwarf_Files *files,
+ const char *const **result, size_t *ndirs)
+ __nonnull_attribute__ (2, 3);
+
/* Return location expression, decoded as a list of operations. */
extern int dwarf_getlocation (Dwarf_Attribute *attr, Dwarf_Op **expr,
@@ -616,14 +634,14 @@ extern Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler);
/* Inline optimizations. */
#ifdef __OPTIMIZE__
/* Return attribute code of given attribute. */
-extern inline unsigned int
+__libdw_extern_inline unsigned int
dwarf_whatattr (Dwarf_Attribute *attr)
{
return attr == NULL ? 0 : attr->code;
}
/* Return attribute code of given attribute. */
-extern inline unsigned int
+__libdw_extern_inline unsigned int
dwarf_whatform (Dwarf_Attribute *attr)
{
return attr == NULL ? 0 : attr->form;
diff --git a/elfutils/libdw/libdw.map b/elfutils/libdw/libdw.map
index 71e9f50f..8ef5f633 100644
--- a/elfutils/libdw/libdw.map
+++ b/elfutils/libdw/libdw.map
@@ -145,6 +145,7 @@ ELFUTILS_0.122 {
local:
*;
} ELFUTILS_0;
+
ELFUTILS_0.126 {
global:
dwarf_getelf;
@@ -152,3 +153,26 @@ ELFUTILS_0.126 {
local:
*;
} ELFUTILS_0.122;
+
+ELFUTILS_0.127 {
+ global:
+ dwarf_getsrcdirs;
+
+ dwfl_module_addrsym;
+ dwfl_report_begin_add;
+ dwfl_module_address_section;
+
+ local:
+ *;
+} ELFUTILS_0.126;
+
+ELFUTILS_0.130 {
+ global:
+ dwfl_build_id_find_elf;
+ dwfl_build_id_find_debuginfo;
+ dwfl_module_build_id;
+ dwfl_module_report_build_id;
+
+ local:
+ *;
+} ELFUTILS_0.127;
diff --git a/elfutils/libdw/libdwP.h b/elfutils/libdw/libdwP.h
index 8baa3fa3..78fd5ce7 100644
--- a/elfutils/libdw/libdwP.h
+++ b/elfutils/libdw/libdwP.h
@@ -1,5 +1,5 @@
/* Internal definitions for libdwarf.
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -209,6 +209,7 @@ struct Dwarf_Abbrev
struct Dwarf_Files_s
{
Dwarf *dbg;
+ unsigned int ndirs;
unsigned int nfiles;
struct Dwarf_Fileinfo_s
{
@@ -216,6 +217,7 @@ struct Dwarf_Files_s
Dwarf_Word mtime;
Dwarf_Word length;
} info[0];
+ /* nfiles of those, followed by char *[ndirs]. */
};
typedef struct Dwarf_Fileinfo_s Dwarf_Fileinfo;
@@ -265,6 +267,7 @@ struct Dwarf_CU
Dwarf_Off end;
uint8_t address_size;
uint8_t offset_size;
+ uint16_t version;
/* Hash table for the abbreviations. */
Dwarf_Abbrev_Hash abbrev_hash;
@@ -363,6 +366,11 @@ extern size_t __libdw_form_val_len (Dwarf *dbg, struct Dwarf_CU *cu,
const unsigned char *valp)
__nonnull_attribute__ (1, 2, 4) internal_function;
+/* Helper function for DW_FORM_ref* handling. */
+extern int __libdw_formref (Dwarf_Attribute *attr, Dwarf_Off *return_offset)
+ __nonnull_attribute__ (1, 2) internal_function;
+
+
/* Helper function to locate attribute. */
extern unsigned char *__libdw_find_attr (Dwarf_Die *die,
unsigned int search_name,
@@ -409,7 +417,6 @@ INTDECL (dwarf_entrypc)
INTDECL (dwarf_errmsg)
INTDECL (dwarf_formaddr)
INTDECL (dwarf_formblock)
-INTDECL (dwarf_formref)
INTDECL (dwarf_formref_die)
INTDECL (dwarf_formsdata)
INTDECL (dwarf_formstring)
diff --git a/elfutils/libdw/libdw_findcu.c b/elfutils/libdw/libdw_findcu.c
index e6259d49..afff6d3a 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, 2005 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -97,6 +97,7 @@ __libdw_findcu (dbg, start)
if (start < dbg->next_cu_offset)
{
+ invalid:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;
}
@@ -115,6 +116,15 @@ __libdw_findcu (dbg, start)
/* No more entries. */
return NULL;
+ /* XXX We need the version number but dwarf_nextcu swallows it. */
+ const char *bytes = (dbg->sectiondata[IDX_debug_info]->d_buf + oldoff
+ + (2 * offset_size - 4));
+ uint16_t version = read_2ubyte_unaligned (dbg, bytes);
+
+ /* We only know how to handle the DWARF version 2 and 3 formats. */
+ if (unlikely (version != 2) && unlikely (version != 3))
+ goto invalid;
+
/* Create an entry for this CU. */
struct Dwarf_CU *newp = libdw_typed_alloc (dbg, struct Dwarf_CU);
@@ -123,6 +133,7 @@ __libdw_findcu (dbg, start)
newp->end = dbg->next_cu_offset;
newp->address_size = address_size;
newp->offset_size = offset_size;
+ newp->version = version;
Dwarf_Abbrev_Hash_init (&newp->abbrev_hash, 41);
newp->orig_abbrev_offset = newp->last_abbrev_offset = abbrev_offset;
newp->lines = NULL;
diff --git a/elfutils/libdw/libdw_form.c b/elfutils/libdw/libdw_form.c
index 779b6c0e..ad78f4b4 100644
--- a/elfutils/libdw/libdw_form.c
+++ b/elfutils/libdw/libdw_form.c
@@ -1,5 +1,5 @@
/* Helper functions for form handling.
- Copyright (C) 2003, 2004, 2006 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -73,8 +73,11 @@ __libdw_form_val_len (Dwarf *dbg, struct Dwarf_CU *cu, unsigned int form,
result = cu->address_size;
break;
- case DW_FORM_strp:
case DW_FORM_ref_addr:
+ result = cu->version == 2 ? cu->address_size : cu->offset_size;
+ break;
+
+ case DW_FORM_strp:
result = cu->offset_size;
break;
diff --git a/elfutils/libdw/libdw_visit_scopes.c b/elfutils/libdw/libdw_visit_scopes.c
index a7b6994a..9c7c3789 100644
--- a/elfutils/libdw/libdw_visit_scopes.c
+++ b/elfutils/libdw/libdw_visit_scopes.c
@@ -1,5 +1,5 @@
/* Helper functions to descend DWARF scope trees.
- Copyright (C) 2005,2006 Red Hat, Inc.
+ Copyright (C) 2005,2006,2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -80,6 +80,8 @@ classify_die (Dwarf_Die *die)
/* DIEs without addresses that can own DIEs with addresses. */
case DW_TAG_namespace:
+ case DW_TAG_class_type:
+ case DW_TAG_structure_type:
return walk;
/* Special indirection required. */
diff --git a/elfutils/libdwfl/ChangeLog b/elfutils/libdwfl/ChangeLog
index 71b167f3..ea6e4e01 100644
--- a/elfutils/libdwfl/ChangeLog
+++ b/elfutils/libdwfl/ChangeLog
@@ -1,3 +1,333 @@
+2007-10-23 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
+ module to appear first.
+
+2007-10-20 Roland McGrath <roland@redhat.com>
+
+ * offline.c (process_archive_member): Take FD argument, pass it down
+ to process_file. Return Elf_Cmd, not bool.
+ Call elf_next here, always before elf_end.
+ (process_archive): Update caller. Don't close FD here unless there
+ are no member refs.
+
+ * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
+
+ * libdwflP.h (struct dwfl_file): New bool member `relocated'.
+ * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
+ partial relocation to one or both files.
+ (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
+ relocations have been applied to the debug file if dwfl_module_getelf
+ has been used before.
+
+ * relocate.c (resolve_symbol): New function.
+ (relocate_section): Call it.
+
+ * relocate.c (relocate_getsym): Handle null MOD->symfile.
+ (relocate_section): Take new bool arg, PARTIAL. If true,
+ no error for BADRELTYPE/RELUNDEF, instead just skip them
+ and leave only those skipped relocs behind the reloc section.
+ (__libdwfl_relocate_section): Take new arg, pass it down.
+ (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
+ do partial relocation on all sections.
+ * dwfl_module_getdwarf.c (load_dw): Update caller.
+ * libdwflP.h: Update decls.
+ * derelocate.c (dwfl_module_address_section): Pass new argument
+ to __libdwfl_relocate_section, true.
+
+ * derelocate.c (cache_sections): Don't cache reloc sections when
+ section_address callback is null.
+
+2007-10-19 Roland McGrath <roland@redhat.com>
+
+ * relocate.c (relocate_section): Fix fencepost error in r_offset check.
+
+ * derelocate.c (struct dwfl_relocation): Add member `relocs'.
+ (struct secref): Likewise.
+ (cache_sections): Cache the relocation section referring to each
+ section we cache, if any.
+ (dwfl_module_address_section): Use __libdwfl_relocate_section as
+ necessary.
+
+ * relocate.c (struct reloc_symtab_cache): New type.
+ (relocate_getsym): Use it instead of four arguments.
+ (__libdwfl_relocate): Update caller.
+ (relocate_section): New function, broken out of ...
+ (__libdwfl_relocate): ... here.
+ (__libdwfl_relocate_section): New function.
+ * libdwflP.h: Declare it.
+
+2007-10-17 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
+ to relocated st_value.
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
+ ET_REL to 0x100.
+
+2007-10-16 Roland McGrath <roland@redhat.com>
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
+ section has larger alignment requirements not met by the original BASE,
+ rather than padding more between sections.
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
+
+ * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
+ to sh_addr value.
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
+ at zero in ET_REL case. Adjust BASE to necessary alignment.
+
+ * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
+ for DATA_VADDR.
+ (__libdwfl_find_build_id): Update caller.
+
+ * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
+ * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
+ * offline.c (dwfl_offline_section_address): Bail early if there is
+ separate debug file.
+
+ * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
+
+2007-10-09 Roland McGrath <roland@redhat.com>
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
+ caching SHDR->sh_addr = 0.
+ * offline.c (dwfl_offline_section_address): Never called for sh_addr
+ really at 0, don't check for it. Use MOD->debug directly, not symfile.
+
+ * dwfl_module_getdwarf.c (load_symtab): Return success properly when
+ we've found SHT_SYMTAB.
+
+ * relocate.c (relocate_getsym): New function.
+ (__libdwfl_relocate): Use it.
+ (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
+ be a pointer instead of value; cache getshstrndx result there.
+ * libdwflP.h: Update decl.
+ * derelocate.c (cache_sections): Update caller.
+ Always work on the main file, not the symfile.
+ (dwfl_module_address_section): Likewise.
+ * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
+
+2007-10-07 Roland McGrath <roland@redhat.com>
+
+ * offline.c (process_archive): Initialize MOD.
+
+ * linux-kernel-modules.c (get_release): New function, broken out of ...
+ (report_kernel): ... here. Call it.
+ (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
+ (find_kernel_elf): Update caller.
+ (report_kernel_archive): New function.
+ (dwfl_linux_kernel_report_offline): Call it.
+
+ * offline.c (process_file): Take new arg PREDICATE, pass it down.
+ (process_archive): Likewise.
+ (process_archive_member): Likewise. When nonnull, let the predicate
+ decide whether to use this member.
+ (__libdwfl_report_offline): New function, broken out of ...
+ (dwfl_report_offline): ... here. Call it.
+ * libdwflP.h: Declare it.
+
+ * offline.c (process_archive, process_archive_member): New functions.
+ (process_elf, process_file): New functions, broken out of ...
+ (dwfl_report_offline): ... here. Call process_file, which recurses on
+ ELF_K_AR files.
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
+ (dwfl_report_elf): ... here. Call it.
+ * libdwflP.h: Declare it.
+
+2007-10-06 Roland McGrath <roland@redhat.com>
+
+ * derelocate.c (dwfl_module_relocations): Don't call
+ dwfl_module_getdwarf.
+
+ * derelocate.c (find_section): Use __libdwfl_seterrno, not
+ __libdw_seterrno.
+
+ * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
+ SHF_ALLOC, to cache sh_addr resolved to 0.
+
+ * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
+ values nonzero already, just use its existing layout.
+
+ * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
+ in-core shdr after applying it.
+
+2007-10-04 Ulrich Drepper <drepper@redhat.com>
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
+ initialization of notes variable.
+
+2007-10-04 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
+ fill in with vaddr of "__start_notes" symbol if found.
+ (check_notes): New function.
+ (check_kernel_notes): New function.
+ (dwfl_linux_kernel_report_kernel): Call it.
+ (check_module_notes): New function.
+ (dwfl_linux_kernel_report_modules): Call it.
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
+ Try dwfl_build_id_find_elf first.
+
+ * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
+ Set kernel module e_type to ET_DYN.
+
+2007-10-03 Roland McGrath <roland@redhat.com>
+
+ * find-debuginfo.c (validate): New function, broken out of ...
+ (find_debuginfo_in_path): ... here. New function, broken out of ...
+ (dwfl_standard_find_debuginfo): ... here. Call it, after trying
+ dwfl_build_id_find_debuginfo first.
+
+ * dwfl_build_id_find_elf.c: New file.
+ * dwfl_build_id_find_debuginfo.c: New file.
+ * Makefile.am (libdwfl_a_SOURCES): Add them.
+ * libdwfl.h: Declare them.
+ * libdwflP.h: Add INTDECLs.
+
+ * dwfl_module_build_id.c: New file.
+ * dwfl_module_report_build_id.c: New file.
+ * Makefile.am (libdwfl_a_SOURCES): Add them.
+ * libdwfl.h: Declare them.
+ * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
+ build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
+ * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
+
+ * dwfl_module_getdwarf.c (find_offsets): New function.
+ (find_dynsym): New function, calls that.
+ (find_symtab): Call it.
+
+2007-09-11 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_addrsym.c: Prefer a later global symbol at the same
+ address if its st_size is smaller.
+
+2007-08-13 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
+
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
+ FTS_LOGICAL.
+
+ * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
+ a second phdr if it happens to match EHDR_VMA exactly.
+
+2007-08-08 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
+ those with no names. Rewrite best symbol algorithm not to assume a
+ sorted table and to be smarter handling sizeless symbols.
+
+2007-07-16 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
+ reviving an existing module.
+
+2007-06-08 Roland McGrath <roland@redhat.com>
+
+ * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
+
+2007-05-17 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
+ whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
+ (dwfl_linux_kernel_find_elf): Likewise.
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
+ getline and sscanf instead of fscanf.
+
+2007-05-08 Roland McGrath <roland@redhat.com>
+
+ * offline.c (dwfl_offline_section_address): Don't assume section
+ numbers match between stripped and debuginfo files. Instead, assume
+ only that the ordering among SHF_ALLOC sections matches.
+
+ * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
+ pointer to string.
+ (dwfl_linux_kernel_report_offline): Update caller.
+ (dwfl_linux_kernel_report_kernel): Likewise.
+
+2007-04-23 Roland McGrath <roland@redhat.com>
+
+ * argp-std.c (options): Fix group title string.
+
+ * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
+ Update via STATE->input every time we set STATE->hook, not only at
+ ARGP_KEY_SUCCESS.
+
+ * dwfl_module.c (free_file): Free FILE->name.
+
+2007-04-16 Roland McGrath <roland@redhat.com>
+
+ * derelocate.c (cache_sections): Apply bias to sh_addr.
+ (compare_secrefs): Fix address comparison to avoid signed overflow.
+ (find_section): New function, broken out of ...
+ (dwfl_module_relocate_address): ... here, call it.
+ (check_module): New function, broken out of ...
+ (dwfl_module_relocate_address): ... here, call it.
+ (dwfl_module_address_section): New function.
+ * libdwfl.h: Declare it.
+
+2007-03-26 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
+
+2007-03-18 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
+ (find_debuginfo): ... here. Call it.
+ Don't return error for libelf errors finding .gnu_debuglink section.
+
+2007-03-12 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
+ (dwfl_report_begin): ... here. Call it.
+ * libdwfl.h: Declare it.
+ * libdwflP.h: Add INTDECL.
+
+ * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
+
+ * offline.c: Comment typo fix.
+
+2007-03-04 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
+ (find_kernel_elf): New function, broken out of ...
+ (report_kernel): ... here. Call it.
+ (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
+ (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
+ virtual address bounds of kernel from symbols rounded to page size.
+ (dwfl_linux_kernel_report_kernel): Use that if it works, before
+ resorting to report_kernel.
+
+ * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
+ ET_EXEC file with nonzero bias.
+
+ * dwfl_module_addrname.c (dwfl_module_addrname): Just call
+ dwfl_module_addrsym. Guts moved to ...
+ * dwfl_module_addrsym.c: ... here; new file.
+ * Makefile.am (libdwfl_a_SOURCES): Add it.
+ * libdwfl.h: Declare dwfl_module_addrsym.
+ * libdwflP.h: Add INTDECL.
+
+2007-03-03 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module.c (free_file): New function, broken out of ...
+ (__libdwfl_module_free): ... here. In it, close fd after elf_end.
+
+ * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
+ on libelf failure.
+
+2007-03-02 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c: Fix bogus error test for asprintf call.
+
2007-02-02 Roland McGrath <roland@redhat.com>
* dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
diff --git a/elfutils/libdwfl/Makefile.am b/elfutils/libdwfl/Makefile.am
index ee9efec9..83834cdb 100644
--- a/elfutils/libdwfl/Makefile.am
+++ b/elfutils/libdwfl/Makefile.am
@@ -2,7 +2,7 @@
##
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2005, 2006 Red Hat, Inc.
+## Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -50,11 +50,14 @@ euinclude_HEADERS = libdwfl.h
libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
dwfl_module.c dwfl_report_elf.c relocate.c \
+ dwfl_module_build_id.c dwfl_module_report_build_id.c \
derelocate.c offline.c \
dwfl_module_info.c dwfl_getmodules.c \
dwfl_module_getdwarf.c dwfl_getdwarf.c \
dwfl_validate_address.c \
argp-std.c find-debuginfo.c \
+ dwfl_build_id_find_elf.c \
+ dwfl_build_id_find_debuginfo.c \
linux-kernel-modules.c linux-proc-maps.c \
dwfl_addrmodule.c dwfl_addrdwarf.c \
cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
@@ -66,7 +69,8 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
dwfl_module_getsrc_file.c \
libdwfl_crc32.c libdwfl_crc32_file.c \
elf-from-memory.c \
- dwfl_module_getsym.c dwfl_module_addrname.c \
+ dwfl_module_getsym.c \
+ dwfl_module_addrname.c dwfl_module_addrsym.c \
dwfl_module_return_value_location.c \
dwfl_module_register_names.c
diff --git a/elfutils/libdwfl/Makefile.in b/elfutils/libdwfl/Makefile.in
index f54bf451..e0eea178 100644
--- a/elfutils/libdwfl/Makefile.in
+++ b/elfutils/libdwfl/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -15,15 +15,11 @@
@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
@@ -43,11 +39,11 @@ subdir = libdwfl
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -58,30 +54,34 @@ libdwfl_a_LIBADD =
am_libdwfl_a_OBJECTS = dwfl_begin.$(OBJEXT) dwfl_end.$(OBJEXT) \
dwfl_error.$(OBJEXT) dwfl_version.$(OBJEXT) \
dwfl_module.$(OBJEXT) dwfl_report_elf.$(OBJEXT) \
- relocate.$(OBJEXT) derelocate.$(OBJEXT) offline.$(OBJEXT) \
- dwfl_module_info.$(OBJEXT) dwfl_getmodules.$(OBJEXT) \
- dwfl_module_getdwarf.$(OBJEXT) dwfl_getdwarf.$(OBJEXT) \
- dwfl_validate_address.$(OBJEXT) argp-std.$(OBJEXT) \
- find-debuginfo.$(OBJEXT) linux-kernel-modules.$(OBJEXT) \
- linux-proc-maps.$(OBJEXT) dwfl_addrmodule.$(OBJEXT) \
- dwfl_addrdwarf.$(OBJEXT) cu.$(OBJEXT) \
- dwfl_module_nextcu.$(OBJEXT) dwfl_nextcu.$(OBJEXT) \
- dwfl_cumodule.$(OBJEXT) dwfl_module_addrdie.$(OBJEXT) \
- dwfl_addrdie.$(OBJEXT) lines.$(OBJEXT) dwfl_lineinfo.$(OBJEXT) \
+ relocate.$(OBJEXT) dwfl_module_build_id.$(OBJEXT) \
+ dwfl_module_report_build_id.$(OBJEXT) derelocate.$(OBJEXT) \
+ offline.$(OBJEXT) dwfl_module_info.$(OBJEXT) \
+ dwfl_getmodules.$(OBJEXT) dwfl_module_getdwarf.$(OBJEXT) \
+ dwfl_getdwarf.$(OBJEXT) dwfl_validate_address.$(OBJEXT) \
+ argp-std.$(OBJEXT) find-debuginfo.$(OBJEXT) \
+ dwfl_build_id_find_elf.$(OBJEXT) \
+ dwfl_build_id_find_debuginfo.$(OBJEXT) \
+ linux-kernel-modules.$(OBJEXT) linux-proc-maps.$(OBJEXT) \
+ dwfl_addrmodule.$(OBJEXT) dwfl_addrdwarf.$(OBJEXT) \
+ cu.$(OBJEXT) dwfl_module_nextcu.$(OBJEXT) \
+ dwfl_nextcu.$(OBJEXT) dwfl_cumodule.$(OBJEXT) \
+ dwfl_module_addrdie.$(OBJEXT) dwfl_addrdie.$(OBJEXT) \
+ lines.$(OBJEXT) dwfl_lineinfo.$(OBJEXT) \
dwfl_line_comp_dir.$(OBJEXT) dwfl_linemodule.$(OBJEXT) \
dwfl_linecu.$(OBJEXT) dwfl_getsrclines.$(OBJEXT) \
dwfl_onesrcline.$(OBJEXT) dwfl_module_getsrc.$(OBJEXT) \
dwfl_getsrc.$(OBJEXT) dwfl_module_getsrc_file.$(OBJEXT) \
libdwfl_crc32.$(OBJEXT) libdwfl_crc32_file.$(OBJEXT) \
elf-from-memory.$(OBJEXT) dwfl_module_getsym.$(OBJEXT) \
- dwfl_module_addrname.$(OBJEXT) \
+ dwfl_module_addrname.$(OBJEXT) dwfl_module_addrsym.$(OBJEXT) \
dwfl_module_return_value_location.$(OBJEXT) \
dwfl_module_register_names.$(OBJEXT)
libdwfl_a_OBJECTS = $(am_libdwfl_a_OBJECTS)
libdwfl_pic_a_AR = $(AR) $(ARFLAGS)
libdwfl_pic_a_LIBADD =
libdwfl_pic_a_OBJECTS = $(am_libdwfl_pic_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -103,15 +103,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -124,13 +120,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -145,19 +137,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -169,20 +154,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = 1
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -195,28 +178,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
@MUDFLAP_FALSE@ -Wextra -std=gnu99
@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
@@ -232,11 +226,14 @@ euincludedir = ${includedir}/elfutils
euinclude_HEADERS = libdwfl.h
libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
dwfl_module.c dwfl_report_elf.c relocate.c \
+ dwfl_module_build_id.c dwfl_module_report_build_id.c \
derelocate.c offline.c \
dwfl_module_info.c dwfl_getmodules.c \
dwfl_module_getdwarf.c dwfl_getdwarf.c \
dwfl_validate_address.c \
argp-std.c find-debuginfo.c \
+ dwfl_build_id_find_elf.c \
+ dwfl_build_id_find_debuginfo.c \
linux-kernel-modules.c linux-proc-maps.c \
dwfl_addrmodule.c dwfl_addrdwarf.c \
cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
@@ -248,7 +245,8 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
dwfl_module_getsrc_file.c \
libdwfl_crc32.c libdwfl_crc32_file.c \
elf-from-memory.c \
- dwfl_module_getsym.c dwfl_module_addrname.c \
+ dwfl_module_getsym.c \
+ dwfl_module_addrname.c dwfl_module_addrsym.c \
dwfl_module_return_value_location.c \
dwfl_module_register_names.c
@@ -323,6 +321,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_addrdwarf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_addrmodule.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_begin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_build_id_find_debuginfo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_build_id_find_elf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_cumodule.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_end.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_error.Po@am__quote@
@@ -337,6 +337,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_addrdie.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_addrname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_addrsym.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_build_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_getdwarf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_getsrc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_getsrc_file.Po@am__quote@
@@ -344,6 +346,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_nextcu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_register_names.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_report_build_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_module_return_value_location.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_nextcu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl_onesrcline.Po@am__quote@
@@ -361,22 +364,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relocate.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
install-euincludeHEADERS: $(euinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)"
+ test -z "$(euincludedir)" || $(MKDIR_P) "$(DESTDIR)$(euincludedir)"
@list='$(euinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -441,22 +443,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -472,7 +473,7 @@ check: check-am
all-am: Makefile $(LIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(euincludedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -521,12 +522,20 @@ info-am:
install-data-am: install-euincludeHEADERS
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -546,19 +555,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-euincludeHEADERS uninstall-info-am
+uninstall-am: uninstall-euincludeHEADERS
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
- install-data-am install-euincludeHEADERS 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-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-euincludeHEADERS \
- uninstall-info-am
+ install-data-am install-dvi install-dvi-am \
+ install-euincludeHEADERS install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags uninstall uninstall-am \
+ uninstall-euincludeHEADERS
@MUDFLAP_FALSE@%.os: %.c %.o
diff --git a/elfutils/libdwfl/argp-std.c b/elfutils/libdwfl/argp-std.c
index c12cb1dd..11397889 100644
--- a/elfutils/libdwfl/argp-std.c
+++ b/elfutils/libdwfl/argp-std.c
@@ -61,7 +61,7 @@
static const struct argp_option options[] =
{
- { NULL, 0, NULL, 0, N_("Input Selection:"), 0 },
+ { NULL, 0, NULL, 0, N_("Input selection options:"), 0 },
{ "executable", 'e', "FILE", 0, N_("Find addresses in FILE"), 0 },
{ "pid", 'p', "PID", 0,
N_("Find addresses in files mapped into process PID"), 0 },
@@ -244,14 +244,20 @@ parse_opt (int key, char *arg, struct argp_state *state)
int result = INTUSE(dwfl_report_end) (dwfl, NULL, NULL);
assert (result == 0);
-
- *(Dwfl **) state->input = dwfl;
}
break;
+ case ARGP_KEY_ERROR:
+ dwfl_end (state->hook);
+ state->hook = NULL;
+ break;
+
default:
return ARGP_ERR_UNKNOWN;
}
+
+ /* Update the input all along, so a parent parser can see it. */
+ *(Dwfl **) state->input = state->hook;
return 0;
}
diff --git a/elfutils/libdwfl/derelocate.c b/elfutils/libdwfl/derelocate.c
index d110299e..0877276d 100644
--- a/elfutils/libdwfl/derelocate.c
+++ b/elfutils/libdwfl/derelocate.c
@@ -55,6 +55,7 @@ struct dwfl_relocation
struct
{
Elf_Scn *scn;
+ Elf_Scn *relocs;
const char *name;
GElf_Addr start, end;
} refs[0];
@@ -65,6 +66,7 @@ struct secref
{
struct secref *next;
Elf_Scn *scn;
+ Elf_Scn *relocs;
const char *name;
GElf_Addr start, end;
};
@@ -75,57 +77,90 @@ compare_secrefs (const void *a, const void *b)
struct secref *const *p1 = a;
struct secref *const *p2 = b;
- return (*p1)->start - (*p2)->start;
+ /* No signed difference calculation is correct here, since the
+ terms are unsigned and could be more than INT64_MAX apart. */
+ if ((*p1)->start < (*p2)->start)
+ return -1;
+ if ((*p1)->start > (*p2)->start)
+ return 1;
+
+ return 0;
}
static int
cache_sections (Dwfl_Module *mod)
{
- size_t symshstrndx;
- if (elf_getshstrndx (mod->symfile->elf, &symshstrndx) < 0)
+ struct secref *refs = NULL;
+ size_t nrefs = 0;
+
+ size_t shstrndx;
+ if (unlikely (elf_getshstrndx (mod->main.elf, &shstrndx) < 0))
{
+ elf_error:
__libdwfl_seterrno (DWFL_E_LIBELF);
return -1;
}
- struct secref *refs = NULL;
- size_t nrefs = 0;
-
+ bool check_reloc_sections = false;
Elf_Scn *scn = NULL;
- while ((scn = elf_nextscn (mod->symfile->elf, scn)) != NULL)
+ while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
- return -1;
+ goto elf_error;
if ((shdr->sh_flags & SHF_ALLOC) && shdr->sh_addr == 0)
{
/* This section might not yet have been looked at. */
- if (__libdwfl_relocate_value (mod, symshstrndx, elf_ndxscn (scn),
+ if (__libdwfl_relocate_value (mod, mod->main.elf, &shstrndx,
+ elf_ndxscn (scn),
&shdr->sh_addr) != DWFL_E_NOERROR)
continue;
shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr == NULL)
- return -1;
+ if (unlikely (shdr == NULL))
+ goto elf_error;
}
if (shdr->sh_flags & SHF_ALLOC)
{
- const char *name = elf_strptr (mod->symfile->elf, symshstrndx,
+ const char *name = elf_strptr (mod->main.elf, shstrndx,
shdr->sh_name);
- if (name == NULL)
- return -1;
+ if (unlikely (name == NULL))
+ goto elf_error;
struct secref *newref = alloca (sizeof *newref);
newref->scn = scn;
+ newref->relocs = NULL;
newref->name = name;
- newref->start = shdr->sh_addr;
- newref->end = shdr->sh_addr + shdr->sh_size;
+ newref->start = shdr->sh_addr + mod->main.bias;
+ newref->end = newref->start + shdr->sh_size;
newref->next = refs;
refs = newref;
++nrefs;
}
+
+ if (mod->e_type == ET_REL
+ && shdr->sh_size != 0
+ && (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA)
+ && mod->dwfl->callbacks->section_address != NULL)
+ {
+ if (shdr->sh_info < elf_ndxscn (scn))
+ {
+ /* We've already looked at the section these relocs apply to. */
+ Elf_Scn *tscn = elf_getscn (mod->main.elf, shdr->sh_info);
+ if (likely (tscn != NULL))
+ for (struct secref *sec = refs; sec != NULL; sec = sec->next)
+ if (sec->scn == tscn)
+ {
+ sec->relocs = scn;
+ break;
+ }
+ }
+ else
+ /* We'll have to do a second pass. */
+ check_reloc_sections = true;
+ }
}
mod->reloc_info = malloc (offsetof (struct dwfl_relocation, refs[nrefs]));
@@ -147,10 +182,40 @@ cache_sections (Dwfl_Module *mod)
{
mod->reloc_info->refs[i].name = sortrefs[i]->name;
mod->reloc_info->refs[i].scn = sortrefs[i]->scn;
+ mod->reloc_info->refs[i].relocs = sortrefs[i]->relocs;
mod->reloc_info->refs[i].start = sortrefs[i]->start;
mod->reloc_info->refs[i].end = sortrefs[i]->end;
}
+ if (unlikely (check_reloc_sections))
+ {
+ /* There was a reloc section that preceded its target section.
+ So we have to scan again now that we have cached all the
+ possible target sections we care about. */
+
+ scn = NULL;
+ while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ goto elf_error;
+
+ if (shdr->sh_size != 0
+ && (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA))
+ {
+ Elf_Scn *tscn = elf_getscn (mod->main.elf, shdr->sh_info);
+ if (likely (tscn != NULL))
+ for (size_t i = 0; i < nrefs; ++i)
+ if (mod->reloc_info->refs[i].scn == tscn)
+ {
+ mod->reloc_info->refs[i].relocs = scn;
+ break;
+ }
+ }
+ }
+ }
+
return nrefs;
}
@@ -164,13 +229,6 @@ dwfl_module_relocations (Dwfl_Module *mod)
if (mod->reloc_info != NULL)
return mod->reloc_info->count;
- if (mod->dw == NULL)
- {
- Dwarf_Addr bias;
- if (INTUSE(dwfl_module_getdwarf) (mod, &bias) == NULL)
- return -1;
- }
-
switch (mod->e_type)
{
case ET_REL:
@@ -224,25 +282,41 @@ dwfl_module_relocation_info (Dwfl_Module *mod, unsigned int idx,
return sections->refs[idx].name;
}
-int
-dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr)
+/* Check that MOD is valid and make sure its relocation has been done. */
+static bool
+check_module (Dwfl_Module *mod)
{
- if (mod == NULL)
- return -1;
+ if (INTUSE(dwfl_module_getsymtab) (mod) < 0)
+ {
+ Dwfl_Error error = dwfl_errno ();
+ if (error != DWFL_E_NO_SYMTAB)
+ {
+ __libdwfl_seterrno (error);
+ return true;
+ }
+ }
if (mod->dw == NULL)
{
Dwarf_Addr bias;
if (INTUSE(dwfl_module_getdwarf) (mod, &bias) == NULL)
- return -1;
+ {
+ Dwfl_Error error = dwfl_errno ();
+ if (error != DWFL_E_NO_DWARF)
+ {
+ __libdwfl_seterrno (error);
+ return true;
+ }
+ }
}
- if (mod->e_type != ET_REL)
- {
- *addr -= mod->debug.bias;
- return 0;
- }
+ return false;
+}
+/* Find the index in MOD->reloc_info.refs containing *ADDR. */
+static int
+find_section (Dwfl_Module *mod, Dwarf_Addr *addr)
+{
if (unlikely (mod->reloc_info == NULL) && cache_sections (mod) < 0)
return -1;
@@ -272,7 +346,54 @@ dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr)
}
}
- __libdw_seterrno (DWARF_E_NO_MATCH);
+ __libdwfl_seterrno (DWFL_E (LIBDW, DWARF_E_NO_MATCH));
return -1;
}
+
+int
+dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr)
+{
+ if (check_module (mod))
+ return -1;
+
+ if (mod->e_type != ET_REL)
+ {
+ *addr -= mod->debug.bias;
+ return 0;
+ }
+
+ return find_section (mod, addr);
+}
INTDEF (dwfl_module_relocate_address)
+
+Elf_Scn *
+dwfl_module_address_section (Dwfl_Module *mod, Dwarf_Addr *address,
+ Dwarf_Addr *bias)
+{
+ if (check_module (mod))
+ return NULL;
+
+ int idx = find_section (mod, address);
+ if (idx < 0)
+ return NULL;
+
+ if (mod->reloc_info->refs[idx].relocs != NULL)
+ {
+ assert (mod->e_type == ET_REL);
+
+ Elf_Scn *tscn = mod->reloc_info->refs[idx].scn;
+ Elf_Scn *relocscn = mod->reloc_info->refs[idx].relocs;
+ Dwfl_Error result = __libdwfl_relocate_section (mod, mod->main.elf,
+ relocscn, tscn, true);
+ if (likely (result == DWFL_E_NOERROR))
+ mod->reloc_info->refs[idx].relocs = NULL;
+ else
+ {
+ __libdwfl_seterrno (result);
+ return NULL;
+ }
+ }
+
+ *bias = mod->main.bias;
+ return mod->reloc_info->refs[idx].scn;
+}
diff --git a/elfutils/libdwfl/dwfl_build_id_find_debuginfo.c b/elfutils/libdwfl/dwfl_build_id_find_debuginfo.c
new file mode 100644
index 00000000..97def072
--- /dev/null
+++ b/elfutils/libdwfl/dwfl_build_id_find_debuginfo.c
@@ -0,0 +1,92 @@
+/* Find the debuginfo file for a module from its build ID.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include "libdwflP.h"
+#include <unistd.h>
+
+
+int
+dwfl_build_id_find_debuginfo (Dwfl_Module *mod,
+ void **userdata __attribute__ ((unused)),
+ const char *modname __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ const char *file __attribute__ ((unused)),
+ const char *debuglink __attribute__ ((unused)),
+ GElf_Word crc __attribute__ ((unused)),
+ char **debuginfo_file_name)
+{
+ int fd = -1;
+ const unsigned char *bits;
+ GElf_Addr vaddr;
+ if (INTUSE(dwfl_module_build_id) (mod, &bits, &vaddr) > 0)
+ fd = __libdwfl_open_by_build_id (mod, true, debuginfo_file_name);
+ if (fd >= 0)
+ {
+ /* We need to open an Elf handle on the file so we can check its
+ build ID note for validation. Backdoor the handle into the
+ module data structure since we had to open it early anyway. */
+ mod->debug.elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+ if (likely (__libdwfl_find_build_id (mod, false, mod->debug.elf) == 2))
+ /* Also backdoor the gratuitous flag. */
+ mod->debug.valid = true;
+ else
+ {
+ /* A mismatch! */
+ elf_end (mod->debug.elf);
+ mod->debug.elf = NULL;
+ close (fd);
+ fd = -1;
+ free (*debuginfo_file_name);
+ *debuginfo_file_name = NULL;
+ errno = 0;
+ }
+ }
+ return fd;
+}
+INTDEF (dwfl_build_id_find_debuginfo)
diff --git a/elfutils/libdwfl/dwfl_build_id_find_elf.c b/elfutils/libdwfl/dwfl_build_id_find_elf.c
new file mode 100644
index 00000000..c6215012
--- /dev/null
+++ b/elfutils/libdwfl/dwfl_build_id_find_elf.c
@@ -0,0 +1,152 @@
+/* Find an ELF file for a module from its build ID.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include "libdwflP.h"
+#include <inttypes.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+int
+internal_function
+__libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name)
+{
+ *file_name = NULL;
+ errno = 0;
+ if (mod->build_id_len <= 0)
+ return -1;
+
+ const size_t id_len = mod->build_id_len;
+ const uint8_t *id = mod->build_id_bits;
+
+ /* Search debuginfo_path directories' .build-id/ subdirectories. */
+
+ char id_name[sizeof "/.build-id/" + 1 + id_len * 2 + sizeof ".debug" - 1];
+ strcpy (id_name, "/.build-id/");
+ int n = snprintf (&id_name[sizeof "/.build-id/" - 1],
+ 4, "%02" PRIx8 "/", (uint8_t) id[0]);
+ assert (n == 3);
+ for (size_t i = 1; i < id_len; ++i)
+ {
+ n = snprintf (&id_name[sizeof "/.build-id/" - 1 + 3 + (i - 1) * 2],
+ 3, "%02" PRIx8, (uint8_t) id[i]);
+ assert (n == 2);
+ }
+ if (debug)
+ strcpy (&id_name[sizeof "/.build-id/" - 1 + 3 + (id_len - 1) * 2],
+ ".debug");
+
+ const Dwfl_Callbacks *const cb = mod->dwfl->callbacks;
+ char *path = strdupa ((cb->debuginfo_path ? *cb->debuginfo_path : NULL)
+ ?: DEFAULT_DEBUGINFO_PATH);
+
+ int fd = -1;
+ char *dir;
+ while (fd < 0 && (dir = strsep (&path, ":")) != NULL)
+ {
+ if (dir[0] == '+' || dir[0] == '-')
+ ++dir;
+
+ /* Only absolute directory names are useful to us. */
+ if (dir[0] != '/')
+ continue;
+
+ size_t dirlen = strlen (dir);
+ char *name = malloc (dirlen + sizeof id_name);
+ if (unlikely (name == NULL))
+ break;
+ memcpy (mempcpy (name, dir, dirlen), id_name, sizeof id_name);
+
+ fd = TEMP_FAILURE_RETRY (open64 (name, O_RDONLY));
+ if (fd >= 0)
+ {
+ if (*file_name != NULL)
+ free (*file_name);
+ *file_name = canonicalize_file_name (name);
+ if (*file_name == NULL)
+ {
+ *file_name = name;
+ name = NULL;
+ }
+ }
+ free (name);
+ }
+
+ return fd;
+}
+
+int
+dwfl_build_id_find_elf (Dwfl_Module *mod,
+ void **userdata __attribute__ ((unused)),
+ const char *modname __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ char **file_name, Elf **elfp)
+{
+ *elfp = NULL;
+ int fd = __libdwfl_open_by_build_id (mod, false, file_name);
+ if (fd >= 0)
+ {
+ *elfp = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+ if (__libdwfl_find_build_id (mod, false, *elfp) == 2)
+ /* This is a backdoor signal to short-circuit the ID refresh. */
+ mod->main.valid = true;
+ else
+ {
+ /* This file does not contain the ID it should! */
+ elf_end (*elfp);
+ *elfp = NULL;
+ close (fd);
+ fd = -1;
+ free (*file_name);
+ *file_name = NULL;
+ }
+ }
+ return fd;
+}
+INTDEF (dwfl_build_id_find_elf)
diff --git a/elfutils/libdwfl/dwfl_module.c b/elfutils/libdwfl/dwfl_module.c
index 16c616d2..434f3ff9 100644
--- a/elfutils/libdwfl/dwfl_module.c
+++ b/elfutils/libdwfl/dwfl_module.c
@@ -1,5 +1,5 @@
/* Maintenance of module list in libdwfl.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -49,6 +49,7 @@
#include "libdwflP.h"
#include <search.h>
+#include <unistd.h>
static void
free_cu (struct dwfl_cu *cu)
@@ -63,6 +64,16 @@ nofree (void *arg __attribute__ ((unused)))
{
}
+static void
+free_file (struct dwfl_file *file)
+{
+ free (file->name);
+
+ /* Close the fd only on the last reference. */
+ if (file->elf != NULL && elf_end (file->elf) == 0 && file->fd != -1)
+ close (file->fd);
+}
+
void
internal_function
__libdwfl_module_free (Dwfl_Module *mod)
@@ -86,24 +97,34 @@ __libdwfl_module_free (Dwfl_Module *mod)
if (mod->ebl != NULL)
ebl_closebackend (mod->ebl);
- if (mod->debug.elf != mod->main.elf && mod->debug.elf != NULL)
- elf_end (mod->debug.elf);
- if (mod->main.elf != NULL)
- elf_end (mod->main.elf);
+ if (mod->debug.elf != mod->main.elf)
+ free_file (&mod->debug);
+ free_file (&mod->main);
+
+ if (mod->build_id_bits != NULL)
+ free (mod->build_id_bits);
free (mod->name);
+ free (mod);
}
void
-dwfl_report_begin (Dwfl *dwfl)
+dwfl_report_begin_add (Dwfl *dwfl)
{
- for (Dwfl_Module *m = dwfl->modulelist; m != NULL; m = m->next)
- m->gc = true;
-
if (dwfl->modules != NULL)
free (dwfl->modules);
dwfl->modules = NULL;
dwfl->nmodules = 0;
+}
+INTDEF (dwfl_report_begin_add)
+
+void
+dwfl_report_begin (Dwfl *dwfl)
+{
+ INTUSE(dwfl_report_begin_add) (dwfl);
+
+ for (Dwfl_Module *m = dwfl->modulelist; m != NULL; m = m->next)
+ m->gc = true;
dwfl->offline_next_address = OFFLINE_REDZONE;
}
@@ -129,6 +150,7 @@ dwfl_report_module (Dwfl *dwfl, const char *name,
m->next = *tailp;
m->gc = false;
*tailp = m;
+ ++dwfl->nmodules;
return m;
}
diff --git a/elfutils/libdwfl/dwfl_module_addrname.c b/elfutils/libdwfl/dwfl_module_addrname.c
index b107448b..7d365fe2 100644
--- a/elfutils/libdwfl/dwfl_module_addrname.c
+++ b/elfutils/libdwfl/dwfl_module_addrname.c
@@ -52,74 +52,6 @@
const char *
dwfl_module_addrname (Dwfl_Module *mod, GElf_Addr addr)
{
- int syments = INTUSE(dwfl_module_getsymtab) (mod);
- if (syments < 0)
- return NULL;
-
- /* Return true iff we consider ADDR to lie in the same section as SYM. */
- GElf_Word addr_shndx = SHN_UNDEF;
- inline bool same_section (const GElf_Sym *sym, GElf_Word shndx)
- {
- /* For absolute symbols and the like, only match exactly. */
- if (shndx >= SHN_LORESERVE)
- return sym->st_value == addr;
-
- /* Ignore section and other special symbols. */
- switch (GELF_ST_TYPE (sym->st_info))
- {
- case STT_SECTION:
- case STT_FILE:
- case STT_TLS:
- return false;
- }
-
- /* Figure out what section ADDR lies in. */
- if (addr_shndx == SHN_UNDEF)
- {
- GElf_Addr mod_addr = addr - mod->symfile->bias;
- Elf_Scn *scn = NULL;
- addr_shndx = SHN_ABS;
- while ((scn = elf_nextscn (mod->symfile->elf, scn)) != NULL)
- {
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (likely (shdr != NULL)
- && mod_addr >= shdr->sh_addr
- && mod_addr < shdr->sh_addr + shdr->sh_size)
- {
- addr_shndx = elf_ndxscn (scn);
- break;
- }
- }
- }
-
- return shndx == addr_shndx;
- }
-
- /* Look through the symbol table for a matching symbol. */
- const char *closest = NULL;
- GElf_Addr closest_value = 0;
- for (int i = 1; i < syments; ++i)
- {
- GElf_Sym sym;
- GElf_Word shndx;
- const char *name = INTUSE(dwfl_module_getsym) (mod, i, &sym, &shndx);
- if (name != NULL && sym.st_value <= addr)
- {
- if (addr < sym.st_value + sym.st_size)
- return name;
-
- /* Handwritten assembly symbols sometimes have no st_size.
- If no symbol with proper size includes the address, we'll
- use the closest one that is in the same section as ADDR. */
- if (sym.st_size == 0 && sym.st_value >= closest_value
- && same_section (&sym, shndx))
- {
- closest_value = sym.st_value;
- closest = name;
- }
- }
- }
-
- return closest;
+ GElf_Sym sym;
+ return INTUSE(dwfl_module_addrsym) (mod, addr, &sym, NULL);
}
diff --git a/elfutils/libdwfl/dwfl_module_addrsym.c b/elfutils/libdwfl/dwfl_module_addrsym.c
new file mode 100644
index 00000000..f16de116
--- /dev/null
+++ b/elfutils/libdwfl/dwfl_module_addrsym.c
@@ -0,0 +1,186 @@
+/* Find debugging and symbol information for a module in libdwfl.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include "libdwflP.h"
+
+const char *
+dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr,
+ GElf_Sym *closest_sym, GElf_Word *shndxp)
+{
+ int syments = INTUSE(dwfl_module_getsymtab) (mod);
+ if (syments < 0)
+ return NULL;
+
+ /* Return true iff we consider ADDR to lie in the same section as SYM. */
+ GElf_Word addr_shndx = SHN_UNDEF;
+ inline bool same_section (const GElf_Sym *sym, GElf_Word shndx)
+ {
+ /* For absolute symbols and the like, only match exactly. */
+ if (shndx >= SHN_LORESERVE)
+ return sym->st_value == addr;
+
+ /* Ignore section and other special symbols. */
+ switch (GELF_ST_TYPE (sym->st_info))
+ {
+ case STT_SECTION:
+ case STT_FILE:
+ case STT_TLS:
+ return false;
+ }
+
+ /* Figure out what section ADDR lies in. */
+ if (addr_shndx == SHN_UNDEF)
+ {
+ GElf_Addr mod_addr = addr - mod->symfile->bias;
+ Elf_Scn *scn = NULL;
+ addr_shndx = SHN_ABS;
+ while ((scn = elf_nextscn (mod->symfile->elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (likely (shdr != NULL)
+ && mod_addr >= shdr->sh_addr
+ && mod_addr < shdr->sh_addr + shdr->sh_size)
+ {
+ addr_shndx = elf_ndxscn (scn);
+ break;
+ }
+ }
+ }
+
+ return shndx == addr_shndx;
+ }
+
+ /* Keep track of the closest symbol we have seen so far.
+ Here we store only symbols with nonzero st_size. */
+ const char *closest_name = NULL;
+ GElf_Word closest_shndx = SHN_UNDEF;
+
+ /* Keep track of an eligible symbol with st_size == 0 as a fallback. */
+ const char *sizeless_name = NULL;
+ GElf_Sym sizeless_sym = { 0, 0, 0, 0, 0, SHN_UNDEF };
+ GElf_Word sizeless_shndx = SHN_UNDEF;
+
+ /* Keep track of the lowest address a relevant sizeless symbol could have. */
+ GElf_Addr min_label = addr;
+
+ /* Look through the symbol table for a matching symbol. */
+ for (int i = 1; i < syments; ++i)
+ {
+ GElf_Sym sym;
+ GElf_Word shndx;
+ const char *name = INTUSE(dwfl_module_getsym) (mod, i, &sym, &shndx);
+ if (name != NULL
+ && sym.st_value <= addr
+ && (sym.st_size == 0 || addr - sym.st_value < sym.st_size))
+ {
+ /* Even if we don't choose this symbol, its existence
+ excludes any sizeless symbol (assembly label) that
+ is inside its bounds. */
+ if (sym.st_value + sym.st_size > addr)
+ min_label = sym.st_value + sym.st_size;
+
+ /* This symbol is a better candidate than the current one
+ if it's a named symbol, not a section or file symbol,
+ and is closer to ADDR or is global when it was local. */
+ if (name[0] != '\0'
+ && GELF_ST_TYPE (sym.st_info) != STT_SECTION
+ && GELF_ST_TYPE (sym.st_info) != STT_FILE)
+ {
+ if (closest_name == NULL
+ || closest_sym->st_value < sym.st_value
+ || (GELF_ST_BIND (closest_sym->st_info)
+ < GELF_ST_BIND (sym.st_info)))
+ {
+ if (sym.st_size != 0)
+ {
+ *closest_sym = sym;
+ closest_shndx = shndx;
+ closest_name = name;
+ }
+ else if (same_section (&sym, shndx))
+ {
+ /* Handwritten assembly symbols sometimes have no
+ st_size. If no symbol with proper size includes
+ the address, we'll use the closest one that is in
+ the same section as ADDR. */
+ sizeless_sym = sym;
+ sizeless_shndx = shndx;
+ sizeless_name = name;
+ }
+ }
+ /* When the beginning of its range is no closer,
+ the end of its range might be. */
+ else if (sym.st_size != 0
+ && closest_sym->st_value == sym.st_value
+ && closest_sym->st_size > sym.st_size)
+ {
+ *closest_sym = sym;
+ closest_shndx = shndx;
+ closest_name = name;
+ }
+ }
+ }
+ }
+
+ /* If we found no proper sized symbol to use, fall back to the best
+ candidate sizeless symbol we found, if any. */
+ if (closest_name == NULL
+ && sizeless_name != NULL && sizeless_sym.st_value >= min_label)
+ {
+ *closest_sym = sizeless_sym;
+ closest_shndx = sizeless_shndx;
+ closest_name = sizeless_name;
+ }
+
+ if (shndxp != NULL)
+ *shndxp = closest_shndx;
+ return closest_name;
+}
+INTDEF (dwfl_module_addrsym)
diff --git a/elfutils/libdwfl/dwfl_module_build_id.c b/elfutils/libdwfl/dwfl_module_build_id.c
new file mode 100644
index 00000000..903b79c5
--- /dev/null
+++ b/elfutils/libdwfl/dwfl_module_build_id.c
@@ -0,0 +1,166 @@
+/* Return build ID information for a module.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include "libdwflP.h"
+
+static int
+found_build_id (Dwfl_Module *mod, bool set,
+ const void *bits, int len, GElf_Addr vaddr)
+{
+ if (!set)
+ /* When checking bits, we do not compare VADDR because the
+ address found in a debuginfo file may not match the main
+ file as modified by prelink. */
+ return 1 + (mod->build_id_len == len
+ && !memcmp (bits, mod->build_id_bits, len));
+
+ void *copy = malloc (len);
+ if (unlikely (copy == NULL))
+ {
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ return -1;
+ }
+
+ mod->build_id_bits = memcpy (copy, bits, len);
+ mod->build_id_vaddr = vaddr;
+ mod->build_id_len = len;
+ return len;
+}
+
+#define NO_VADDR ((GElf_Addr) -1l)
+
+static int
+check_notes (Dwfl_Module *mod, bool set, Elf_Data *data, GElf_Addr data_vaddr)
+{
+ size_t pos = 0;
+ GElf_Nhdr nhdr;
+ size_t name_pos;
+ size_t desc_pos;
+ while ((pos = gelf_getnote (data, pos, &nhdr, &name_pos, &desc_pos)) > 0)
+ if (nhdr.n_type == NT_GNU_BUILD_ID
+ && nhdr.n_namesz == sizeof "GNU" && !memcmp (data->d_buf + name_pos,
+ "GNU", sizeof "GNU"))
+ return found_build_id (mod, set,
+ data->d_buf + desc_pos, nhdr.n_descsz,
+ data_vaddr == NO_VADDR ? 0 : data_vaddr + pos);
+ return 0;
+}
+
+int
+internal_function
+__libdwfl_find_build_id (Dwfl_Module *mod, bool set, Elf *elf)
+{
+ int result = 0;
+
+ Elf_Scn *scn = elf_nextscn (elf, NULL);
+
+ if (scn == NULL)
+ {
+ /* No sections, have to look for phdrs. */
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (unlikely (ehdr == NULL))
+ {
+ __libdwfl_seterrno (DWFL_E_LIBELF);
+ return -1;
+ }
+ for (uint_fast16_t i = 0; result == 0 && i < ehdr_mem.e_phnum; ++i)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+ if (likely (phdr != NULL) && phdr->p_type == PT_NOTE)
+ result = check_notes (mod, set,
+ elf_getdata_rawchunk (elf,
+ phdr->p_offset,
+ phdr->p_filesz,
+ ELF_T_NHDR),
+ phdr->p_vaddr + mod->main.bias);
+ }
+ }
+ else
+ do
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (likely (shdr != NULL) && shdr->sh_type == SHT_NOTE)
+ result = check_notes (mod, set, elf_getdata (scn, NULL),
+ (shdr->sh_flags & SHF_ALLOC)
+ ? shdr->sh_addr + mod->main.bias : NO_VADDR);
+ }
+ while (result == 0 && (scn = elf_nextscn (elf, scn)) != NULL);
+
+ return result;
+}
+
+int
+dwfl_module_build_id (Dwfl_Module *mod,
+ const unsigned char **bits, GElf_Addr *vaddr)
+{
+ if (mod == NULL)
+ return -1;
+
+ if (mod->build_id_len == 0 && mod->main.elf != NULL)
+ {
+ /* We have the file, but have not examined it yet. */
+ int result = __libdwfl_find_build_id (mod, true, mod->main.elf);
+ if (result <= 0)
+ {
+ mod->build_id_len = -1; /* Cache negative result. */
+ return result;
+ }
+ }
+
+ if (mod->build_id_len <= 0)
+ return 0;
+
+ *bits = mod->build_id_bits;
+ *vaddr = mod->build_id_vaddr;
+ return mod->build_id_len;
+}
+INTDEF (dwfl_module_build_id)
diff --git a/elfutils/libdwfl/dwfl_module_getdwarf.c b/elfutils/libdwfl/dwfl_module_getdwarf.c
index 07248bf7..775df731 100644
--- a/elfutils/libdwfl/dwfl_module_getdwarf.c
+++ b/elfutils/libdwfl/dwfl_module_getdwarf.c
@@ -1,5 +1,5 @@
/* Find debugging and symbol information for a module in libdwfl.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -69,9 +69,12 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (file->elf, &ehdr_mem);
if (ehdr == NULL)
- return DWFL_E (LIBELF, elf_errno ());
-
- mod->e_type = ehdr->e_type;
+ {
+ elf_error:
+ close (file->fd);
+ file->fd = -1;
+ return DWFL_E_LIBELF;
+ }
file->bias = 0;
for (uint_fast16_t i = 0; i < ehdr->e_phnum; ++i)
@@ -79,7 +82,7 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
GElf_Phdr ph_mem;
GElf_Phdr *ph = gelf_getphdr (file->elf, i, &ph_mem);
if (ph == NULL)
- return DWFL_E_LIBELF;
+ goto elf_error;
if (ph->p_type == PT_LOAD)
{
file->bias = ((mod->low_addr & -ph->p_align)
@@ -88,6 +91,12 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
}
}
+ mod->e_type = ehdr->e_type;
+
+ /* Relocatable Linux kernels are ET_EXEC but act like ET_DYN. */
+ if (mod->e_type == ET_EXEC && file->bias != 0)
+ mod->e_type = ET_DYN;
+
return DWFL_E_NOERROR;
}
@@ -104,76 +113,88 @@ find_file (Dwfl_Module *mod)
&mod->main.name,
&mod->main.elf);
mod->elferr = open_elf (mod, &mod->main);
+
+ if (mod->elferr == DWFL_E_NOERROR && !mod->main.valid)
+ {
+ /* Clear any explicitly reported build ID, just in case it was wrong.
+ We'll fetch it from the file when asked. */
+ if (mod->build_id_len > 0)
+ free (mod->build_id_bits);
+ mod->build_id_len = 0;
+ }
}
-/* Find the separate debuginfo file for this module and open libelf on it.
- When we return success, MOD->debug is set up. */
-static Dwfl_Error
-find_debuginfo (Dwfl_Module *mod)
+/* Search an ELF file for a ".gnu_debuglink" section. */
+static const char *
+find_debuglink (Elf *elf, GElf_Word *crc)
{
- if (mod->debug.elf != NULL)
- return DWFL_E_NOERROR;
-
size_t shstrndx;
- if (elf_getshstrndx (mod->main.elf, &shstrndx) < 0)
- return DWFL_E_LIBELF;
+ if (elf_getshstrndx (elf, &shstrndx) < 0)
+ return NULL;
- Elf_Scn *scn = elf_getscn (mod->main.elf, 0);
- if (scn == NULL)
- return DWFL_E_LIBELF;
- do
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
{
- GElf_Shdr shdr_mem, *shdr = gelf_getshdr (scn, &shdr_mem);
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
- return DWFL_E_LIBELF;
+ return NULL;
- const char *name = elf_strptr (mod->main.elf, shstrndx, shdr->sh_name);
+ const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
if (name == NULL)
- return DWFL_E_LIBELF;
+ return NULL;
if (!strcmp (name, ".gnu_debuglink"))
break;
+ }
- scn = elf_nextscn (mod->main.elf, scn);
- } while (scn != NULL);
+ if (scn == NULL)
+ return NULL;
- const char *debuglink_file = NULL;
- GElf_Word debuglink_crc = 0;
- if (scn != NULL)
+ /* Found the .gnu_debuglink section. Extract its contents. */
+ Elf_Data *rawdata = elf_rawdata (scn, NULL);
+ if (rawdata == NULL)
+ return NULL;
+
+ Elf_Data crcdata =
+ {
+ .d_type = ELF_T_WORD,
+ .d_buf = crc,
+ .d_size = sizeof *crc,
+ .d_version = EV_CURRENT,
+ };
+ Elf_Data conv =
{
- /* Found the .gnu_debuglink section. Extract its contents. */
- Elf_Data *rawdata = elf_rawdata (scn, NULL);
- if (rawdata == NULL)
- return DWFL_E_LIBELF;
+ .d_type = ELF_T_WORD,
+ .d_buf = rawdata->d_buf + rawdata->d_size - sizeof *crc,
+ .d_size = sizeof *crc,
+ .d_version = EV_CURRENT,
+ };
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
+ if (ehdr == NULL)
+ return NULL;
+
+ Elf_Data *d = gelf_xlatetom (elf, &crcdata, &conv, ehdr->e_ident[EI_DATA]);
+ if (d == NULL)
+ return NULL;
+ assert (d == &crcdata);
+
+ return rawdata->d_buf;
+}
- Elf_Data crcdata =
- {
- .d_type = ELF_T_WORD,
- .d_buf = &debuglink_crc,
- .d_size = sizeof debuglink_crc,
- .d_version = EV_CURRENT,
- };
- Elf_Data conv =
- {
- .d_type = ELF_T_WORD,
- .d_buf = rawdata->d_buf + rawdata->d_size - sizeof debuglink_crc,
- .d_size = sizeof debuglink_crc,
- .d_version = EV_CURRENT,
- };
-
- GElf_Ehdr ehdr_mem;
- GElf_Ehdr *ehdr = gelf_getehdr (mod->main.elf, &ehdr_mem);
- if (ehdr == NULL)
- return DWFL_E_LIBELF;
-
- Elf_Data *d = gelf_xlatetom (mod->main.elf, &crcdata, &conv,
- ehdr->e_ident[EI_DATA]);
- if (d == NULL)
- return DWFL_E_LIBELF;
- assert (d == &crcdata);
-
- debuglink_file = rawdata->d_buf;
- }
+
+/* Find the separate debuginfo file for this module and open libelf on it.
+ When we return success, MOD->debug is set up. */
+static Dwfl_Error
+find_debuginfo (Dwfl_Module *mod)
+{
+ if (mod->debug.elf != NULL)
+ return DWFL_E_NOERROR;
+
+ GElf_Word debuglink_crc = 0;
+ const char *debuglink_file = find_debuglink (mod->main.elf, &debuglink_crc);
mod->debug.fd = (*mod->dwfl->callbacks->find_debuginfo) (MODCB_ARGS (mod),
mod->main.name,
@@ -184,7 +205,9 @@ find_debuginfo (Dwfl_Module *mod)
}
-/* Try to find a symbol table in FILE. */
+/* Try to find a symbol table in FILE.
+ Returns DWFL_E_NOERROR if a proper one is found.
+ Returns DWFL_E_NO_SYMTAB if not, but still sets results for SHT_DYNSYM. */
static Dwfl_Error
load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
Elf_Scn **symscn, Elf_Scn **xndxscn,
@@ -202,7 +225,7 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
*symfile = file;
*strshndx = shdr->sh_link;
*syments = shdr->sh_size / shdr->sh_entsize;
- if (*symscn != NULL && *xndxscn != NULL)
+ if (*xndxscn != NULL)
return DWFL_E_NOERROR;
break;
@@ -216,15 +239,233 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
case SHT_SYMTAB_SHNDX:
*xndxscn = scn;
+ if (*symscn != NULL)
+ return DWFL_E_NOERROR;
break;
default:
break;
}
}
+
+ if (*symscn != NULL)
+ /* We found one, though no SHT_SYMTAB_SHNDX to go with it. */
+ return DWFL_E_NOERROR;
+
+ /* We found no SHT_SYMTAB, so any SHT_SYMTAB_SHNDX was bogus.
+ We might have found an SHT_DYNSYM and set *SYMSCN et al though. */
+ *xndxscn = NULL;
return DWFL_E_NO_SYMTAB;
}
+
+/* Translate addresses into file offsets.
+ OFFS[*] start out zero and remain zero if unresolved. */
+static void
+find_offsets (Elf *elf, const GElf_Ehdr *ehdr, size_t n,
+ GElf_Addr addrs[n], GElf_Off offs[n])
+{
+ size_t unsolved = n;
+ for (uint_fast16_t i = 0; i < ehdr->e_phnum; ++i)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+ if (phdr != NULL && phdr->p_type == PT_LOAD && phdr->p_memsz > 0)
+ for (size_t j = 0; j < n; ++j)
+ if (offs[j] == 0
+ && addrs[j] >= phdr->p_vaddr
+ && addrs[j] - phdr->p_vaddr < phdr->p_filesz)
+ {
+ offs[j] = addrs[j] - phdr->p_vaddr + phdr->p_offset;
+ if (--unsolved == 0)
+ break;
+ }
+ }
+}
+
+/* Try to find a dynamic symbol table via phdrs. */
+static void
+find_dynsym (Dwfl_Module *mod)
+{
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (mod->main.elf, &ehdr_mem);
+
+ for (uint_fast16_t i = 0; i < ehdr->e_phnum; ++i)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (mod->main.elf, i, &phdr_mem);
+ if (phdr == NULL)
+ break;
+
+ if (phdr->p_type == PT_DYNAMIC)
+ {
+ /* Examine the dynamic section for the pointers we need. */
+
+ Elf_Data *data = elf_getdata_rawchunk (mod->main.elf,
+ phdr->p_offset, phdr->p_filesz,
+ ELF_T_DYN);
+ if (data == NULL)
+ continue;
+
+ enum
+ {
+ i_symtab,
+ i_strtab,
+ i_hash,
+ i_gnu_hash,
+ i_max
+ };
+ GElf_Addr addrs[i_max] = { 0, };
+ GElf_Xword strsz = 0;
+ size_t n = data->d_size / gelf_fsize (mod->main.elf,
+ ELF_T_DYN, 1, EV_CURRENT);
+ for (size_t j = 0; j < n; ++j)
+ {
+ GElf_Dyn dyn_mem;
+ GElf_Dyn *dyn = gelf_getdyn (data, j, &dyn_mem);
+ if (dyn != NULL)
+ switch (dyn->d_tag)
+ {
+ case DT_SYMTAB:
+ addrs[i_symtab] = dyn->d_un.d_ptr;
+ continue;
+
+ case DT_HASH:
+ addrs[i_hash] = dyn->d_un.d_ptr;
+ continue;
+
+ case DT_GNU_HASH:
+ addrs[i_gnu_hash] = dyn->d_un.d_ptr;
+ continue;
+
+ case DT_STRTAB:
+ addrs[i_strtab] = dyn->d_un.d_ptr;
+ continue;
+
+ case DT_STRSZ:
+ strsz = dyn->d_un.d_val;
+ continue;
+
+ default:
+ continue;
+
+ case DT_NULL:
+ break;
+ }
+ break;
+ }
+
+ /* Translate pointers into file offsets. */
+ GElf_Off offs[i_max] = { 0, };
+ find_offsets (mod->main.elf, ehdr, i_max, addrs, offs);
+
+ /* Figure out the size of the symbol table. */
+ if (offs[i_hash] != 0)
+ {
+ /* In the original format, .hash says the size of .dynsym. */
+
+ size_t entsz = SH_ENTSIZE_HASH (ehdr);
+ data = elf_getdata_rawchunk (mod->main.elf,
+ offs[i_hash] + entsz, entsz,
+ entsz == 4 ? ELF_T_WORD
+ : ELF_T_XWORD);
+ if (data != NULL)
+ mod->syments = (entsz == 4
+ ? *(const GElf_Word *) data->d_buf
+ : *(const GElf_Xword *) data->d_buf);
+ }
+ if (offs[i_gnu_hash] != 0 && mod->syments == 0)
+ {
+ /* In the new format, we can derive it with some work. */
+
+ const struct
+ {
+ Elf32_Word nbuckets;
+ Elf32_Word symndx;
+ Elf32_Word maskwords;
+ Elf32_Word shift2;
+ } *header;
+
+ data = elf_getdata_rawchunk (mod->main.elf, offs[i_gnu_hash],
+ sizeof *header, ELF_T_WORD);
+ if (data != NULL)
+ {
+ header = data->d_buf;
+ Elf32_Word nbuckets = header->nbuckets;
+ Elf32_Word symndx = header->symndx;
+ GElf_Off buckets_at = (offs[i_gnu_hash] + sizeof *header
+ + (gelf_getclass (mod->main.elf)
+ * sizeof (Elf32_Word)
+ * header->maskwords));
+
+ data = elf_getdata_rawchunk (mod->main.elf, buckets_at,
+ nbuckets * sizeof (Elf32_Word),
+ ELF_T_WORD);
+ if (data != NULL && symndx < nbuckets)
+ {
+ const Elf32_Word *const buckets = data->d_buf;
+ Elf32_Word maxndx = symndx;
+ for (Elf32_Word bucket = 0; bucket < nbuckets; ++bucket)
+ if (buckets[bucket] > maxndx)
+ maxndx = buckets[bucket];
+
+ GElf_Off hasharr_at = (buckets_at
+ + nbuckets * sizeof (Elf32_Word));
+ hasharr_at += (maxndx - symndx) * sizeof (Elf32_Word);
+ do
+ {
+ data = elf_getdata_rawchunk (mod->main.elf,
+ hasharr_at,
+ sizeof (Elf32_Word),
+ ELF_T_WORD);
+ if (data != NULL
+ && (*(const Elf32_Word *) data->d_buf & 1u))
+ {
+ mod->syments = maxndx + 1;
+ break;
+ }
+ ++maxndx;
+ hasharr_at += sizeof (Elf32_Word);
+ } while (data != NULL);
+ }
+ }
+ }
+ if (offs[i_strtab] > offs[i_symtab] && mod->syments == 0)
+ mod->syments = ((offs[i_strtab] - offs[i_symtab])
+ / gelf_fsize (mod->main.elf,
+ ELF_T_SYM, 1, EV_CURRENT));
+
+ if (mod->syments > 0)
+ {
+ mod->symdata = elf_getdata_rawchunk (mod->main.elf,
+ offs[i_symtab],
+ gelf_fsize (mod->main.elf,
+ ELF_T_SYM,
+ mod->syments,
+ EV_CURRENT),
+ ELF_T_SYM);
+ if (mod->symdata != NULL)
+ {
+ mod->symstrdata = elf_getdata_rawchunk (mod->main.elf,
+ offs[i_strtab],
+ strsz,
+ ELF_T_BYTE);
+ if (mod->symstrdata == NULL)
+ mod->symdata = NULL;
+ }
+ if (mod->symdata == NULL)
+ mod->symerr = DWFL_E (LIBELF, elf_errno ());
+ else
+ {
+ mod->symfile = &mod->main;
+ mod->symerr = DWFL_E_NOERROR;
+ }
+ return;
+ }
+ }
+ }
+}
+
/* Try to find a symbol table in either MOD->main.elf or MOD->debug.elf. */
static void
find_symtab (Dwfl_Module *mod)
@@ -278,11 +519,16 @@ find_symtab (Dwfl_Module *mod)
break;
case DWFL_E_NO_SYMTAB:
- if (symscn == NULL)
- return;
- /* We still have the dynamic symbol table. */
- mod->symerr = DWFL_E_NOERROR;
- break;
+ if (symscn != NULL)
+ {
+ /* We still have the dynamic symbol table. */
+ mod->symerr = DWFL_E_NOERROR;
+ break;
+ }
+
+ /* Last ditch, look for dynamic symbols without section headers. */
+ find_dynsym (mod);
+ return;
}
break;
}
@@ -354,7 +600,7 @@ load_dw (Dwfl_Module *mod, struct dwfl_file *debugfile)
find_symtab (mod);
Dwfl_Error result = mod->symerr;
if (result == DWFL_E_NOERROR)
- result = __libdwfl_relocate (mod, debugfile->elf);
+ result = __libdwfl_relocate (mod, debugfile->elf, true);
if (result != DWFL_E_NOERROR)
return result;
@@ -443,6 +689,26 @@ dwfl_module_getelf (Dwfl_Module *mod, GElf_Addr *loadbase)
find_file (mod);
if (mod->elferr == DWFL_E_NOERROR)
{
+ if (mod->e_type == ET_REL && ! mod->main.relocated)
+ {
+ /* Before letting them get at the Elf handle,
+ apply all the relocations we know how to. */
+
+ mod->main.relocated = true;
+ if (likely (__libdwfl_module_getebl (mod) == DWFL_E_NOERROR))
+ {
+ (void) __libdwfl_relocate (mod, mod->main.elf, false);
+
+ if (mod->debug.elf == mod->main.elf)
+ mod->debug.relocated = true;
+ else if (mod->debug.elf != NULL && ! mod->debug.relocated)
+ {
+ mod->debug.relocated = true;
+ (void) __libdwfl_relocate (mod, mod->debug.elf, false);
+ }
+ }
+ }
+
*loadbase = mod->main.bias;
return mod->main.elf;
}
@@ -462,6 +728,16 @@ dwfl_module_getdwarf (Dwfl_Module *mod, Dwarf_Addr *bias)
find_dw (mod);
if (mod->dwerr == DWFL_E_NOERROR)
{
+ /* If dwfl_module_getelf was used previously, then partial apply
+ relocation to miscellaneous sections in the debug file too. */
+ if (mod->e_type == ET_REL
+ && mod->main.relocated && ! mod->debug.relocated)
+ {
+ mod->debug.relocated = true;
+ if (mod->debug.elf != mod->main.elf)
+ (void) __libdwfl_relocate (mod, mod->debug.elf, false);
+ }
+
*bias = mod->debug.bias;
return mod->dw;
}
diff --git a/elfutils/libdwfl/dwfl_module_getsym.c b/elfutils/libdwfl/dwfl_module_getsym.c
index 0c076e87..5f289ccb 100644
--- a/elfutils/libdwfl/dwfl_module_getsym.c
+++ b/elfutils/libdwfl/dwfl_module_getsym.c
@@ -1,5 +1,5 @@
/* Find debugging and symbol information for a module in libdwfl.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006,2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -85,24 +85,22 @@ dwfl_module_getsym (Dwfl_Module *mod, int ndx,
break;
default:
- if (mod->e_type != ET_REL)
- /* Apply the bias to the symbol value. */
- sym->st_value += mod->symfile->bias;
- else
+ if (mod->e_type == ET_REL)
{
/* In an ET_REL file, the symbol table values are relative
to the section, not to the module's load base. */
- size_t symshstrndx;
- Dwfl_Error result = DWFL_E_LIBELF;
- if (elf_getshstrndx (mod->symfile->elf, &symshstrndx) == 0)
- result = __libdwfl_relocate_value (mod, symshstrndx,
- shndx, &sym->st_value);
+ size_t symshstrndx = SHN_UNDEF;
+ Dwfl_Error result = __libdwfl_relocate_value (mod, mod->symfile->elf,
+ &symshstrndx,
+ shndx, &sym->st_value);
if (unlikely (result != DWFL_E_NOERROR))
{
__libdwfl_seterrno (result);
return NULL;
}
}
+ /* Apply the bias to the symbol value. */
+ sym->st_value += mod->symfile->bias;
break;
}
diff --git a/elfutils/libelf/gelf_rawchunk.c b/elfutils/libdwfl/dwfl_module_report_build_id.c
index ced6f9ef..4886931b 100644
--- a/elfutils/libelf/gelf_rawchunk.c
+++ b/elfutils/libdwfl/dwfl_module_report_build_id.c
@@ -1,7 +1,6 @@
-/* Retrieve uninterpreted chunk of the file contents.
- Copyright (C) 2002, 2005, 2007 Red Hat, Inc.
+/* Report build ID information for a module.
+ Copyright (C) 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Red Hat elfutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
@@ -48,61 +47,56 @@
Network licensing program, please visit www.openinventionnetwork.com
<http://www.openinventionnetwork.com>. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "libdwflP.h"
-#include <errno.h>
-#include <libelf.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
+// XXX vs report changed module: punting old file
+int
+dwfl_module_report_build_id (Dwfl_Module *mod,
+ const unsigned char *bits, size_t len,
+ GElf_Addr vaddr)
+{
+ if (mod == NULL)
+ return -1;
-#include <system.h>
-#include "libelfP.h"
+ if (mod->main.elf != NULL)
+ {
+ /* Once we know about a file, we won't take any lies about
+ its contents. The only permissible call is a no-op. */
+ if ((size_t) mod->build_id_len == len
+ && (mod->build_id_vaddr == vaddr || vaddr == 0)
+ && !memcmp (bits, mod->build_id_bits, len))
+ return 0;
-char *
-gelf_rawchunk (elf, offset, size)
- Elf *elf;
- GElf_Off offset;
- GElf_Word size;
-{
- if (elf == NULL)
+ __libdwfl_seterrno (DWFL_E_ALREADY_ELF);
+ return -1;
+ }
+
+ if (vaddr != 0 && (vaddr < mod->low_addr || vaddr + len > mod->high_addr))
{
- /* No valid descriptor. */
- __libelf_seterrno (ELF_E_INVALID_HANDLE);
- return NULL;
+ __libdwfl_seterrno (DWFL_E_ADDR_OUTOFRANGE);
+ return -1;
}
- if (unlikely (offset >= elf->maximum_size
- || offset + size >= elf->maximum_size
- || offset + size < offset))
+ void *copy = NULL;
+ if (len > 0)
{
- /* Invalid request. */
- __libelf_seterrno (ELF_E_INVALID_OP);
- return NULL;
+ copy = malloc (len);
+ if (unlikely (copy == NULL))
+ {
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ return -1;
+ }
+ memcpy (copy, bits, len);
}
- /* If the file is mmap'ed return an appropriate pointer. */
- if (elf->map_address != NULL)
- return (char *) elf->map_address + elf->start_offset + offset;
+ if (mod->build_id_len > 0)
+ free (mod->build_id_bits);
- /* We allocate the memory and read the data from the file. */
- char *result = (char *) malloc (size);
- if (result == NULL)
- __libelf_seterrno (ELF_E_NOMEM);
- else
- /* Read the file content. */
- if (unlikely ((size_t) pread_retry (elf->fildes, result, size,
- elf->start_offset + offset)
- != size))
- {
- /* Something went wrong. */
- __libelf_seterrno (ELF_E_READ_ERROR);
- free (result);
- result = NULL;
- }
+ mod->build_id_bits = copy;
+ mod->build_id_len = len;
+ mod->build_id_vaddr = vaddr;
- return result;
+ return 0;
}
+INTDEF (dwfl_module_report_build_id)
diff --git a/elfutils/libdwfl/dwfl_report_elf.c b/elfutils/libdwfl/dwfl_report_elf.c
index 03835386..0e5d09bc 100644
--- a/elfutils/libdwfl/dwfl_report_elf.c
+++ b/elfutils/libdwfl/dwfl_report_elf.c
@@ -1,5 +1,5 @@
/* Report a module to libdwfl based on ELF program headers.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -52,32 +52,23 @@
#include <unistd.h>
+/* We start every ET_REL module at a moderately aligned boundary.
+ This keeps the low addresses easy to read compared to a layout
+ starting at 0 (as when using -e). It also makes it unlikely
+ that a middle section will have a larger alignment and require
+ rejiggering (see below). */
+#define REL_MIN_ALIGN ((GElf_Xword) 0x100)
+
Dwfl_Module *
-dwfl_report_elf (Dwfl *dwfl, const char *name,
- const char *file_name, int fd, GElf_Addr base)
+internal_function
+__libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name,
+ int fd, Elf *elf, GElf_Addr base)
{
- bool closefd = false;
-
- if (fd < 0)
- {
- fd = open64 (file_name, O_RDONLY);
- if (fd < 0)
- {
- __libdwfl_seterrno (DWFL_E_ERRNO);
- return NULL;
- }
- closefd = true;
- }
-
- Elf *elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
-
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
if (ehdr == NULL)
{
elf_error:
__libdwfl_seterrno (DWFL_E_LIBELF);
- if (closefd)
- close (fd);
return NULL;
}
@@ -89,36 +80,102 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
By updating the section header in place, we leave the layout
information to be found by relocation. */
- start = end = base;
+ start = end = base = (base + REL_MIN_ALIGN - 1) & -REL_MIN_ALIGN;
+ bool first = true;
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (elf, scn)) != NULL)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr == NULL)
+ if (unlikely (shdr == NULL))
goto elf_error;
if (shdr->sh_flags & SHF_ALLOC)
{
const GElf_Xword align = shdr->sh_addralign ?: 1;
- shdr->sh_addr = (end + align - 1) & -align;
- if (end == base)
- /* This is the first section assigned a location.
- Use its aligned address as the module's base. */
- start = shdr->sh_addr;
- end = shdr->sh_addr + shdr->sh_size;
- if (! gelf_update_shdr (scn, shdr))
- goto elf_error;
+ const GElf_Addr next = (end + align - 1) & -align;
+ if (shdr->sh_addr == 0
+ /* Once we've started doing layout we have to do it all,
+ unless we just layed out the first section at 0 when
+ it already was at 0. */
+ || (bias == 0 && end > start && end != next))
+ {
+ shdr->sh_addr = next;
+ if (end == base)
+ /* This is the first section assigned a location.
+ Use its aligned address as the module's base. */
+ start = base = shdr->sh_addr;
+ else if (unlikely (base & (align - 1)))
+ {
+ /* If BASE has less than the maximum alignment of
+ any section, we eat more than the optimal amount
+ of padding and so make the module's apparent
+ size come out larger than it would when placed
+ at zero. So reset the layout with a better base. */
+
+ start = end = base = (base + align - 1) & -align;
+ Elf_Scn *prev_scn = NULL;
+ do
+ {
+ prev_scn = elf_nextscn (elf, prev_scn);
+ GElf_Shdr prev_shdr_mem;
+ GElf_Shdr *prev_shdr = gelf_getshdr (prev_scn,
+ &prev_shdr_mem);
+ if (unlikely (prev_shdr == NULL))
+ goto elf_error;
+ if (prev_shdr->sh_flags & SHF_ALLOC)
+ {
+ const GElf_Xword prev_align
+ = prev_shdr->sh_addralign ?: 1;
+
+ prev_shdr->sh_addr
+ = (end + prev_align - 1) & -prev_align;
+ end = prev_shdr->sh_addr + prev_shdr->sh_size;
+
+ if (unlikely (! gelf_update_shdr (prev_scn,
+ prev_shdr)))
+ goto elf_error;
+ }
+ }
+ while (prev_scn != scn);
+ continue;
+ }
+
+ end = shdr->sh_addr + shdr->sh_size;
+ if (likely (shdr->sh_addr != 0)
+ && unlikely (! gelf_update_shdr (scn, shdr)))
+ goto elf_error;
+ }
+ else
+ {
+ /* The address is already assigned. Just track it. */
+ if (first || end < shdr->sh_addr + shdr->sh_size)
+ end = shdr->sh_addr + shdr->sh_size;
+ if (first || bias > shdr->sh_addr)
+ /* This is the lowest address in the module. */
+ bias = shdr->sh_addr;
+
+ if ((shdr->sh_addr - bias + base) & (align - 1))
+ /* This section winds up misaligned using BASE.
+ Adjust BASE upwards to make it congruent to
+ the lowest section address in the file modulo ALIGN. */
+ base = (((base + align - 1) & -align)
+ + (bias & (align - 1)));
+ }
+
+ first = false;
}
}
- if (end == start)
+ if (bias != 0)
{
- __libdwfl_seterrno (DWFL_E_BADELF);
- if (closefd)
- close (fd);
- return NULL;
+ /* The section headers had nonzero sh_addr values. The layout
+ was already done. We've just collected the total span.
+ Now just compute the bias from the requested base. */
+ start = base;
+ end = end - bias + start;
+ bias = start - bias;
}
break;
@@ -134,7 +191,7 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
for (uint_fast16_t i = 0; i < ehdr->e_phnum; ++i)
{
GElf_Phdr phdr_mem, *ph = gelf_getphdr (elf, i, &phdr_mem);
- if (ph == NULL)
+ if (unlikely (ph == NULL))
goto elf_error;
if (ph->p_type == PT_LOAD)
{
@@ -149,7 +206,7 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
for (uint_fast16_t i = ehdr->e_phnum; i-- > 0;)
{
GElf_Phdr phdr_mem, *ph = gelf_getphdr (elf, i, &phdr_mem);
- if (ph == NULL)
+ if (unlikely (ph == NULL))
goto elf_error;
if (ph->p_type == PT_LOAD)
{
@@ -161,8 +218,6 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
if (end == 0)
{
__libdwfl_seterrno (DWFL_E_NO_PHDR);
- if (closefd)
- close (fd);
return NULL;
}
break;
@@ -181,8 +236,6 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
{
elf_end (elf);
overlap:
- if (closefd)
- close (fd);
m->gc = true;
__libdwfl_seterrno (DWFL_E_OVERLAP);
m = NULL;
@@ -204,4 +257,33 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
}
return m;
}
+
+Dwfl_Module *
+dwfl_report_elf (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd, GElf_Addr base)
+{
+ bool closefd = false;
+ if (fd < 0)
+ {
+ closefd = true;
+ fd = open64 (file_name, O_RDONLY);
+ if (fd < 0)
+ {
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return NULL;
+ }
+ }
+
+ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+ Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name,
+ fd, elf, base);
+ if (mod == NULL)
+ {
+ elf_end (elf);
+ if (closefd)
+ close (fd);
+ }
+
+ return mod;
+}
INTDEF (dwfl_report_elf)
diff --git a/elfutils/libdwfl/elf-from-memory.c b/elfutils/libdwfl/elf-from-memory.c
index 2a174759..c0e7c46d 100644
--- a/elfutils/libdwfl/elf-from-memory.c
+++ b/elfutils/libdwfl/elf-from-memory.c
@@ -1,5 +1,5 @@
/* Reconstruct an ELF file by reading the segments out of remote memory.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -154,7 +154,7 @@ elf_from_remote_memory (GElf_Addr ehdr_vma,
case ELFCLASS64:
xlatefrom.d_size = sizeof (Elf64_Ehdr);
- if (elf32_xlatetom (&xlateto, &xlatefrom, buffer[EI_DATA]) == NULL)
+ if (elf64_xlatetom (&xlateto, &xlatefrom, buffer[EI_DATA]) == NULL)
goto libelf_error;
phoff = ehdr.e64.e_phoff;
phnum = ehdr.e64.e_phnum;
@@ -213,6 +213,7 @@ elf_from_remote_memory (GElf_Addr ehdr_vma,
size_t contents_size = 0;
GElf_Off segments_end = 0;
GElf_Addr loadbase = ehdr_vma;
+ bool found_base = false;
switch (ehdr.e32.e_ident[EI_CLASS])
{
inline void handle_segment (GElf_Addr vaddr, GElf_Off offset,
@@ -223,8 +224,11 @@ elf_from_remote_memory (GElf_Addr ehdr_vma,
if (segment_end > (GElf_Off) contents_size)
contents_size = segment_end;
- if ((offset & -align) == 0 && loadbase == ehdr_vma)
- loadbase = ehdr_vma - (vaddr & -align);
+ if (!found_base && (offset & -align) == 0)
+ {
+ loadbase = ehdr_vma - (vaddr & -align);
+ found_base = true;
+ }
segments_end = offset + filesz;
}
diff --git a/elfutils/libdwfl/find-debuginfo.c b/elfutils/libdwfl/find-debuginfo.c
index ca1fadcb..f1ff3a4b 100644
--- a/elfutils/libdwfl/find-debuginfo.c
+++ b/elfutils/libdwfl/find-debuginfo.c
@@ -90,15 +90,37 @@ check_crc (int fd, GElf_Word debuglink_crc)
&& file_crc == debuglink_crc);
}
-int
-dwfl_standard_find_debuginfo (Dwfl_Module *mod,
- void **userdata __attribute__ ((unused)),
- const char *modname __attribute__ ((unused)),
- GElf_Addr base __attribute__ ((unused)),
- const char *file_name,
- const char *debuglink_file,
- GElf_Word debuglink_crc,
- char **debuginfo_file_name)
+static bool
+validate (Dwfl_Module *mod, int fd, bool check, GElf_Word debuglink_crc)
+{
+ /* If we have a build ID, check only that. */
+ if (mod->build_id_len > 0)
+ {
+ /* We need to open an Elf handle on the file so we can check its
+ build ID note for validation. Backdoor the handle into the
+ module data structure since we had to open it early anyway. */
+ mod->debug.elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+ if (likely (__libdwfl_find_build_id (mod, false, mod->debug.elf) == 2))
+ /* Also backdoor the gratuitous flag. */
+ mod->debug.valid = true;
+ else
+ {
+ /* A mismatch! */
+ elf_end (mod->debug.elf);
+ mod->debug.elf = NULL;
+ mod->debug.valid = false;
+ }
+
+ return mod->debug.valid;
+ }
+
+ return !check || check_crc (fd, debuglink_crc);
+}
+
+static int
+find_debuginfo_in_path (Dwfl_Module *mod, const char *file_name,
+ const char *debuglink_file, GElf_Word debuglink_crc,
+ char **debuginfo_file_name)
{
bool cancheck = debuglink_crc != (GElf_Word) 0;
@@ -181,7 +203,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
default:
return -1;
}
- if (!check || check_crc (fd, debuglink_crc))
+ if (validate (mod, fd, check, debuglink_crc))
{
*debuginfo_file_name = fname;
return fd;
@@ -194,4 +216,33 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
errno = 0;
return -1;
}
+
+int
+dwfl_standard_find_debuginfo (Dwfl_Module *mod,
+ void **userdata __attribute__ ((unused)),
+ const char *modname __attribute__ ((unused)),
+ GElf_Addr base __attribute__ ((unused)),
+ const char *file_name,
+ const char *debuglink_file,
+ GElf_Word debuglink_crc,
+ char **debuginfo_file_name)
+{
+ /* First try by build ID if we have one. If that succeeds or fails
+ other than just by finding nothing, that's all we do. */
+ const unsigned char *bits;
+ GElf_Addr vaddr;
+ if (INTUSE(dwfl_module_build_id) (mod, &bits, &vaddr) > 0)
+ {
+ int fd = INTUSE(dwfl_build_id_find_debuginfo) (mod,
+ NULL, NULL, 0,
+ NULL, NULL, 0,
+ debuginfo_file_name);
+ if (fd >= 0 || errno != 0)
+ return fd;
+ }
+
+ /* Failing that, search the path by name. */
+ return find_debuginfo_in_path (mod, file_name, debuglink_file, debuglink_crc,
+ debuginfo_file_name);
+}
INTDEF (dwfl_standard_find_debuginfo)
diff --git a/elfutils/libdwfl/libdwfl.h b/elfutils/libdwfl/libdwfl.h
index ec006562..5438ee2d 100644
--- a/elfutils/libdwfl/libdwfl.h
+++ b/elfutils/libdwfl/libdwfl.h
@@ -156,6 +156,14 @@ extern int dwfl_report_end (Dwfl *dwfl,
void *arg),
void *arg);
+/* Start reporting additional modules to the library. No calls but
+ dwfl_report_* can be made on DWFL until dwfl_report_end is called.
+ This is like dwfl_report_begin, but all the old modules are kept on.
+ More dwfl_report_* calls can follow to add more modules.
+ When dwfl_report_end is called, no old modules will be removed. */
+extern void dwfl_report_begin_add (Dwfl *dwfl);
+
+
/* Return the name of the module, and for each non-null argument store
interesting details: *USERDATA is a location for storing your own
pointer, **USERDATA is initially null; *START and *END give the address
@@ -186,27 +194,82 @@ extern ptrdiff_t dwfl_getmodules (Dwfl *dwfl,
extern Dwfl_Module *dwfl_addrmodule (Dwfl *dwfl, Dwarf_Addr address);
+/* Report the known build ID bits associated with a module.
+ If VADDR is nonzero, it gives the absolute address where those
+ bits are found within the module. This can be called at any
+ time, but is usually used immediately after dwfl_report_module.
+ Once the module's main ELF file is opened, the ID note found
+ there takes precedence and cannot be changed. */
+extern int dwfl_module_report_build_id (Dwfl_Module *mod,
+ const unsigned char *bits, size_t len,
+ GElf_Addr vaddr)
+ __nonnull_attribute__ (2);
+
+/* Extract the build ID bits associated with a module.
+ Returns -1 for errors, 0 if no ID is known, or the number of ID bytes.
+ When an ID is found, *BITS points to it; *VADDR is the absolute address
+ at which the ID bits are found within the module, or 0 if unknown.
+
+ This returns 0 when the module's main ELF file has not yet been loaded
+ and its build ID bits were not reported. To ensure the ID is always
+ returned when determinable, call dwfl_module_getelf first. */
+extern int dwfl_module_build_id (Dwfl_Module *mod,
+ const unsigned char **bits, GElf_Addr *vaddr)
+ __nonnull_attribute__ (2, 3);
+
+
/*** Standard callbacks ***/
-/* Standard find_debuginfo callback function.
- This is controlled by a string specifying directories to look in.
+/* These standard find_elf and find_debuginfo callbacks are
+ controlled by a string specifying directories to look in.
If `debuginfo_path' is set in the Dwfl_Callbacks structure
- and the char * it points to is not null, that supplies the string.
- Otherwise a default path is used.
-
- If the first character of the string is + or - that says to check or to
- ignore (respectively) the CRC32 checksum from the .gnu_debuglink
- section. The default is to check it. The remainder of the string is
- composed of elements separated by colons. Each element can start with +
- or - to override the global checksum behavior. If the remainder of the
- element is empty, the directory containing the main file is tried; if
- it's an absolute path name, the absolute directory path containing the
- main file is taken as a subdirectory of this path; a relative path name
- is taken as a subdirectory of the directory containing the main file.
- Hence for /bin/ls, string ":.debug:/usr/lib/debug" says to look in /bin,
- then /bin/.debug, then /usr/lib/debug/bin, for the file name in the
- .gnu_debuglink section (or "ls.debug" if none was found). */
+ and the char * it points to is not null, that supplies the
+ string. Otherwise a default path is used.
+
+ If the first character of the string is + or - that enables or
+ disables CRC32 checksum validation when it's necessary. The
+ remainder of the string is composed of elements separated by
+ colons. Each element can start with + or - to override the
+ global checksum behavior. This flag is never relevant when
+ working with build IDs, but it's always parsed in the path
+ string. The remainder of the element indicates a directory.
+
+ Searches by build ID consult only the elements naming absolute
+ directory paths. They look under those directories for a link
+ named ".build-id/xx/yy" or ".build-id/xx/yy.debug", where "xxyy"
+ is the lower-case hexadecimal representation of the ID bytes.
+
+ In searches for debuginfo by name, if the remainder of the
+ element is empty, the directory containing the main file is
+ tried; if it's an absolute path name, the absolute directory path
+ containing the main file is taken as a subdirectory of this path;
+ a relative path name is taken as a subdirectory of the directory
+ containing the main file. Hence for /bin/ls, the default string
+ ":.debug:/usr/lib/debug" says to look in /bin, then /bin/.debug,
+ then /usr/lib/debug/bin, for the file name in the .gnu_debuglink
+ section (or "ls.debug" if none was found). */
+
+/* Standard find_elf callback function working solely on build ID.
+ This can be tried first by any find_elf callback, to use the
+ bits passed to dwfl_module_report_build_id, if any. */
+extern int dwfl_build_id_find_elf (Dwfl_Module *, void **,
+ const char *, Dwarf_Addr,
+ char **, Elf **);
+
+/* Standard find_debuginfo callback function working solely on build ID.
+ This can be tried first by any find_debuginfo callback,
+ to use the build ID bits from the main file when present. */
+extern int dwfl_build_id_find_debuginfo (Dwfl_Module *, void **,
+ const char *, Dwarf_Addr,
+ const char *, const char *,
+ GElf_Word, char **);
+/* Standard find_debuginfo callback function.
+ If a build ID is available, this tries first to use that.
+ If there is no build ID or no valid debuginfo found by ID,
+ it searches the debuginfo path by name, as described above.
+ Any file found in the path is validated by build ID if possible,
+ or else by CRC32 checksum if enabled, and skipped if it does not match. */
extern int dwfl_standard_find_debuginfo (Dwfl_Module *, void **,
const char *, Dwarf_Addr,
const char *, const char *,
@@ -332,6 +395,21 @@ extern const char *dwfl_module_getsym (Dwfl_Module *mod, int ndx,
/* Find the symbol that ADDRESS lies inside, and return its name. */
extern const char *dwfl_module_addrname (Dwfl_Module *mod, GElf_Addr address);
+/* Find the symbol that ADDRESS lies inside, and return detailed
+ information as for dwfl_module_getsym (above). */
+extern const char *dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr address,
+ GElf_Sym *sym, GElf_Word *shndxp)
+ __nonnull_attribute__ (3);
+
+/* Find the ELF section that *ADDRESS lies inside and return it.
+ On success, adjusts *ADDRESS to be relative to the section,
+ and sets *BIAS to the difference between addresses used in
+ the returned section's headers and run-time addresses. */
+extern Elf_Scn *dwfl_module_address_section (Dwfl_Module *mod,
+ Dwarf_Addr *address,
+ Dwarf_Addr *bias)
+ __nonnull_attribute__ (2, 3);
+
/*** Dwarf access functions ***/
diff --git a/elfutils/libdwfl/libdwflP.h b/elfutils/libdwfl/libdwflP.h
index 31da938d..bbb56aac 100644
--- a/elfutils/libdwfl/libdwflP.h
+++ b/elfutils/libdwfl/libdwflP.h
@@ -1,5 +1,5 @@
/* Internal definitions for libdwfl.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -50,7 +50,7 @@
#ifndef _LIBDWFLP_H
#define _LIBDWFLP_H 1
-#ifndef PACKAGE
+#ifndef PACKAGE_NAME
# include <config.h>
#endif
#include <libdwfl.h>
@@ -88,6 +88,7 @@
DWFL_ERROR (ADDR_OUTOFRANGE, N_("address out of range")) \
DWFL_ERROR (NO_MATCH, N_("no matching address range")) \
DWFL_ERROR (TRUNCATED, N_("image truncated")) \
+ DWFL_ERROR (ALREADY_ELF, N_("ELF file opened")) \
DWFL_ERROR (BADELF, N_("not a valid ELF file")) \
DWFL_ERROR (WEIRD_TYPE, N_("cannot handle DWARF type description"))
@@ -119,6 +120,8 @@ struct dwfl_file
{
char *name;
int fd;
+ bool valid; /* The build ID note has been matched. */
+ bool relocated; /* Partial relocation of all sections done. */
Elf *elf;
GElf_Addr bias; /* Actual load address - p_vaddr. */
@@ -134,6 +137,10 @@ struct Dwfl_Module
char *name; /* Iterator name for this module. */
GElf_Addr low_addr, high_addr;
+ void *build_id_bits; /* malloc'd copy of build ID bits. */
+ GElf_Addr build_id_vaddr; /* Address where they reside, 0 if unknown. */
+ int build_id_len; /* -1 for prior failure, 0 if unset. */
+
struct dwfl_file main, debug;
Ebl *ebl;
GElf_Half e_type; /* GElf_Ehdr.e_type cache. */
@@ -221,18 +228,27 @@ extern void __libdwfl_module_free (Dwfl_Module *mod) internal_function;
/* Process relocations in debugging sections in an ET_REL file.
- DEBUGFILE must be opened with ELF_C_READ_MMAP_PRIVATE or ELF_C_READ,
+ FILE must be opened with ELF_C_READ_MMAP_PRIVATE or ELF_C_READ,
to make it possible to relocate the data in place (or ELF_C_RDWR or
ELF_C_RDWR_MMAP if you intend to modify the Elf file on disk). After
- this, dwarf_begin_elf on DEBUGFILE will read the relocated data. */
-extern Dwfl_Error __libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile)
+ this, dwarf_begin_elf on FILE will read the relocated data.
+
+ When DEBUG is false, apply partial relocation to all sections. */
+extern Dwfl_Error __libdwfl_relocate (Dwfl_Module *mod, Elf *file, bool debug)
+ internal_function;
+
+/* Process (simple) relocations in arbitrary section TSCN of an ET_REL file.
+ RELOCSCN is SHT_REL or SHT_RELA and TSCN is its sh_info target section. */
+extern Dwfl_Error __libdwfl_relocate_section (Dwfl_Module *mod, Elf *relocated,
+ Elf_Scn *relocscn, Elf_Scn *tscn,
+ bool partial)
internal_function;
/* Adjust *VALUE from section-relative to absolute.
MOD->dwfl->callbacks->section_address is called to determine the actual
address of a loaded section. */
-extern Dwfl_Error __libdwfl_relocate_value (Dwfl_Module *mod,
- size_t m_shstrndx,
+extern Dwfl_Error __libdwfl_relocate_value (Dwfl_Module *mod, Elf *elf,
+ size_t *shstrndx_cache,
Elf32_Word shndx,
GElf_Addr *value)
internal_function;
@@ -253,14 +269,39 @@ extern Dwfl_Error __libdwfl_addrcu (Dwfl_Module *mod, Dwarf_Addr addr,
/* Ensure that CU->lines (and CU->cu->lines) is set up. */
extern Dwfl_Error __libdwfl_cu_getsrclines (struct dwfl_cu *cu)
- internal_function;
+ internal_function;
+/* Look in ELF for an NT_GNU_BUILD_ID note. If SET is true, store it
+ in MOD and return its length. If SET is false, instead compare it
+ to that stored in MOD and return 2 if they match, 1 if they do not.
+ Returns -1 for errors, 0 if no note is found. */
+extern int __libdwfl_find_build_id (Dwfl_Module *mod, bool set, Elf *elf)
+ internal_function;
+
+/* Open a main or debuginfo file by its build ID, returns the fd. */
+extern int __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug,
+ char **file_name) internal_function;
extern uint32_t __libdwfl_crc32 (uint32_t crc, unsigned char *buf, size_t len)
- attribute_hidden;
+ attribute_hidden;
extern int __libdwfl_crc32_file (int fd, uint32_t *resp) attribute_hidden;
+/* Meat of dwfl_report_elf, given elf_begin just called.
+ Consumes ELF on success, not on failure. */
+extern Dwfl_Module *__libdwfl_report_elf (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd,
+ Elf *elf, GElf_Addr base)
+ internal_function;
+
+/* Meat of dwfl_report_offline. */
+extern Dwfl_Module *__libdwfl_report_offline (Dwfl *dwfl, const char *name,
+ const char *file_name,
+ int fd, bool closefd,
+ int (*predicate) (const char *,
+ const char *))
+ internal_function;
+
/* Avoid PLT entries. */
INTDECL (dwfl_begin)
@@ -269,16 +310,22 @@ INTDECL (dwfl_addrmodule)
INTDECL (dwfl_addrdwarf)
INTDECL (dwfl_addrdie)
INTDECL (dwfl_module_addrdie)
+INTDECL (dwfl_module_addrsym)
+INTDECL (dwfl_module_build_id)
INTDECL (dwfl_module_getdwarf)
INTDECL (dwfl_module_getelf)
INTDECL (dwfl_module_getsym)
INTDECL (dwfl_module_getsymtab)
INTDECL (dwfl_module_getsrc)
+INTDECL (dwfl_module_report_build_id)
INTDECL (dwfl_report_elf)
INTDECL (dwfl_report_begin)
+INTDECL (dwfl_report_begin_add)
INTDECL (dwfl_report_module)
INTDECL (dwfl_report_offline)
INTDECL (dwfl_report_end)
+INTDECL (dwfl_build_id_find_elf)
+INTDECL (dwfl_build_id_find_debuginfo)
INTDECL (dwfl_standard_find_debuginfo)
INTDECL (dwfl_linux_kernel_find_elf)
INTDECL (dwfl_linux_kernel_module_section_address)
diff --git a/elfutils/libdwfl/linux-kernel-modules.c b/elfutils/libdwfl/linux-kernel-modules.c
index 4ea391c0..b113806e 100644
--- a/elfutils/libdwfl/linux-kernel-modules.c
+++ b/elfutils/libdwfl/linux-kernel-modules.c
@@ -63,8 +63,13 @@
#include <fts.h>
+#define KERNEL_MODNAME "kernel"
+
#define MODULEDIRFMT "/lib/modules/%s"
+#define KNOTESFILE "/sys/kernel/notes"
+#define MODNOTESFMT "/sys/module/%s/notes"
+#define KSYMSFILE "/proc/kallsyms"
#define MODULELIST "/proc/modules"
#define SECADDRDIRFMT "/sys/module/%s/sections/"
#define MODULE_SECT_NAME_LEN 32 /* Minimum any linux/module.h has had. */
@@ -72,7 +77,7 @@
/* Try to open the given file as it is or under the debuginfo directory. */
static int
-try_kernel_name (Dwfl *dwfl, char **fname)
+try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug)
{
if (*fname == NULL)
return -1;
@@ -92,7 +97,7 @@ try_kernel_name (Dwfl *dwfl, char **fname)
fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0,
*fname, basename (*fname), 0,
&debugfname);
- if (fd < 0)
+ if (fd < 0 && try_debug)
/* Next, let the call use the default of basename + ".debug",
to look for "vmlinux.debug" files. */
fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0,
@@ -116,29 +121,57 @@ kernel_release (void)
}
static int
-report_kernel (Dwfl *dwfl, const char *release,
- int (*predicate) (const char *module, const char *file))
+find_kernel_elf (Dwfl *dwfl, const char *release, char **fname)
{
- if (dwfl == NULL)
- return -1;
-
- char *fname;
if ((release[0] == '/'
- ? asprintf (&fname, "%s/vmlinux", release)
- : asprintf (&fname, "/boot/vmlinux-%s", release)) < 0)
+ ? asprintf (fname, "%s/vmlinux", release)
+ : asprintf (fname, "/boot/vmlinux-%s", release)) < 0)
return -1;
- int fd = try_kernel_name (dwfl, &fname);
+
+ int fd = try_kernel_name (dwfl, fname, true);
if (fd < 0 && release[0] != '/')
{
- free (fname);
- if (asprintf (&fname, MODULEDIRFMT "/vmlinux", release) < 0)
+ free (*fname);
+ if (asprintf (fname, MODULEDIRFMT "/vmlinux", release) < 0)
return -1;
- fd = try_kernel_name (dwfl, &fname);
+ fd = try_kernel_name (dwfl, fname, true);
}
- int result = 0;
+ return fd;
+}
+
+static int
+get_release (Dwfl *dwfl, const char **release)
+{
+ if (dwfl == NULL)
+ return -1;
+
+ const char *release_string = release == NULL ? NULL : *release;
+ if (release_string == NULL)
+ {
+ release_string = kernel_release ();
+ if (release_string == NULL)
+ return errno;
+ if (release != NULL)
+ *release = release_string;
+ }
+
+ return 0;
+}
+
+static int
+report_kernel (Dwfl *dwfl, const char **release,
+ int (*predicate) (const char *module, const char *file))
+{
+ int result = get_release (dwfl, release);
+ if (unlikely (result != 0))
+ return result;
+
+ char *fname;
+ int fd = find_kernel_elf (dwfl, *release, &fname);
+
if (fd < 0)
- result = ((predicate != NULL && !(*predicate) ("kernel", NULL))
+ result = ((predicate != NULL && !(*predicate) (KERNEL_MODNAME, NULL))
? 0 : errno ?: ENOENT);
else
{
@@ -147,18 +180,25 @@ report_kernel (Dwfl *dwfl, const char *release,
if (predicate != NULL)
{
/* Let the predicate decide whether to use this one. */
- int want = (*predicate) ("kernel", fname);
+ int want = (*predicate) (KERNEL_MODNAME, fname);
if (want < 0)
result = errno;
report = want > 0;
}
- if (report
- && INTUSE(dwfl_report_elf) (dwfl, "kernel", fname, fd, 0) == NULL)
+ if (report)
{
- close (fd);
- result = -1;
+ Dwfl_Module *mod = INTUSE(dwfl_report_elf) (dwfl, KERNEL_MODNAME,
+ fname, fd, 0);
+ if (mod == NULL)
+ result = -1;
+
+ /* The kernel is ET_EXEC, but always treat it as relocatable. */
+ mod->e_type = ET_DYN;
}
+
+ if (!report || result < 0)
+ close (fd);
}
free (fname);
@@ -166,6 +206,51 @@ report_kernel (Dwfl *dwfl, const char *release,
return result;
}
+/* Look for a kernel debug archive. If we find one, report all its modules.
+ If not, return ENOENT. */
+static int
+report_kernel_archive (Dwfl *dwfl, const char **release,
+ int (*predicate) (const char *module, const char *file))
+{
+ int result = get_release (dwfl, release);
+ if (unlikely (result != 0))
+ return result;
+
+ char *archive;
+ if (unlikely ((*release)[0] == '/'
+ ? asprintf (&archive, "%s/debug.a", *release)
+ : asprintf (&archive, MODULEDIRFMT "/debug.a", *release)) < 0)
+ return ENOMEM;
+
+ int fd = try_kernel_name (dwfl, &archive, false);
+ if (fd < 0)
+ result = errno ?: ENOENT;
+ else
+ {
+ /* We have the archive file open! */
+ Dwfl_Module *last = __libdwfl_report_offline (dwfl, NULL, archive, fd,
+ true, predicate);
+ if (unlikely (last == NULL))
+ result = -1;
+ else
+ {
+ /* Find the kernel and move it to the head of the list. */
+ Dwfl_Module **tailp = &dwfl->modulelist, **prevp = tailp;
+ for (Dwfl_Module *m = *prevp; m != NULL; m = *(prevp = &m->next))
+ if (!m->gc && m->e_type != ET_REL && !strcmp (m->name, "kernel"))
+ {
+ *prevp = m->next;
+ m->next = *tailp;
+ *tailp = m;
+ break;
+ }
+ }
+ }
+
+ free (archive);
+ return result;
+}
+
/* Report a kernel and all its modules found on disk, for offline use.
If RELEASE starts with '/', it names a directory to look in;
if not, it names a directory to find under /lib/modules/;
@@ -177,29 +262,26 @@ dwfl_linux_kernel_report_offline (Dwfl *dwfl, const char *release,
int (*predicate) (const char *module,
const char *file))
{
- if (release == NULL)
- {
- release = kernel_release ();
- if (release == NULL)
- return errno;
- }
+ int result = report_kernel_archive (dwfl, &release, predicate);
+ if (result != ENOENT)
+ return result;
/* First report the kernel. */
- int result = report_kernel (dwfl, release, predicate);
+ result = report_kernel (dwfl, &release, predicate);
if (result == 0)
{
- /* Do "find /lib/modules/RELEASE/kernel -name *.ko". */
+ /* Do "find /lib/modules/RELEASE -name *.ko". */
char *modulesdir[] = { NULL, NULL };
if (release[0] == '/')
modulesdir[0] = (char *) release;
else
{
- if (asprintf (&modulesdir[0], MODULEDIRFMT "/kernel", release) < 0)
+ if (asprintf (&modulesdir[0], MODULEDIRFMT, release) < 0)
return errno;
}
- FTS *fts = fts_open (modulesdir, FTS_LOGICAL | FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
if (modulesdir[0] == (char *) release)
modulesdir[0] = NULL;
if (fts == NULL)
@@ -279,15 +361,218 @@ dwfl_linux_kernel_report_offline (Dwfl *dwfl, const char *release,
INTDEF (dwfl_linux_kernel_report_offline)
-/* Find the ELF file for the running kernel and dwfl_report_elf it. */
+/* Grovel around to guess the bounds of the runtime kernel image. */
+static int
+intuit_kernel_bounds (Dwarf_Addr *start, Dwarf_Addr *end, Dwarf_Addr *notes)
+{
+ FILE *f = fopen (KSYMSFILE, "r");
+ if (f == NULL)
+ return errno;
+
+ (void) __fsetlocking (f, FSETLOCKING_BYCALLER);
+
+ *notes = 0;
+
+ char *line = NULL;
+ size_t linesz = 0;
+ size_t n = getline (&line, &linesz, f);
+ Dwarf_Addr first;
+ char *p = NULL;
+ int result = 0;
+ if (n > 0 && (first = strtoull (line, &p, 16)) > 0 && p > line)
+ {
+ Dwarf_Addr last = 0;
+ while ((n = getline (&line, &linesz, f)) > 1 && line[n - 2] != ']')
+ {
+ p = NULL;
+ last = strtoull (line, &p, 16);
+ if (p == NULL || p == line || last == 0)
+ {
+ result = -1;
+ break;
+ }
+
+ if (*notes == 0)
+ {
+ const char *sym = (strsep (&p, " \t\n")
+ ? strsep (&p, " \t\n") : NULL);
+ if (sym != NULL && !strcmp (sym, "__start_notes"))
+ *notes = last;
+ }
+ }
+ if ((n == 0 && feof_unlocked (f)) || (n > 1 && line[n - 2] == ']'))
+ {
+ Dwarf_Addr round_kernel = sysconf (_SC_PAGE_SIZE);
+ first &= -(Dwarf_Addr) round_kernel;
+ last += round_kernel - 1;
+ last &= -(Dwarf_Addr) round_kernel;
+ *start = first;
+ *end = last;
+ result = 0;
+ }
+ }
+ free (line);
+
+ if (result == -1)
+ result = ferror_unlocked (f) ? errno : ENOEXEC;
+
+ fclose (f);
+
+ return result;
+}
+
+
+/* Look for a build ID note in NOTESFILE and associate the ID with MOD. */
+static int
+check_notes (Dwfl_Module *mod, const char *notesfile,
+ Dwarf_Addr vaddr, const char *secname)
+{
+ int fd = open64 (notesfile, O_RDONLY);
+ if (fd < 0)
+ return 1;
+
+ assert (sizeof (Elf32_Nhdr) == sizeof (GElf_Nhdr));
+ assert (sizeof (Elf64_Nhdr) == sizeof (GElf_Nhdr));
+ union
+ {
+ GElf_Nhdr nhdr;
+ unsigned char data[8192];
+ } buf;
+
+ ssize_t n = read (fd, buf.data, sizeof buf);
+ close (fd);
+
+ if (n <= 0)
+ return 1;
+
+ unsigned char *p = buf.data;
+ while (p < &buf.data[n])
+ {
+ /* No translation required since we are reading the native kernel. */
+ GElf_Nhdr *nhdr = (void *) p;
+ p += sizeof *nhdr;
+ unsigned char *name = p;
+ p += (nhdr->n_namesz + 3) & -4U;
+ unsigned char *bits = p;
+ p += (nhdr->n_descsz + 3) & -4U;
+
+ if (p <= &buf.data[n]
+ && nhdr->n_type == NT_GNU_BUILD_ID
+ && nhdr->n_namesz == sizeof "GNU"
+ && !memcmp (name, "GNU", sizeof "GNU"))
+ {
+ /* Found it. For a module we must figure out its VADDR now. */
+
+ if (secname != NULL
+ && (INTUSE(dwfl_linux_kernel_module_section_address)
+ (mod, NULL, mod->name, 0, secname, 0, NULL, &vaddr) != 0
+ || vaddr == (GElf_Addr) -1l))
+ vaddr = 0;
+
+ if (vaddr != 0)
+ vaddr += bits - buf.data;
+ return INTUSE(dwfl_module_report_build_id) (mod, bits,
+ nhdr->n_descsz, vaddr);
+ }
+ }
+
+ return 0;
+}
+
+/* Look for a build ID for the kernel. */
+static int
+check_kernel_notes (Dwfl_Module *kernelmod, GElf_Addr vaddr)
+{
+ return check_notes (kernelmod, KNOTESFILE, vaddr, NULL) < 0 ? -1 : 0;
+}
+
+/* Look for a build ID for a loaded kernel module. */
+static int
+check_module_notes (Dwfl_Module *mod)
+{
+ char *dirs[2] = { NULL, NULL };
+ if (asprintf (&dirs[0], MODNOTESFMT, mod->name) < 0)
+ return ENOMEM;
+
+ FTS *fts = fts_open (dirs, FTS_NOSTAT, NULL);
+ if (fts == NULL)
+ {
+ free (dirs[0]);
+ return 0;
+ }
+
+ int result = 0;
+ FTSENT *f;
+ while ((f = fts_read (fts)) != NULL)
+ {
+ switch (f->fts_info)
+ {
+ case FTS_F:
+ case FTS_NSOK:
+ result = check_notes (mod, f->fts_accpath, 0, f->fts_name);
+ if (result > 0) /* Nothing found. */
+ {
+ result = 0;
+ continue;
+ }
+ break;
+
+ case FTS_ERR:
+ case FTS_DNR:
+ result = f->fts_errno;
+ break;
+
+ case FTS_NS:
+ default:
+ continue;
+ }
+
+ /* We only get here when finished or in error cases. */
+ break;
+ }
+ fts_close (fts);
+ free (dirs[0]);
+
+ return result;
+}
+
int
dwfl_linux_kernel_report_kernel (Dwfl *dwfl)
{
- const char *release = kernel_release ();
- if (release == NULL)
- return errno;
+ Dwarf_Addr start;
+ Dwarf_Addr end;
+ inline Dwfl_Module *report (void)
+ {
+ return INTUSE(dwfl_report_module) (dwfl, KERNEL_MODNAME, start, end);
+ }
+
+ /* This is a bit of a kludge. If we already reported the kernel,
+ don't bother figuring it out again--it never changes. */
+ for (Dwfl_Module *m = dwfl->modulelist; m != NULL; m = m->next)
+ if (!strcmp (m->name, KERNEL_MODNAME))
+ {
+ start = m->low_addr;
+ end = m->high_addr;
+ return report () == NULL ? -1 : 0;
+ }
- return report_kernel (dwfl, release, NULL);
+ /* Try to figure out the bounds of the kernel image without
+ looking for any vmlinux file. */
+ Dwarf_Addr notes;
+ /* The compiler cannot deduce that if intuit_kernel_bounds returns
+ zero NOTES will be initialized. Fake the initialization. */
+ asm ("" : "=m" (notes));
+ int result = intuit_kernel_bounds (&start, &end, &notes);
+ if (result == 0)
+ {
+ Dwfl_Module *mod = report ();
+ return unlikely (mod == NULL) ? -1 : check_kernel_notes (mod, notes);
+ }
+ if (result != ENOENT)
+ return result;
+
+ /* Find the ELF file for the running kernel and dwfl_report_elf it. */
+ return report_kernel (dwfl, NULL, NULL);
}
INTDEF (dwfl_linux_kernel_report_kernel)
@@ -295,24 +580,34 @@ INTDEF (dwfl_linux_kernel_report_kernel)
/* Dwfl_Callbacks.find_elf for the running Linux kernel and its modules. */
int
-dwfl_linux_kernel_find_elf (Dwfl_Module *mod __attribute__ ((unused)),
+dwfl_linux_kernel_find_elf (Dwfl_Module *mod,
void **userdata __attribute__ ((unused)),
const char *module_name,
Dwarf_Addr base __attribute__ ((unused)),
- char **file_name,
- Elf **elfp __attribute__ ((unused)))
+ char **file_name, Elf **elfp)
{
+ if (mod->build_id_len > 0)
+ {
+ int fd = INTUSE(dwfl_build_id_find_elf) (mod, NULL, NULL, 0,
+ file_name, elfp);
+ if (fd >= 0 || errno != 0)
+ return fd;
+ }
+
const char *release = kernel_release ();
if (release == NULL)
return errno;
- /* Do "find /lib/modules/`uname -r`/kernel -name MODULE_NAME.ko". */
+ if (!strcmp (module_name, KERNEL_MODNAME))
+ return find_kernel_elf (mod->dwfl, release, file_name);
+
+ /* Do "find /lib/modules/`uname -r` -name MODULE_NAME.ko". */
char *modulesdir[] = { NULL, NULL };
- if (asprintf (&modulesdir[0], MODULEDIRFMT "/kernel", release) < 0)
+ if (asprintf (&modulesdir[0], MODULEDIRFMT, release) < 0)
return -1;
- FTS *fts = fts_open (modulesdir, FTS_LOGICAL | FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
if (fts == NULL)
{
free (modulesdir[0]);
@@ -416,8 +711,8 @@ dwfl_linux_kernel_module_section_address
Dwarf_Addr *addr)
{
char *sysfile;
- if (asprintf (&sysfile, SECADDRDIRFMT "%s", modname, secname))
- return ENOMEM;
+ if (asprintf (&sysfile, SECADDRDIRFMT "%s", modname, secname) < 0)
+ return DWARF_CB_ABORT;
FILE *f = fopen (sysfile, "r");
free (sysfile);
@@ -468,7 +763,7 @@ dwfl_linux_kernel_module_section_address
int len = asprintf (&sysfile, SECADDRDIRFMT "%s",
modname, secname);
if (len < 0)
- return ENOMEM;
+ return DWARF_CB_ABORT;
char *end = sysfile + len;
do
{
@@ -521,14 +816,26 @@ dwfl_linux_kernel_report_modules (Dwfl *dwfl)
Dwarf_Addr modaddr;
unsigned long int modsz;
char modname[128];
- while (fscanf (f, "%128s %lu %*s %*s %*s %" PRIx64 "\n",
- modname, &modsz, &modaddr) == 3)
- if (INTUSE(dwfl_report_module) (dwfl, modname,
- modaddr, modaddr + modsz) == NULL)
- {
- result = -1;
- break;
- }
+ char *line = NULL;
+ size_t linesz = 0;
+ /* We can't just use fscanf here because it's not easy to distinguish \n
+ from other whitespace so as to take the optional word following the
+ address but always stop at the end of the line. */
+ while (getline (&line, &linesz, f) > 0
+ && sscanf (line, "%128s %lu %*s %*s %*s %" PRIx64 " %*s\n",
+ modname, &modsz, &modaddr) == 3)
+ {
+ Dwfl_Module *mod = INTUSE(dwfl_report_module) (dwfl, modname,
+ modaddr, modaddr + modsz);
+ if (mod == NULL)
+ {
+ result = -1;
+ break;
+ }
+
+ result = check_module_notes (mod);
+ }
+ free (line);
if (result == 0)
result = ferror_unlocked (f) ? errno : feof_unlocked (f) ? 0 : ENOEXEC;
diff --git a/elfutils/libdwfl/offline.c b/elfutils/libdwfl/offline.c
index bde2aeb9..ff7b793a 100644
--- a/elfutils/libdwfl/offline.c
+++ b/elfutils/libdwfl/offline.c
@@ -48,11 +48,12 @@
<http://www.openinventionnetwork.com>. */
#include "libdwflP.h"
+#include <fcntl.h>
#include <unistd.h>
/* Since dwfl_report_elf lays out the sections already, this will only be
called when the section headers of the debuginfo file are being
- consulted instead, or for a section located at zeron. With binutils
+ consulted instead, or for the section placed at 0. With binutils
strip-to-debug, the symbol table is in the debuginfo file and relocation
looks there. */
int
@@ -65,33 +66,89 @@ dwfl_offline_section_address (Dwfl_Module *mod,
const GElf_Shdr *shdr __attribute__ ((unused)),
Dwarf_Addr *addr)
{
- GElf_Shdr shdr_mem;
- GElf_Shdr *main_shdr = gelf_getshdr (elf_getscn (mod->main.elf, shndx),
- &shdr_mem);
- if (unlikely (main_shdr == NULL))
- return -1;
-
+ assert (mod->e_type == ET_REL);
assert (shdr->sh_addr == 0);
assert (shdr->sh_flags & SHF_ALLOC);
- assert (main_shdr->sh_flags == shdr->sh_flags);
- if (main_shdr->sh_addr != 0)
- assert (mod->symfile != &mod->main);
+ if (mod->debug.elf == NULL)
+ /* We are only here because sh_addr is zero even though layout is complete.
+ The first section in the first file under -e is placed at 0. */
+ return 0;
+
+ /* The section numbers might not match between the two files.
+ The best we can rely on is the order of SHF_ALLOC sections. */
+
+ Elf_Scn *ourscn = elf_getscn (mod->debug.elf, shndx);
+ Elf_Scn *scn = NULL;
+ uint_fast32_t skip_alloc = 0;
+ while ((scn = elf_nextscn (mod->debug.elf, scn)) != ourscn)
+ {
+ assert (scn != NULL);
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *sh = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (sh == NULL))
+ return -1;
+ if (sh->sh_flags & SHF_ALLOC)
+ ++skip_alloc;
+ }
+
+ scn = NULL;
+ while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *main_shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (main_shdr == NULL))
+ return -1;
+ if ((main_shdr->sh_flags & SHF_ALLOC) && skip_alloc-- == 0)
+ {
+ assert (main_shdr->sh_flags == shdr->sh_flags);
+ *addr = main_shdr->sh_addr;
+ return 0;
+ }
+ }
- *addr = main_shdr->sh_addr;
- return 0;
+ /* This should never happen. */
+ return -1;
}
INTDEF (dwfl_offline_section_address)
-Dwfl_Module *
-dwfl_report_offline (Dwfl *dwfl, const char *name,
- const char *file_name, int fd)
+/* Forward declarations. */
+static Dwfl_Module *process_elf (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd, Elf *elf);
+static Dwfl_Module *process_archive (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd, Elf *elf,
+ int (*predicate) (const char *module,
+ const char *file));
+
+/* Report one module for an ELF file, or many for an archive.
+ Always consumes ELF and FD. */
+static Dwfl_Module *
+process_file (Dwfl *dwfl, const char *name, const char *file_name, int fd,
+ Elf *elf, int (*predicate) (const char *module,
+ const char *file))
{
- if (dwfl == NULL)
- return NULL;
+ switch (elf_kind (elf))
+ {
+ default:
+ case ELF_K_NONE:
+ __libdwfl_seterrno (elf == NULL ? DWFL_E_LIBELF : DWFL_E_BADELF);
+ return NULL;
+
+ case ELF_K_ELF:
+ return process_elf (dwfl, name, file_name, fd, elf);
- Dwfl_Module *mod = INTUSE(dwfl_report_elf) (dwfl, name, file_name, fd,
- dwfl->offline_next_address);
+ case ELF_K_AR:
+ return process_archive (dwfl, name, file_name, fd, elf, predicate);
+ }
+}
+
+/* Report the open ELF file as a module. Always consumes ELF and FD. */
+static Dwfl_Module *
+process_elf (Dwfl *dwfl, const char *name, const char *file_name, int fd,
+ Elf *elf)
+{
+ Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name, fd, elf,
+ dwfl->offline_next_address);
if (mod != NULL)
{
/* If this is an ET_EXEC file with fixed addresses, the address range
@@ -115,4 +172,145 @@ dwfl_report_offline (Dwfl *dwfl, const char *name,
return mod;
}
+
+/* Always consumes MEMBER. Returns elf_next result on success.
+ For errors returns ELF_C_NULL with *MOD set to null. */
+static Elf_Cmd
+process_archive_member (Dwfl *dwfl, const char *name, const char *file_name,
+ int (*predicate) (const char *module, const char *file),
+ int fd, Elf *member, Dwfl_Module **mod)
+{
+ const Elf_Arhdr *h = elf_getarhdr (member);
+ if (unlikely (h == NULL))
+ {
+ __libdwfl_seterrno (DWFL_E_LIBELF);
+ fail:
+ elf_end (member);
+ *mod = NULL;
+ return ELF_C_NULL;
+ }
+
+ if (!strcmp (h->ar_name, "/") || !strcmp (h->ar_name, "//"))
+ {
+ skip:;
+ /* Skip this and go to the next. */
+ Elf_Cmd result = elf_next (member);
+ elf_end (member);
+ return result;
+ }
+
+ char *member_name;
+ if (unlikely (asprintf (&member_name, "%s(%s)", file_name, h->ar_name) < 0))
+ {
+ nomem:
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ elf_end (member);
+ *mod = NULL;
+ return ELF_C_NULL;
+ }
+
+ char *module_name = NULL;
+ if (name == NULL || name[0] == '\0')
+ name = h->ar_name;
+ else if (unlikely (asprintf (&module_name, "%s:%s", name, h->ar_name) < 0))
+ {
+ free (member_name);
+ goto nomem;
+ }
+ else
+ name = module_name;
+
+ if (predicate != NULL)
+ {
+ /* Let the predicate decide whether to use this one. */
+ int want = (*predicate) (name, member_name);
+ if (want <= 0)
+ {
+ free (member_name);
+ free (module_name);
+ if (unlikely (want < 0))
+ {
+ __libdwfl_seterrno (DWFL_E_CB);
+ goto fail;
+ }
+ goto skip;
+ }
+ }
+
+ /* We let __libdwfl_report_elf cache the fd in mod->main.fd,
+ though it's the same fd for all the members.
+ On module teardown we will close it only on the last Elf reference. */
+ *mod = process_file (dwfl, name, member_name, fd, member, predicate);
+ free (member_name);
+ free (module_name);
+
+ if (*mod == NULL) /* process_file called elf_end. */
+ return ELF_C_NULL;
+
+ /* Advance the archive-reading offset for the next iteration. */
+ return elf_next (member);
+}
+
+/* Report each member of the archive as its own module. */
+static Dwfl_Module *
+process_archive (Dwfl *dwfl, const char *name, const char *file_name, int fd,
+ Elf *archive,
+ int (*predicate) (const char *module, const char *file))
+
+{
+ Dwfl_Module *mod = NULL;
+ while (process_archive_member (dwfl, name, file_name, predicate,
+ fd, elf_begin (fd, ELF_C_READ_MMAP_PRIVATE,
+ archive), &mod) != ELF_C_NULL)
+ ;
+
+ /* We can drop the archive Elf handle even if we're still using members
+ in live modules. When the last module's elf_end on a member returns
+ zero, that module will close FD. If no modules survived the predicate,
+ we are all done with the file right here. */
+ if (elf_end (archive) == 0)
+ close (fd);
+
+ return mod;
+}
+
+Dwfl_Module *
+internal_function
+__libdwfl_report_offline (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd, bool closefd,
+ int (*predicate) (const char *module,
+ const char *file))
+{
+ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+ Dwfl_Module *mod = process_file (dwfl, name, file_name, fd, elf, predicate);
+ if (mod == NULL)
+ {
+ elf_end (elf);
+ if (closefd)
+ close (fd);
+ }
+ return mod;
+}
+
+Dwfl_Module *
+dwfl_report_offline (Dwfl *dwfl, const char *name,
+ const char *file_name, int fd)
+{
+ if (dwfl == NULL)
+ return NULL;
+
+ bool closefd = false;
+ if (fd < 0)
+ {
+ closefd = true;
+ fd = open64 (file_name, O_RDONLY);
+ if (fd < 0)
+ {
+ __libdwfl_seterrno (DWFL_E_ERRNO);
+ return NULL;
+ }
+ }
+
+ return __libdwfl_report_offline (dwfl, name, file_name, fd, closefd, NULL);
+}
INTDEF (dwfl_report_offline)
diff --git a/elfutils/libdwfl/relocate.c b/elfutils/libdwfl/relocate.c
index f37f8350..6265f1bf 100644
--- a/elfutils/libdwfl/relocate.c
+++ b/elfutils/libdwfl/relocate.c
@@ -56,21 +56,25 @@ typedef uint8_t GElf_Byte;
Dwfl_Error
internal_function
-__libdwfl_relocate_value (Dwfl_Module *mod, size_t symshstrndx,
+__libdwfl_relocate_value (Dwfl_Module *mod, Elf *elf, size_t *shstrndx,
Elf32_Word shndx, GElf_Addr *value)
{
- Elf_Scn *refscn = elf_getscn (mod->symfile->elf, shndx);
+ Elf_Scn *refscn = elf_getscn (elf, shndx);
GElf_Shdr refshdr_mem, *refshdr = gelf_getshdr (refscn, &refshdr_mem);
if (refshdr == NULL)
return DWFL_E_LIBELF;
- if ((refshdr->sh_flags & SHF_ALLOC) && refshdr->sh_addr == 0)
+ if (refshdr->sh_addr == 0 && (refshdr->sh_flags & SHF_ALLOC))
{
/* This is a loaded section. Find its actual
address and update the section header. */
- const char *name = elf_strptr (mod->symfile->elf, symshstrndx,
- refshdr->sh_name);
- if (name == NULL)
+
+ if (*shstrndx == SHN_UNDEF
+ && unlikely (elf_getshstrndx (elf, shstrndx) < 0))
+ return DWFL_E_LIBELF;
+
+ const char *name = elf_strptr (elf, *shstrndx, refshdr->sh_name);
+ if (unlikely (name == NULL))
return DWFL_E_LIBELF;
if ((*mod->dwfl->callbacks->section_address) (MODCB_ARGS (mod),
@@ -79,18 +83,15 @@ __libdwfl_relocate_value (Dwfl_Module *mod, size_t symshstrndx,
return CBFAIL;
if (refshdr->sh_addr == (Dwarf_Addr) -1l)
- {
- /* The callback indicated this section wasn't really loaded but we
- don't really care. Mark it so we don't check it again for the
- next relocation. */
- refshdr->sh_flags &= ~SHF_ALLOC;
- refshdr->sh_addr = 0; /* Make no adjustment below. */
- }
+ /* The callback indicated this section wasn't really loaded but we
+ don't really care. */
+ refshdr->sh_addr = 0; /* Make no adjustment below. */
/* Update the in-core file's section header to show the final
load address (or unloadedness). This serves as a cache,
so we won't get here again for the same section. */
- if (! gelf_update_shdr (refscn, refshdr))
+ if (likely (refshdr->sh_addr != 0)
+ && unlikely (! gelf_update_shdr (refscn, refshdr)))
return DWFL_E_LIBELF;
}
@@ -99,216 +100,513 @@ __libdwfl_relocate_value (Dwfl_Module *mod, size_t symshstrndx,
return DWFL_E_NOERROR;
}
-Dwfl_Error
-internal_function
-__libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile)
+
+/* Cache used by relocate_getsym. */
+struct reloc_symtab_cache
{
- assert (mod->e_type == ET_REL);
+ Elf *symelf;
+ Elf_Data *symdata;
+ Elf_Data *symxndxdata;
+ Elf_Data *symstrdata;
+ size_t symshstrndx;
+ size_t strtabndx;
+};
+#define RELOC_SYMTAB_CACHE(cache) \
+ struct reloc_symtab_cache cache = \
+ { NULL, NULL, NULL, NULL, SHN_UNDEF, SHN_UNDEF }
+
+/* This is just doing dwfl_module_getsym, except that we must always use
+ the symbol table in RELOCATED itself when it has one, not MOD->symfile. */
+static Dwfl_Error
+relocate_getsym (Dwfl_Module *mod,
+ Elf *relocated, struct reloc_symtab_cache *cache,
+ int symndx, GElf_Sym *sym, GElf_Word *shndx)
+{
+ if (cache->symdata == NULL)
+ {
+ if (mod->symfile == NULL || mod->symfile->elf != relocated)
+ {
+ /* We have to look up the symbol table in the file we are
+ relocating, if it has its own. These reloc sections refer to
+ the symbol table in this file, and a symbol table in the main
+ file might not match. However, some tools did produce ET_REL
+ .debug files with relocs but no symtab of their own. */
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (relocated, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem, *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr != NULL)
+ switch (shdr->sh_type)
+ {
+ default:
+ continue;
+ case SHT_SYMTAB:
+ cache->symelf = relocated;
+ cache->symdata = elf_getdata (scn, NULL);
+ cache->strtabndx = shdr->sh_link;
+ if (unlikely (cache->symdata == NULL))
+ return DWFL_E_LIBELF;
+ break;
+ case SHT_SYMTAB_SHNDX:
+ cache->symxndxdata = elf_getdata (scn, NULL);
+ if (unlikely (cache->symxndxdata == NULL))
+ return DWFL_E_LIBELF;
+ break;
+ }
+ if (cache->symdata != NULL && cache->symxndxdata != NULL)
+ break;
+ }
+ }
+ if (cache->symdata == NULL)
+ {
+ /* We might not have looked for a symbol table file yet,
+ when coming from __libdwfl_relocate_section. */
+ if (unlikely (mod->symfile == NULL)
+ && unlikely (INTUSE(dwfl_module_getsymtab) (mod) < 0))
+ return dwfl_errno ();
+
+ /* The symbol table we have already cached is the one from
+ the file being relocated, so it's what we need. Or else
+ this is an ET_REL .debug file with no .symtab of its own;
+ the symbols refer to the section indices in the main file. */
+ cache->symelf = mod->symfile->elf;
+ cache->symdata = mod->symdata;
+ cache->symxndxdata = mod->symxndxdata;
+ cache->symstrdata = mod->symstrdata;
+ }
+ }
- GElf_Ehdr ehdr_mem;
- const GElf_Ehdr *ehdr = gelf_getehdr (debugfile, &ehdr_mem);
- if (ehdr == NULL)
+ if (unlikely (gelf_getsymshndx (cache->symdata, cache->symxndxdata,
+ symndx, sym, shndx) == NULL))
return DWFL_E_LIBELF;
- size_t symshstrndx, d_shstrndx;
- if (elf_getshstrndx (mod->symfile->elf, &symshstrndx) < 0)
- return DWFL_E_LIBELF;
- if (mod->symfile->elf == debugfile)
- d_shstrndx = symshstrndx;
- else if (elf_getshstrndx (debugfile, &d_shstrndx) < 0)
- return DWFL_E_LIBELF;
+ if (sym->st_shndx != SHN_XINDEX)
+ *shndx = sym->st_shndx;
- /* Look at each section in the debuginfo file, and process the
- relocation sections for debugging sections. */
- Dwfl_Error result = DWFL_E_NO_DWARF;
- Elf_Scn *scn = NULL;
- while ((scn = elf_nextscn (debugfile, scn)) != NULL)
+ switch (*shndx)
{
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ case SHN_ABS:
+ case SHN_UNDEF:
+ case SHN_COMMON:
+ return DWFL_E_NOERROR;
+ }
- if (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA)
- {
- /* It's a relocation section. First, fetch the name of the
- section these relocations apply to. */
+ return __libdwfl_relocate_value (mod, cache->symelf, &cache->symshstrndx,
+ *shndx, &sym->st_value);
+}
- Elf_Scn *tscn = elf_getscn (debugfile, shdr->sh_info);
- if (tscn == NULL)
+/* Handle an undefined symbol. We really only support ET_REL for Linux
+ kernel modules, and offline archives. The behavior of the Linux module
+ loader is very simple and easy to mimic. It only matches magically
+ exported symbols, and we match any defined symbols. But we get the same
+ answer except when the module's symbols are undefined and would prevent
+ it from being loaded. */
+static Dwfl_Error
+resolve_symbol (Dwfl_Module *referer, struct reloc_symtab_cache *symtab,
+ GElf_Sym *sym, GElf_Word shndx)
+{
+ /* First we need its name. */
+ if (sym->st_name != 0)
+ {
+ if (symtab->symstrdata == NULL)
+ {
+ /* Cache the strtab for this symtab. */
+ assert (referer->symfile == NULL
+ || referer->symfile->elf != symtab->symelf);
+ symtab->symstrdata = elf_getdata (elf_getscn (symtab->symelf,
+ symtab->strtabndx),
+ NULL);
+ if (unlikely (symtab->symstrdata == NULL))
return DWFL_E_LIBELF;
+ }
+ if (unlikely (sym->st_name >= symtab->symstrdata->d_size))
+ return DWFL_E_BADSTROFF;
+
+ const char *name = symtab->symstrdata->d_buf;
+ name += sym->st_name;
+
+ for (Dwfl_Module *m = referer->dwfl->modulelist; m != NULL; m = m->next)
+ if (m != referer)
+ {
+ /* Get this module's symtab.
+ If we got a fresh error reading the table, report it.
+ If we just have no symbols in this module, no harm done. */
+ if (m->symdata == NULL
+ && m->symerr == DWFL_E_NOERROR
+ && INTUSE(dwfl_module_getsymtab) (m) < 0
+ && m->symerr != DWFL_E_NO_SYMTAB)
+ return m->symerr;
+
+ for (size_t ndx = 1; ndx < m->syments; ++ndx)
+ {
+ sym = gelf_getsymshndx (m->symdata, m->symxndxdata,
+ ndx, sym, &shndx);
+ if (unlikely (sym == NULL))
+ return DWFL_E_LIBELF;
+ if (sym->st_shndx != SHN_XINDEX)
+ shndx = sym->st_shndx;
+
+ /* We are looking for a defined global symbol with a name. */
+ if (shndx == SHN_UNDEF || shndx == SHN_COMMON
+ || GELF_ST_BIND (sym->st_info) == STB_LOCAL
+ || sym->st_name == 0)
+ continue;
+
+ /* Get this candidate symbol's name. */
+ if (unlikely (sym->st_name >= m->symstrdata->d_size))
+ return DWFL_E_BADSTROFF;
+ const char *n = m->symstrdata->d_buf;
+ n += sym->st_name;
+
+ /* Does the name match? */
+ if (strcmp (name, n))
+ continue;
+
+ /* We found it! */
+ if (shndx == SHN_ABS)
+ return DWFL_E_NOERROR;
+
+ /* In an ET_REL file, the symbol table values are relative
+ to the section, not to the module's load base. */
+ size_t symshstrndx = SHN_UNDEF;
+ return __libdwfl_relocate_value (m, m->symfile->elf,
+ &symshstrndx,
+ shndx, &sym->st_value);
+ }
+ }
+ }
- GElf_Shdr tshdr_mem;
- GElf_Shdr *tshdr = gelf_getshdr (tscn, &tshdr_mem);
- const char *tname = elf_strptr (debugfile, d_shstrndx,
- tshdr->sh_name);
- if (tname == NULL)
- return DWFL_E_LIBELF;
+ return DWFL_E_RELUNDEF;
+}
- if (! ebl_debugscn_p (mod->ebl, tname))
- /* This relocation section is not for a debugging section.
- Nothing to do here. */
- continue;
+static Dwfl_Error
+relocate_section (Dwfl_Module *mod, Elf *relocated, const GElf_Ehdr *ehdr,
+ size_t shstrndx, struct reloc_symtab_cache *reloc_symtab,
+ Elf_Scn *scn, GElf_Shdr *shdr,
+ Elf_Scn *tscn, bool debugscn, bool partial)
+{
+ /* First, fetch the name of the section these relocations apply to. */
+ GElf_Shdr tshdr_mem;
+ GElf_Shdr *tshdr = gelf_getshdr (tscn, &tshdr_mem);
+ const char *tname = elf_strptr (relocated, shstrndx, tshdr->sh_name);
+ if (tname == NULL)
+ return DWFL_E_LIBELF;
- /* Fetch the section data that needs the relocations applied. */
- Elf_Data *tdata = elf_rawdata (tscn, NULL);
- if (tdata == NULL)
- return DWFL_E_LIBELF;
+ if (debugscn && ! ebl_debugscn_p (mod->ebl, tname))
+ /* This relocation section is not for a debugging section.
+ Nothing to do here. */
+ return DWFL_E_NOERROR;
- /* Apply one relocation. Returns true for any invalid data. */
- Dwfl_Error relocate (GElf_Addr offset, const GElf_Sxword *addend,
- int rtype, int symndx)
- {
- /* First, resolve the symbol to an absolute value. */
- GElf_Addr value;
-
- if (symndx == STN_UNDEF)
- /* When strip removes a section symbol referring to a
- section moved into the debuginfo file, it replaces
- that symbol index in relocs with STN_UNDEF. We
- don't actually need the symbol, because those relocs
- are always references relative to the nonallocated
- debugging sections, which start at zero. */
- value = 0;
- else
- {
- GElf_Sym sym;
- GElf_Word shndx;
-
- if (INTUSE(dwfl_module_getsym) (mod, symndx,
- &sym, &shndx) == NULL)
- return dwfl_errno ();
-
- if (shndx == SHN_UNDEF || shndx == SHN_COMMON)
- return DWFL_E_RELUNDEF;
-
- value = sym.st_value;
- }
-
- /* These are the types we can relocate. */
-#define TYPES DO_TYPE (BYTE, Byte); DO_TYPE (HALF, Half); \
- DO_TYPE (WORD, Word); DO_TYPE (SWORD, Sword); \
- DO_TYPE (XWORD, Xword); DO_TYPE (SXWORD, Sxword)
- size_t size;
- Elf_Type type = ebl_reloc_simple_type (mod->ebl, rtype);
- switch (type)
- {
-#define DO_TYPE(NAME, Name) \
- case ELF_T_##NAME: \
- size = sizeof (GElf_##Name); \
- break
- TYPES;
+ /* Fetch the section data that needs the relocations applied. */
+ Elf_Data *tdata = elf_rawdata (tscn, NULL);
+ if (tdata == NULL)
+ return DWFL_E_LIBELF;
+
+ /* Apply one relocation. Returns true for any invalid data. */
+ Dwfl_Error relocate (GElf_Addr offset, const GElf_Sxword *addend,
+ int rtype, int symndx)
+ {
+ /* First, resolve the symbol to an absolute value. */
+ GElf_Addr value;
+
+ if (symndx == STN_UNDEF)
+ /* When strip removes a section symbol referring to a
+ section moved into the debuginfo file, it replaces
+ that symbol index in relocs with STN_UNDEF. We
+ don't actually need the symbol, because those relocs
+ are always references relative to the nonallocated
+ debugging sections, which start at zero. */
+ value = 0;
+ else
+ {
+ GElf_Sym sym;
+ GElf_Word shndx;
+ Dwfl_Error error = relocate_getsym (mod, relocated, reloc_symtab,
+ symndx, &sym, &shndx);
+ if (unlikely (error != DWFL_E_NOERROR))
+ return error;
+
+ if (shndx == SHN_UNDEF || shndx == SHN_COMMON)
+ {
+ /* Maybe we can figure it out anyway. */
+ error = resolve_symbol (mod, reloc_symtab, &sym, shndx);
+ if (error != DWFL_E_NOERROR)
+ return error;
+ }
+
+ value = sym.st_value;
+ }
+
+ /* These are the types we can relocate. */
+#define TYPES DO_TYPE (BYTE, Byte); DO_TYPE (HALF, Half); \
+ DO_TYPE (WORD, Word); DO_TYPE (SWORD, Sword); \
+ DO_TYPE (XWORD, Xword); DO_TYPE (SXWORD, Sxword)
+ size_t size;
+ Elf_Type type = ebl_reloc_simple_type (mod->ebl, rtype);
+ switch (type)
+ {
+#define DO_TYPE(NAME, Name) \
+ case ELF_T_##NAME: \
+ size = sizeof (GElf_##Name); \
+ break
+ TYPES;
#undef DO_TYPE
- default:
- /* This might be because ebl_openbackend failed to find
- any libebl_CPU.so library. Diagnose that clearly. */
- if (ebl_get_elfmachine (mod->ebl) == EM_NONE)
- return DWFL_E_UNKNOWN_MACHINE;
- return DWFL_E_BADRELTYPE;
- }
+ default:
+ /* This might be because ebl_openbackend failed to find
+ any libebl_CPU.so library. Diagnose that clearly. */
+ if (ebl_get_elfmachine (mod->ebl) == EM_NONE)
+ return DWFL_E_UNKNOWN_MACHINE;
+ return DWFL_E_BADRELTYPE;
+ }
- if (offset + size >= tdata->d_size)
- return DWFL_E_BADRELOFF;
+ if (offset + size > tdata->d_size)
+ return DWFL_E_BADRELOFF;
#define DO_TYPE(NAME, Name) GElf_##Name Name;
- union { TYPES; } tmpbuf;
+ union { TYPES; } tmpbuf;
#undef DO_TYPE
- Elf_Data tmpdata =
- {
- .d_type = type,
- .d_buf = &tmpbuf,
- .d_size = size,
- .d_version = EV_CURRENT,
- };
- Elf_Data rdata =
- {
- .d_type = type,
- .d_buf = tdata->d_buf + offset,
- .d_size = size,
- .d_version = EV_CURRENT,
- };
-
- /* XXX check for overflow? */
- if (addend)
- {
- /* For the addend form, we have the value already. */
- value += *addend;
- switch (type)
- {
+ Elf_Data tmpdata =
+ {
+ .d_type = type,
+ .d_buf = &tmpbuf,
+ .d_size = size,
+ .d_version = EV_CURRENT,
+ };
+ Elf_Data rdata =
+ {
+ .d_type = type,
+ .d_buf = tdata->d_buf + offset,
+ .d_size = size,
+ .d_version = EV_CURRENT,
+ };
+
+ /* XXX check for overflow? */
+ if (addend)
+ {
+ /* For the addend form, we have the value already. */
+ value += *addend;
+ switch (type)
+ {
#define DO_TYPE(NAME, Name) \
- case ELF_T_##NAME: \
- tmpbuf.Name = value; \
- break
- TYPES;
+ case ELF_T_##NAME: \
+ tmpbuf.Name = value; \
+ break
+ TYPES;
#undef DO_TYPE
- default:
- abort ();
- }
- }
- else
- {
- /* Extract the original value and apply the reloc. */
- Elf_Data *d = gelf_xlatetom (debugfile, &tmpdata, &rdata,
- ehdr->e_ident[EI_DATA]);
- if (d == NULL)
- return DWFL_E_LIBELF;
- assert (d == &tmpdata);
- switch (type)
- {
-#define DO_TYPE(NAME, Name) \
- case ELF_T_##NAME: \
- tmpbuf.Name += (GElf_##Name) value; \
- break
- TYPES;
+ default:
+ abort ();
+ }
+ }
+ else
+ {
+ /* Extract the original value and apply the reloc. */
+ Elf_Data *d = gelf_xlatetom (relocated, &tmpdata, &rdata,
+ ehdr->e_ident[EI_DATA]);
+ if (d == NULL)
+ return DWFL_E_LIBELF;
+ assert (d == &tmpdata);
+ switch (type)
+ {
+#define DO_TYPE(NAME, Name) \
+ case ELF_T_##NAME: \
+ tmpbuf.Name += (GElf_##Name) value; \
+ break
+ TYPES;
#undef DO_TYPE
- default:
- abort ();
- }
- }
-
- /* Now convert the relocated datum back to the target
- format. This will write into rdata.d_buf, which
- points into the raw section data being relocated. */
- Elf_Data *s = gelf_xlatetof (debugfile, &rdata, &tmpdata,
- ehdr->e_ident[EI_DATA]);
- if (s == NULL)
- return DWFL_E_LIBELF;
- assert (s == &rdata);
-
- /* We have applied this relocation! */
- return DWFL_E_NOERROR;
+ default:
+ abort ();
+ }
+ }
+
+ /* Now convert the relocated datum back to the target
+ format. This will write into rdata.d_buf, which
+ points into the raw section data being relocated. */
+ Elf_Data *s = gelf_xlatetof (relocated, &rdata, &tmpdata,
+ ehdr->e_ident[EI_DATA]);
+ if (s == NULL)
+ return DWFL_E_LIBELF;
+ assert (s == &rdata);
+
+ /* We have applied this relocation! */
+ return DWFL_E_NOERROR;
+ }
+
+ /* Fetch the relocation section and apply each reloc in it. */
+ Elf_Data *reldata = elf_getdata (scn, NULL);
+ if (reldata == NULL)
+ return DWFL_E_LIBELF;
+
+ Dwfl_Error result = DWFL_E_NOERROR;
+ size_t nrels = shdr->sh_size / shdr->sh_entsize;
+ size_t complete = 0;
+ if (shdr->sh_type == SHT_REL)
+ for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
+ {
+ GElf_Rel rel_mem, *r = gelf_getrel (reldata, relidx, &rel_mem);
+ if (r == NULL)
+ return DWFL_E_LIBELF;
+ result = relocate (r->r_offset, NULL,
+ GELF_R_TYPE (r->r_info),
+ GELF_R_SYM (r->r_info));
+ if (partial)
+ switch (result)
+ {
+ case DWFL_E_NOERROR:
+ /* We applied the relocation. Elide it. */
+ memset (&rel_mem, 0, sizeof rel_mem);
+ gelf_update_rel (reldata, relidx, &rel_mem);
+ ++complete;
+ break;
+ case DWFL_E_BADRELTYPE:
+ case DWFL_E_RELUNDEF:
+ /* We couldn't handle this relocation. Skip it. */
+ result = DWFL_E_NOERROR;
+ break;
+ default:
+ break;
}
+ }
+ else
+ for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
+ {
+ GElf_Rela rela_mem, *r = gelf_getrela (reldata, relidx,
+ &rela_mem);
+ if (r == NULL)
+ return DWFL_E_LIBELF;
+ result = relocate (r->r_offset, &r->r_addend,
+ GELF_R_TYPE (r->r_info),
+ GELF_R_SYM (r->r_info));
+ if (partial)
+ switch (result)
+ {
+ case DWFL_E_NOERROR:
+ /* We applied the relocation. Elide it. */
+ memset (&rela_mem, 0, sizeof rela_mem);
+ gelf_update_rela (reldata, relidx, &rela_mem);
+ ++complete;
+ break;
+ case DWFL_E_BADRELTYPE:
+ case DWFL_E_RELUNDEF:
+ /* We couldn't handle this relocation. Skip it. */
+ result = DWFL_E_NOERROR;
+ break;
+ default:
+ break;
+ }
+ }
- /* Fetch the relocation section and apply each reloc in it. */
- Elf_Data *reldata = elf_getdata (scn, NULL);
- if (reldata == NULL)
- return DWFL_E_LIBELF;
+ if (likely (result == DWFL_E_NOERROR))
+ {
+ if (!partial || complete == nrels)
+ /* Mark this relocation section as being empty now that we have
+ done its work. This affects unstrip -R, so e.g. it emits an
+ empty .rela.debug_info along with a .debug_info that has
+ already been fully relocated. */
+ nrels = 0;
+ else if (complete != 0)
+ {
+ /* We handled some of the relocations but not all.
+ We've zeroed out the ones we processed.
+ Now remove them from the section. */
- result = DWFL_E_NOERROR;
- size_t nrels = shdr->sh_size / shdr->sh_entsize;
+ size_t next = 0;
if (shdr->sh_type == SHT_REL)
- for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
+ for (size_t relidx = 0; relidx < nrels; ++relidx)
{
- GElf_Rel rel_mem, *r = gelf_getrel (reldata, relidx, &rel_mem);
- if (r == NULL)
- return DWFL_E_LIBELF;
- result = relocate (r->r_offset, NULL,
- GELF_R_TYPE (r->r_info),
- GELF_R_SYM (r->r_info));
+ GElf_Rel rel_mem;
+ GElf_Rel *r = gelf_getrel (reldata, relidx, &rel_mem);
+ if (r->r_info != 0 || r->r_offset != 0)
+ {
+ if (next != relidx)
+ gelf_update_rel (reldata, next, r);
+ ++next;
+ }
}
else
- for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
+ for (size_t relidx = 0; relidx < nrels; ++relidx)
{
- GElf_Rela rela_mem, *r = gelf_getrela (reldata, relidx,
- &rela_mem);
- if (r == NULL)
- return DWFL_E_LIBELF;
- result = relocate (r->r_offset, &r->r_addend,
- GELF_R_TYPE (r->r_info),
- GELF_R_SYM (r->r_info));
+ GElf_Rela rela_mem;
+ GElf_Rela *r = gelf_getrela (reldata, relidx, &rela_mem);
+ if (r->r_info != 0 || r->r_offset != 0 || r->r_addend != 0)
+ {
+ if (next != relidx)
+ gelf_update_rela (reldata, next, r);
+ ++next;
+ }
}
- if (result != DWFL_E_NOERROR)
- break;
+ nrels = next;
}
+
+ shdr->sh_size = reldata->d_size = nrels * shdr->sh_entsize;
+ gelf_update_shdr (scn, shdr);
}
return result;
}
+
+Dwfl_Error
+internal_function
+__libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile, bool debug)
+{
+ assert (mod->e_type == ET_REL);
+
+ GElf_Ehdr ehdr_mem;
+ const GElf_Ehdr *ehdr = gelf_getehdr (debugfile, &ehdr_mem);
+ if (ehdr == NULL)
+ return DWFL_E_LIBELF;
+
+ size_t d_shstrndx;
+ if (elf_getshstrndx (debugfile, &d_shstrndx) < 0)
+ return DWFL_E_LIBELF;
+
+ RELOC_SYMTAB_CACHE (reloc_symtab);
+
+ /* Look at each section in the debuginfo file, and process the
+ relocation sections for debugging sections. */
+ Dwfl_Error result = DWFL_E_NOERROR;
+ Elf_Scn *scn = NULL;
+ while (result == DWFL_E_NOERROR
+ && (scn = elf_nextscn (debugfile, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+
+ if ((shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA)
+ && shdr->sh_size != 0)
+ {
+ /* It's a relocation section. */
+
+ Elf_Scn *tscn = elf_getscn (debugfile, shdr->sh_info);
+ if (unlikely (tscn == NULL))
+ result = DWFL_E_LIBELF;
+ else
+ result = relocate_section (mod, debugfile, ehdr, d_shstrndx,
+ &reloc_symtab, scn, shdr, tscn,
+ debug, !debug);
+ }
+ }
+
+ return result;
+}
+
+Dwfl_Error
+internal_function
+__libdwfl_relocate_section (Dwfl_Module *mod, Elf *relocated,
+ Elf_Scn *relocscn, Elf_Scn *tscn, bool partial)
+{
+ GElf_Ehdr ehdr_mem;
+ GElf_Shdr shdr_mem;
+
+ RELOC_SYMTAB_CACHE (reloc_symtab);
+
+ size_t shstrndx;
+ if (elf_getshstrndx (relocated, &shstrndx) < 0)
+ return DWFL_E_LIBELF;
+
+ return (__libdwfl_module_getebl (mod)
+ ?: relocate_section (mod, relocated,
+ gelf_getehdr (relocated, &ehdr_mem), shstrndx,
+ &reloc_symtab,
+ relocscn, gelf_getshdr (relocscn, &shdr_mem),
+ tscn, false, partial));
+}
diff --git a/elfutils/libebl/ChangeLog b/elfutils/libebl/ChangeLog
index 07f640ed..86c91781 100644
--- a/elfutils/libebl/ChangeLog
+++ b/elfutils/libebl/ChangeLog
@@ -1,3 +1,48 @@
+2007-10-18 Roland McGrath <roland@redhat.com>
+
+ * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PPC_VMX.
+
+2007-10-11 Roland McGrath <roland@redhat.com>
+
+ * eblobjnote.c (ebl_object_note): Translate target format (byte-swap)
+ for NT_GNU_ABI_TAG contents.
+
+2007-08-22 Roland McGrath <roland@redhat.com>
+
+ * libebl.h (Ebl_Core_Item): New member `group'.
+
+2007-08-19 Roland McGrath <roland@redhat.com>
+
+ * ebl-hooks.h: Add new hook auxv_info.
+ * eblopenbackend.c (default_auxv_info): New function.
+ (fill_defaults): Initialize auxv_info hook.
+ * eblauxvinfo.c : New file.
+ * Makefile.am (gen_SOURCES): Add it.
+ * libebl.h: Declare ebl_auxv_info.
+
+ * eblcorenote.c: Rewritten with new signature.
+ * Makefile.am (gen_SOURCES): Add it.
+ * libebl.h (Ebl_Register_Location, Ebl_Core_Item): New types.
+ (ebl_core_note_info): Completely revamp signature.
+ * ebl-hooks.h: Update decl.
+ * eblopenbackend.c (default_core_note): Update signature.
+
+2007-07-09 Roland McGrath <roland@redhat.com>
+
+ * eblobjnotetypename.c (ebl_object_note_type_name): Handle
+ NT_GNU_HWCAP, NT_GNU_BUILD_ID.
+
+ * eblobjnote.c (ebl_object_note): Handle NT_GNU_BUILD_ID.
+
+2007-04-22 Roland McGrath <roland@redhat.com>
+
+ * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PRXFPREG.
+
+2007-03-10 Roland McGrath <roland@redhat.com>
+
+ * eblcorenote.c (ebl_core_note): For normally-zero types,
+ print in hex if not zero.
+
2007-01-11 Roland McGrath <roland@redhat.com>
* ebl-hooks.h (machine_section_flag_check): New hook.
diff --git a/elfutils/libebl/Makefile.am b/elfutils/libebl/Makefile.am
index 741e5eee..993800ca 100644
--- a/elfutils/libebl/Makefile.am
+++ b/elfutils/libebl/Makefile.am
@@ -58,7 +58,7 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
eblelfclass.c eblelfdata.c eblelfmachine.c \
ebl_check_special_symbol.c eblbsspltp.c eblretval.c \
eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \
- eblsysvhashentrysize.c
+ eblsysvhashentrysize.c eblauxvinfo.c
libebl_a_SOURCES = $(gen_SOURCES)
diff --git a/elfutils/libebl/Makefile.in b/elfutils/libebl/Makefile.in
index d368daec..bb644593 100644
--- a/elfutils/libebl/Makefile.in
+++ b/elfutils/libebl/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -15,15 +15,11 @@
@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
@@ -41,11 +37,11 @@ subdir = libebl
DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -81,10 +77,10 @@ am__objects_1 = eblopenbackend.$(OBJEXT) eblclosebackend.$(OBJEXT) \
eblelfmachine.$(OBJEXT) ebl_check_special_symbol.$(OBJEXT) \
eblbsspltp.$(OBJEXT) eblretval.$(OBJEXT) eblreginfo.$(OBJEXT) \
eblnonerelocp.$(OBJEXT) eblrelativerelocp.$(OBJEXT) \
- eblsysvhashentrysize.$(OBJEXT)
+ eblsysvhashentrysize.$(OBJEXT) eblauxvinfo.$(OBJEXT)
am_libebl_a_OBJECTS = $(am__objects_1)
libebl_a_OBJECTS = $(am_libebl_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -99,15 +95,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -120,13 +112,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -141,19 +129,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -165,20 +146,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = 1
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -191,28 +170,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@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 \
@@ -237,7 +227,7 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
eblelfclass.c eblelfdata.c eblelfmachine.c \
ebl_check_special_symbol.c eblbsspltp.c eblretval.c \
eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \
- eblsysvhashentrysize.c
+ eblsysvhashentrysize.c eblauxvinfo.c
libebl_a_SOURCES = $(gen_SOURCES)
noinst_HEADERS = libeblP.h ebl-hooks.h
@@ -277,7 +267,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
@@ -316,6 +306,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebl_check_special_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblauxvinfo.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblbackendname.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblbsspltp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblclosebackend.Po@am__quote@
@@ -358,22 +349,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eblwstrtab.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+ test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -438,22 +428,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -469,7 +458,7 @@ check: check-am
all-am: Makefile $(LIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -518,12 +507,20 @@ info-am:
install-data-am: install-pkgincludeHEADERS
+install-dvi: install-dvi-am
+
install-exec-am: install-libLIBRARIES
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -543,20 +540,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-libLIBRARIES \
- uninstall-pkgincludeHEADERS
+uninstall-am: uninstall-libLIBRARIES uninstall-pkgincludeHEADERS
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-tags 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-libLIBRARIES install-man \
- install-pkgincludeHEADERS install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am uninstall-libLIBRARIES \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-libLIBRARIES install-man install-pdf \
+ install-pdf-am install-pkgincludeHEADERS install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags uninstall uninstall-am uninstall-libLIBRARIES \
uninstall-pkgincludeHEADERS
diff --git a/elfutils/libebl/ebl-hooks.h b/elfutils/libebl/ebl-hooks.h
index 5344df09..d466a1f3 100644
--- a/elfutils/libebl/ebl-hooks.h
+++ b/elfutils/libebl/ebl-hooks.h
@@ -107,12 +107,17 @@ const char *EBLHOOK(core_note_type_name) (uint32_t, char *, size_t);
/* Name of a note entry type for object files. */
const char *EBLHOOK(object_note_type_name) (uint32_t, char *, size_t);
-/* Handle core note. */
-bool EBLHOOK(core_note) (const char *, uint32_t, uint32_t, const char *);
+/* Describe core note format. */
+int EBLHOOK(core_note) (GElf_Word, GElf_Word, GElf_Word *, size_t *,
+ const Ebl_Register_Location **,
+ size_t *, const Ebl_Core_Item **);
/* Handle object file note. */
bool EBLHOOK(object_note) (const char *, uint32_t, uint32_t, const char *);
+/* Describe auxv element type. */
+int EBLHOOK(auxv_info) (GElf_Xword, const char **, const char **);
+
/* Check section name for being that of a debug informatino section. */
bool EBLHOOK(debugscn_p) (const char *);
diff --git a/elfutils/libebl/eblauxvinfo.c b/elfutils/libebl/eblauxvinfo.c
new file mode 100644
index 00000000..54583f9f
--- /dev/null
+++ b/elfutils/libebl/eblauxvinfo.c
@@ -0,0 +1,121 @@
+/* Describe known auxv types.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <byteswap.h>
+#include <endian.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <libeblP.h>
+
+#define AUXV_TYPES \
+ TYPE (NULL, "") \
+ TYPE (IGNORE, "") \
+ TYPE (EXECFD, "d") \
+ TYPE (PHDR, "p") \
+ TYPE (PHENT, "u") \
+ TYPE (PHNUM, "u") \
+ TYPE (PAGESZ, "u") \
+ TYPE (BASE, "p") \
+ TYPE (FLAGS, "x") \
+ TYPE (ENTRY, "p") \
+ TYPE (NOTELF, "") \
+ TYPE (UID, "u") \
+ TYPE (EUID, "u") \
+ TYPE (GID, "u") \
+ TYPE (EGID, "u") \
+ TYPE (CLKTCK, "u") \
+ TYPE (PLATFORM, "s") \
+ TYPE (HWCAP, "x") \
+ TYPE (FPUCW, "x") \
+ TYPE (DCACHEBSIZE, "d") \
+ TYPE (ICACHEBSIZE, "d") \
+ TYPE (UCACHEBSIZE, "d") \
+ TYPE (IGNOREPPC, "") \
+ TYPE (SECURE, "u") \
+ TYPE (SYSINFO, "p") \
+ TYPE (SYSINFO_EHDR, "p") \
+ TYPE (L1I_CACHESHAPE, "d") \
+ TYPE (L1D_CACHESHAPE, "d") \
+ TYPE (L2_CACHESHAPE, "d") \
+ TYPE (L3_CACHESHAPE, "d")
+
+static const struct
+{
+ const char *name, *format;
+} auxv_types[] =
+ {
+#define TYPE(name, fmt) [AT_##name] = { #name, fmt },
+ AUXV_TYPES
+#undef TYPE
+ };
+#define nauxv_types (sizeof auxv_types / sizeof auxv_types[0])
+
+int
+ebl_auxv_info (ebl, a_type, name, format)
+ Ebl *ebl;
+ GElf_Xword a_type;
+ const char **name;
+ const char **format;
+{
+ int result = ebl->auxv_info (a_type, name, format);
+ if (result == 0 && a_type < nauxv_types)
+ {
+ /* The machine specific function did not know this type. */
+ *name = auxv_types[a_type].name;
+ *format = auxv_types[a_type].format;
+ result = 1;
+ }
+ return result;
+}
diff --git a/elfutils/libebl/eblcorenote.c b/elfutils/libebl/eblcorenote.c
index d8223d7a..553d5ba9 100644
--- a/elfutils/libebl/eblcorenote.c
+++ b/elfutils/libebl/eblcorenote.c
@@ -1,7 +1,6 @@
-/* Print contents of core note.
- Copyright (C) 2002, 2004, 2005 Red Hat, Inc.
+/* Describe known core note formats.
+ Copyright (C) 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
- Written by Ulrich Drepper <drepper@redhat.com>, 2002.
Red Hat elfutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
@@ -61,167 +60,48 @@
#include <libeblP.h>
-void
-ebl_core_note (ebl, name, type, descsz, desc)
+int
+ebl_core_note (ebl, n_type, descsz,
+ regs_offset, nregloc, reglocs, nitems, items)
Ebl *ebl;
- const char *name;
- uint32_t type;
- uint32_t descsz;
- const char *desc;
+ GElf_Word n_type;
+ GElf_Word descsz;
+ GElf_Word *regs_offset;
+ size_t *nregloc;
+ const Ebl_Register_Location **reglocs;
+ size_t *nitems;
+ const Ebl_Core_Item **items;
{
- GElf_Ehdr ehdr_mem;
- GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
- assert (ehdr != NULL);
- int class = ehdr->e_ident[EI_CLASS];
- int endian = ehdr->e_ident[EI_DATA];
-
- if (! ebl->core_note (name, type, descsz, desc))
- /* The machine specific function did not know this type. */
- switch (type)
- {
- case NT_PLATFORM:
- printf (gettext (" Platform: %.*s\n"), (int) descsz, desc);
- break;
-
- case NT_AUXV:
- ;
- size_t elsize = (class == ELFCLASS32
- ? sizeof (Elf32_auxv_t) : sizeof (Elf64_auxv_t));
-
- for (size_t cnt = 0; (cnt + 1) * elsize <= descsz; ++cnt)
- {
- uintmax_t atype;
- uintmax_t val;
-
- if (class == ELFCLASS32)
- {
- Elf32_auxv_t *auxv = &((Elf32_auxv_t *) desc)[cnt];
-
- if ((endian == ELFDATA2LSB && __BYTE_ORDER == __LITTLE_ENDIAN)
- || (endian == ELFDATA2MSB && __BYTE_ORDER == __BIG_ENDIAN))
- {
- atype = auxv->a_type;
- val = auxv->a_un.a_val;
- }
- else
- {
- atype = bswap_32 (auxv->a_type);
- val = bswap_32 (auxv->a_un.a_val);
- }
- }
- else
- {
- Elf64_auxv_t *auxv = &((Elf64_auxv_t *) desc)[cnt];
-
- if ((endian == ELFDATA2LSB && __BYTE_ORDER == __LITTLE_ENDIAN)
- || (endian == ELFDATA2MSB && __BYTE_ORDER == __BIG_ENDIAN))
- {
- atype = auxv->a_type;
- val = auxv->a_un.a_val;
- }
- else
- {
- atype = bswap_64 (auxv->a_type);
- val = bswap_64 (auxv->a_un.a_val);
- }
- }
-
- /* XXX Do we need the auxiliary vector info anywhere
- else? If yes, move code into a separate function. */
- const char *at;
-
- switch (atype)
+ int result = ebl->core_note (n_type, descsz, regs_offset, nregloc, reglocs,
+ nitems, items);
+ if (result == 0)
+ {
+ /* The machine specific function did not know this type. */
+
+ *regs_offset = 0;
+ *nregloc = 0;
+ *reglocs = NULL;
+ switch (n_type)
+ {
+#define ITEMS(type, table) \
+ case type: \
+ *items = table; \
+ *nitems = sizeof table / sizeof table[0]; \
+ result = 1; \
+ break
+
+ static const Ebl_Core_Item platform[] =
+ {
{
-#define NEW_AT(name) case AT_##name: at = #name; break
- NEW_AT (NULL);
- NEW_AT (IGNORE);
- NEW_AT (EXECFD);
- NEW_AT (PHDR);
- NEW_AT (PHENT);
- NEW_AT (PHNUM);
- NEW_AT (PAGESZ);
- NEW_AT (BASE);
- NEW_AT (FLAGS);
- NEW_AT (ENTRY);
- NEW_AT (NOTELF);
- NEW_AT (UID);
- NEW_AT (EUID);
- NEW_AT (GID);
- NEW_AT (EGID);
- NEW_AT (CLKTCK);
- NEW_AT (PLATFORM);
- NEW_AT (HWCAP);
- NEW_AT (FPUCW);
- NEW_AT (DCACHEBSIZE);
- NEW_AT (ICACHEBSIZE);
- NEW_AT (UCACHEBSIZE);
- NEW_AT (IGNOREPPC);
- NEW_AT (SECURE);
- NEW_AT (SYSINFO);
- NEW_AT (SYSINFO_EHDR);
- NEW_AT (L1I_CACHESHAPE);
- NEW_AT (L1D_CACHESHAPE);
- NEW_AT (L2_CACHESHAPE);
- NEW_AT (L3_CACHESHAPE);
-
- default:;
- static char buf[30];
- sprintf (buf, "%ju (AT_?""?""?)", atype);
- at = buf;
- break;
- }
-
- switch (atype)
- {
- case AT_NULL:
- case AT_IGNORE:
- case AT_IGNOREPPC:
- case AT_NOTELF:
- default:
- printf (" %s\n", at);
- break;
-
- case AT_EXECFD:
- case AT_PHENT:
- case AT_PHNUM:
- case AT_PAGESZ:
- case AT_UID:
- case AT_EUID:
- case AT_GID:
- case AT_EGID:
- case AT_CLKTCK:
- case AT_FPUCW:
- case AT_DCACHEBSIZE:
- case AT_ICACHEBSIZE:
- case AT_UCACHEBSIZE:
- case AT_SECURE:
- case AT_L1I_CACHESHAPE:
- case AT_L1D_CACHESHAPE:
- case AT_L2_CACHESHAPE:
- case AT_L3_CACHESHAPE:
- printf (" %s: %jd\n", at, val);
- break;
-
- case AT_PHDR:
- case AT_BASE:
- case AT_FLAGS: /* XXX Print flags? */
- case AT_ENTRY:
- case AT_PLATFORM: /* XXX Get string? */
- case AT_HWCAP: /* XXX Print flags? */
- case AT_SYSINFO:
- case AT_SYSINFO_EHDR:
- printf (" %s: %#jx\n", at, val);
- break;
+ .name = "Platform",
+ .type = ELF_T_BYTE, .count = 0, .format = 's'
}
+ };
+ ITEMS (NT_PLATFORM, platform);
- if (atype == AT_NULL)
- /* Reached the end. */
- break;
- }
- break;
+#undef ITEMS
+ }
+ }
- default:
- /* Unknown type. */
- break;
- }
+ return result;
}
diff --git a/elfutils/libebl/eblcorenotetypename.c b/elfutils/libebl/eblcorenotetypename.c
index b439188b..44b02376 100644
--- a/elfutils/libebl/eblcorenotetypename.c
+++ b/elfutils/libebl/eblcorenotetypename.c
@@ -1,5 +1,5 @@
/* Return note type name.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -86,6 +86,7 @@ ebl_core_note_type_name (ebl, type, buf, len)
KNOWNSTYPE (LWPSTATUS),
KNOWNSTYPE (LWPSINFO),
KNOWNSTYPE (PRFPXREG)
+#undef KNOWNSTYPE
};
/* Handle standard names. */
@@ -93,11 +94,18 @@ ebl_core_note_type_name (ebl, type, buf, len)
&& knowntypes[type] != NULL)
res = knowntypes[type];
else
- {
- snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+ switch (type)
+ {
+#define KNOWNSTYPE(name) case NT_##name: res = #name; break
+ KNOWNSTYPE (PRXFPREG);
+ KNOWNSTYPE (PPC_VMX);
+#undef KNOWNSTYPE
+
+ default:
+ snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
- res = buf;
- }
+ res = buf;
+ }
}
return res;
diff --git a/elfutils/libebl/eblobjnote.c b/elfutils/libebl/eblobjnote.c
index d4b6e1f4..836ac8dc 100644
--- a/elfutils/libebl/eblobjnote.c
+++ b/elfutils/libebl/eblobjnote.c
@@ -1,5 +1,5 @@
/* Print contents of object file note.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -70,48 +70,71 @@ ebl_object_note (ebl, name, type, descsz, desc)
/* The machine specific function did not know this type. */
switch (type)
{
- case NT_VERSION:
- if (strcmp (name, "GNU") == 0 && descsz >= 8)
+ case NT_GNU_BUILD_ID:
+ if (strcmp (name, "GNU") == 0 && descsz > 0)
{
- struct
- {
- uint32_t os;
- uint32_t version[descsz / 4 - 1];
- } *tag = (__typeof (tag)) desc;
-
- const char *os;
- switch (tag->os)
- {
- case ELF_NOTE_OS_LINUX:
- os = "Linux";
- break;
-
- case ELF_NOTE_OS_GNU:
- os = "GNU";
- break;
-
- case ELF_NOTE_OS_SOLARIS2:
- os = "Solaris";
- break;
-
- case ELF_NOTE_OS_FREEBSD:
- os = "FreeBSD";
- break;
+ printf (gettext (" Build ID: "));
+ uint_fast32_t i;
+ for (i = 0; i < descsz - 1; ++i)
+ printf ("%02" PRIx8, (uint8_t) desc[i]);
+ printf ("%02" PRIx8 "\n", (uint8_t) desc[i]);
+ }
+ break;
- default:
- os = "???";
- break;
- }
+ case NT_GNU_ABI_TAG:
+ if (strcmp (name, "GNU") == 0 && descsz >= 8 && descsz % 4 == 0)
+ {
+ Elf_Data in =
+ {
+ .d_version = EV_CURRENT,
+ .d_type = ELF_T_WORD,
+ .d_size = descsz,
+ .d_buf = (void *) desc
+ };
+ uint32_t buf[descsz / 4];
+ Elf_Data out =
+ {
+ .d_version = EV_CURRENT,
+ .d_type = ELF_T_WORD,
+ .d_size = descsz,
+ .d_buf = buf
+ };
- printf (gettext (" OS: %s, ABI: "), os);
- size_t cnt;
- for (cnt = 0; cnt < descsz / 4 - 1; ++cnt)
+ if (elf32_xlatetom (&out, &in, ebl->data) != NULL)
{
- if (cnt != 0)
- putchar_unlocked ('.');
- printf ("%" PRIu32, tag->version[cnt]);
+ const char *os;
+ switch (buf[0])
+ {
+ case ELF_NOTE_OS_LINUX:
+ os = "Linux";
+ break;
+
+ case ELF_NOTE_OS_GNU:
+ os = "GNU";
+ break;
+
+ case ELF_NOTE_OS_SOLARIS2:
+ os = "Solaris";
+ break;
+
+ case ELF_NOTE_OS_FREEBSD:
+ os = "FreeBSD";
+ break;
+
+ default:
+ os = "???";
+ break;
+ }
+
+ printf (gettext (" OS: %s, ABI: "), os);
+ for (size_t cnt = 1; cnt < descsz / 4; ++cnt)
+ {
+ if (cnt > 1)
+ putchar_unlocked ('.');
+ printf ("%" PRIu32, buf[cnt]);
+ }
+ putchar_unlocked ('\n');
}
- putchar_unlocked ('\n');
break;
}
/* FALLTHROUGH */
diff --git a/elfutils/libebl/eblobjnotetypename.c b/elfutils/libebl/eblobjnotetypename.c
index 6bf90596..ff9330f9 100644
--- a/elfutils/libebl/eblobjnotetypename.c
+++ b/elfutils/libebl/eblobjnotetypename.c
@@ -1,5 +1,5 @@
/* Return note type name.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -72,6 +72,8 @@ ebl_object_note_type_name (ebl, type, buf, len)
{
#define KNOWNSTYPE(name) [NT_##name] = #name
KNOWNSTYPE (VERSION),
+ KNOWNSTYPE (GNU_HWCAP),
+ KNOWNSTYPE (GNU_BUILD_ID),
};
/* Handle standard names. */
diff --git a/elfutils/libebl/eblopenbackend.c b/elfutils/libebl/eblopenbackend.c
index 5b1a7193..63e64a10 100644
--- a/elfutils/libebl/eblopenbackend.c
+++ b/elfutils/libebl/eblopenbackend.c
@@ -186,8 +186,12 @@ static const char *default_core_note_type_name (uint32_t, char *buf,
size_t len);
static const char *default_object_note_type_name (uint32_t, char *buf,
size_t len);
-static bool default_core_note (const char *name, uint32_t type,
- uint32_t descsz, const char *desc);
+static int default_core_note (GElf_Word n_type, GElf_Word descsz,
+ GElf_Word *regs_offset, size_t *nregloc,
+ const Ebl_Register_Location **reglocs,
+ size_t *nitems, const Ebl_Core_Item **);
+static int default_auxv_info (GElf_Xword a_type,
+ const char **name, const char **format);
static bool default_object_note (const char *name, uint32_t type,
uint32_t descsz, const char *desc);
static bool default_debugscn_p (const char *name);
@@ -232,6 +236,7 @@ fill_defaults (Ebl *result)
result->core_note_type_name = default_core_note_type_name;
result->object_note_type_name = default_object_note_type_name;
result->core_note = default_core_note;
+ result->auxv_info = default_auxv_info;
result->object_note = default_object_note;
result->debugscn_p = default_debugscn_p;
result->copy_reloc_p = default_copy_reloc_p;
@@ -567,6 +572,27 @@ default_core_note_type_name (uint32_t ignore __attribute__ ((unused)),
return NULL;
}
+static int
+default_auxv_info (GElf_Xword a_type __attribute__ ((unused)),
+ const char **name __attribute__ ((unused)),
+ const char **format __attribute__ ((unused)))
+{
+ return 0;
+}
+
+static int
+default_core_note (GElf_Word n_type __attribute__ ((unused)),
+ GElf_Word descsz __attribute__ ((unused)),
+ GElf_Word *ro __attribute__ ((unused)),
+ size_t *nregloc __attribute__ ((unused)),
+ const Ebl_Register_Location **reglocs
+ __attribute__ ((unused)),
+ size_t *nitems __attribute__ ((unused)),
+ const Ebl_Core_Item **items __attribute__ ((unused)))
+{
+ return 0;
+}
+
static const char *
default_object_note_type_name (uint32_t ignore __attribute__ ((unused)),
char *buf __attribute__ ((unused)),
@@ -576,15 +602,6 @@ default_object_note_type_name (uint32_t ignore __attribute__ ((unused)),
}
static bool
-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 __attribute__ ((unused)),
uint32_t type __attribute__ ((unused)),
uint32_t descsz __attribute__ ((unused)),
diff --git a/elfutils/libebl/libebl.h b/elfutils/libebl/libebl.h
index 1465fb1a..7e29168d 100644
--- a/elfutils/libebl/libebl.h
+++ b/elfutils/libebl/libebl.h
@@ -178,10 +178,6 @@ extern const char *ebl_core_note_type_name (Ebl *ebl, uint32_t type, char *buf,
extern const char *ebl_object_note_type_name (Ebl *ebl, uint32_t type,
char *buf, size_t len);
-/* Print information about core note if available. */
-extern void ebl_core_note (Ebl *ebl, const char *name, uint32_t type,
- uint32_t descsz, const char *desc);
-
/* Print information about object note if available. */
extern void ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
uint32_t descsz, const char *desc);
@@ -306,6 +302,43 @@ extern void ebl_gstrtabfinalize (struct Ebl_GStrtab *st, Elf_Data *data);
/* Get offset in wide char string table for string associated with SE. */
extern size_t ebl_gstrtaboffset (struct Ebl_GStrent *se);
+
+/* Register map info. */
+typedef struct
+{
+ Dwarf_Half offset; /* Byte offset in register data block. */
+ Dwarf_Half regno; /* DWARF register number. */
+ uint8_t bits; /* Bits of data for one register. */
+ uint8_t pad; /* Bytes of padding after register's data. */
+ Dwarf_Half count; /* Consecutive register numbers here. */
+} Ebl_Register_Location;
+
+/* Non-register data items in core notes. */
+typedef struct
+{
+ const char *name; /* Printable identifier. */
+ const char *group; /* Identifier for category of related items. */
+ Dwarf_Half offset; /* Byte offset in note data. */
+ Dwarf_Half count;
+ Elf_Type type;
+ char format;
+ bool thread_identifier;
+} Ebl_Core_Item;
+
+/* Describe the format of a core file note with type field matching N_TYPE
+ and descriptor size matching DESCSZ. */
+extern int ebl_core_note (Ebl *ebl, GElf_Word n_type, GElf_Word descsz,
+ GElf_Word *regs_offset, size_t *nregloc,
+ const Ebl_Register_Location **reglocs,
+ size_t *nitems, const Ebl_Core_Item **items)
+ __nonnull_attribute__ (1, 4, 5, 6, 7, 8);
+
+/* Describe the auxv type number. */
+extern int ebl_auxv_info (Ebl *ebl, GElf_Xword a_type,
+ const char **name, const char **format)
+ __nonnull_attribute__ (1, 3, 4);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/elfutils/libelf-po/ChangeLog b/elfutils/libelf-po/ChangeLog
deleted file mode 100644
index 42f50a13..00000000
--- a/elfutils/libelf-po/ChangeLog
+++ /dev/null
@@ -1,15 +0,0 @@
-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.
-
-2004-01-17 Ulrich Drepper <drepper@redhat.com>
-
- * Makefile.in.in: Find mkinstalldirs script in right directory.
-
-2003-08-11 Ulrich Drepper <drepper@redhat.com>
-
- * Moved to CVS archive.
diff --git a/elfutils/libelf-po/Makefile.in.in b/elfutils/libelf-po/Makefile.in.in
deleted file mode 100644
index aae32e79..00000000
--- a/elfutils/libelf-po/Makefile.in.in
+++ /dev/null
@@ -1,302 +0,0 @@
-# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU General Public
-# License but which still want to provide support for the GNU gettext
-# functionality.
-# Please note that the actual code of GNU gettext is covered by the GNU
-# General Public License and is *not* in the public domain.
-
-PACKAGE = libelf
-VERSION = @VERSION@
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = @datadir@
-localedir = $(datadir)/locale
-gettextsrcdir = $(datadir)/gettext/po
-top_builddir = ..
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
-
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
-XGETTEXT_OPTIONS = --flag=error:3:c-format
-MSGMERGE = msgmerge
-MSGMERGE_UPDATE = @MSGMERGE@ --update
-MSGINIT = msginit
-MSGCONV = msgconv
-MSGFILTER = msgfilter
-
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-UPDATEPOFILES = @UPDATEPOFILES@
-DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in Makevars \
-$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
-DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
-$(POFILES) $(GMOFILES) \
-$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-
-# Makevars gets inserted here. (Don't remove this line!)
-
-.SUFFIXES:
-.SUFFIXES: .po .gmo .mo .nop .po-update
-
-.po.mo:
- $(MSGFMT) -c -o $@ $<
-
-.po.gmo:
- @lang=`echo $* | sed -e 's,.*/,,'`; \
- test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po
-
-
-all: all-@USE_NLS@
-
-all-yes: $(CATALOGS)
-all-no:
-
-# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
-# otherwise packages like GCC can not be built if only parts of the source
-# have been downloaded.
-
-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
- $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
- --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
- --files-from=$(srcdir)/POTFILES.in \
- --copyright-holder='$(COPYRIGHT_HOLDER)' \
- && test ! -f $(DOMAIN).po \
- || ( rm -f $(srcdir)/$(DOMAIN).pot \
- && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
-
-$(srcdir)/$(DOMAIN).pot:
- $(MAKE) $(DOMAIN).pot-update
-
-$(POFILES): $(srcdir)/$(DOMAIN).pot
- @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
- test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
- cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
-
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
- for file in $(DISTFILES.common); do \
- $(INSTALL_DATA) $(srcdir)/$$file \
- $(DESTDIR)$(gettextsrcdir)/$$file; \
- done; \
- else \
- : ; \
- fi
-install-data-no: all
-install-data-yes: all
- $(mkinstalldirs) $(DESTDIR)$(datadir)
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
- dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
- if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
- $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
- echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
- for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
- if test -n "$$lc"; then \
- if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
- link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
- mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
- mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
- (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
- for file in *; do \
- if test -f $$file; then \
- ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
- fi; \
- done); \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
- else \
- if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
- :; \
- else \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
- mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
- fi; \
- fi; \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
- ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
- ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
- cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
- echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
- fi; \
- done; \
- done
-
-install-strip: install
-
-installdirs: installdirs-exec installdirs-data
-installdirs-exec:
-installdirs-data: installdirs-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
- else \
- : ; \
- fi
-installdirs-data-no:
-installdirs-data-yes:
- $(mkinstalldirs) $(DESTDIR)$(datadir)
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
- dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
- for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
- if test -n "$$lc"; then \
- if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
- link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
- mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
- mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
- (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
- for file in *; do \
- if test -f $$file; then \
- ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
- fi; \
- done); \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
- else \
- if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
- :; \
- else \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
- mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
- fi; \
- fi; \
- fi; \
- done; \
- done
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall: uninstall-exec uninstall-data
-uninstall-exec:
-uninstall-data: uninstall-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- for file in $(DISTFILES.common); do \
- rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
- done; \
- else \
- : ; \
- fi
-uninstall-data-no:
-uninstall-data-yes:
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
- for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
- rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
- done; \
- done
-
-check: all
-
-dvi info tags TAGS ID:
-
-mostlyclean:
- rm -f core core.* $(DOMAIN).po *.new.po
- rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir:
- $(MAKE) update-po
- @$(MAKE) dist2
-# This is a separate target because 'update-po' must be executed before.
-dist2: $(DISTFILES)
- dists="$(DISTFILES)"; \
- if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
- if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
- for file in $$dists; do \
- if test -f $$file; then \
- cp -p $$file $(distdir); \
- else \
- cp -p $(srcdir)/$$file $(distdir); \
- fi; \
- done
-
-update-po: Makefile
- $(MAKE) $(DOMAIN).pot-update
- $(MAKE) $(UPDATEPOFILES)
- $(MAKE) update-gmo
-
-# General rule for updating PO files.
-
-.nop.po-update:
- @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
- tmpdir=`pwd`; \
- echo "$$lang:"; \
- test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
- cd $(srcdir); \
- if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
- if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "msgmerge for $$lang.po failed!" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi
-
-$(DUMMYPOFILES):
-
-update-gmo: Makefile $(GMOFILES)
- @:
-
-Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
-
-force:
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/elfutils/libelf-po/Makevars b/elfutils/libelf-po/Makevars
deleted file mode 100644
index 0accb70a..00000000
--- a/elfutils/libelf-po/Makevars
+++ /dev/null
@@ -1,25 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
-# package. (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.) Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright. The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Red Hat, Inc.
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used. It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
diff --git a/elfutils/libelf-po/POTFILES.in b/elfutils/libelf-po/POTFILES.in
deleted file mode 100644
index 51d28150..00000000
--- a/elfutils/libelf-po/POTFILES.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# List of files which containing translatable strings.
-# Copyright (C) 2000, 2005 Red Hat, Inc.
-
-# Library sources
-libelf/elf_error.c
diff --git a/elfutils/libelf-po/Rules-quot b/elfutils/libelf-po/Rules-quot
deleted file mode 100644
index 5f46d237..00000000
--- a/elfutils/libelf-po/Rules-quot
+++ /dev/null
@@ -1,42 +0,0 @@
-# Special Makefile rules for English message catalogs with quotation marks.
-
-DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
-
-.SUFFIXES: .insert-header .po-update-en
-
-en@quot.po-update: en@quot.po-update-en
-en@boldquot.po-update: en@boldquot.po-update-en
-
-.insert-header.po-update-en:
- @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
- tmpdir=`pwd`; \
- echo "$$lang:"; \
- ll=`echo $$lang | sed -e 's/@.*//'`; \
- LC_ALL=C; export LC_ALL; \
- cd $(srcdir); \
- if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
- if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "creation of $$lang.po failed!" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi
-
-en@quot.insert-header: insert-header.sin
- sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
-
-en@boldquot.insert-header: insert-header.sin
- sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
-
-mostlyclean: mostlyclean-quot
-mostlyclean-quot:
- rm -f *.insert-header
diff --git a/elfutils/libelf-po/boldquot.sed b/elfutils/libelf-po/boldquot.sed
deleted file mode 100644
index 4b937aa5..00000000
--- a/elfutils/libelf-po/boldquot.sed
+++ /dev/null
@@ -1,10 +0,0 @@
-s/"\([^"]*\)"/“\1”/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“”/""/g
-s/“/“/g
-s/”/”/g
-s/‘/‘/g
-s/’/’/g
diff --git a/elfutils/libelf-po/en@boldquot.header b/elfutils/libelf-po/en@boldquot.header
deleted file mode 100644
index fedb6a06..00000000
--- a/elfutils/libelf-po/en@boldquot.header
+++ /dev/null
@@ -1,25 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
-# This catalog furthermore displays the text between the quotation marks in
-# bold face, assuming the VT100/XTerm escape sequences.
-#
diff --git a/elfutils/libelf-po/en@quot.header b/elfutils/libelf-po/en@quot.header
deleted file mode 100644
index a9647fc3..00000000
--- a/elfutils/libelf-po/en@quot.header
+++ /dev/null
@@ -1,22 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
diff --git a/elfutils/libelf-po/insert-header.sin b/elfutils/libelf-po/insert-header.sin
deleted file mode 100644
index b26de01f..00000000
--- a/elfutils/libelf-po/insert-header.sin
+++ /dev/null
@@ -1,23 +0,0 @@
-# Sed script that inserts the file called HEADER before the header entry.
-#
-# At each occurrence of a line starting with "msgid ", we execute the following
-# commands. At the first occurrence, insert the file. At the following
-# occurrences, do nothing. The distinction between the first and the following
-# occurrences is achieved by looking at the hold space.
-/^msgid /{
-x
-# Test if the hold space is empty.
-s/m/m/
-ta
-# Yes it was empty. First occurrence. Read the file.
-r HEADER
-# Output the file's contents by reading the next line. But don't lose the
-# current line while doing this.
-g
-N
-bb
-:a
-# The hold space was nonempty. Following occurrences. Do nothing.
-x
-:b
-}
diff --git a/elfutils/libelf-po/libelf.pot b/elfutils/libelf-po/libelf.pot
deleted file mode 100644
index 2f5fbaa9..00000000
--- a/elfutils/libelf-po/libelf.pot
+++ /dev/null
@@ -1,182 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Red Hat, Inc.
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-02-05 14:32-0800\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"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: libelf/elf_error.c:113
-msgid "no error"
-msgstr ""
-
-#: libelf/elf_error.c:116
-msgid "unknown error"
-msgstr ""
-
-#: libelf/elf_error.c:120
-msgid "unknown version"
-msgstr ""
-
-#: libelf/elf_error.c:124
-msgid "unknown type"
-msgstr ""
-
-#: libelf/elf_error.c:128
-msgid "invalid `Elf' handle"
-msgstr ""
-
-#: libelf/elf_error.c:132
-msgid "invalid size of source operand"
-msgstr ""
-
-#: libelf/elf_error.c:136
-msgid "invalid size of destination operand"
-msgstr ""
-
-#: libelf/elf_error.c:140
-msgid "invalid encoding"
-msgstr ""
-
-#: libelf/elf_error.c:144
-msgid "out of memory"
-msgstr ""
-
-#: libelf/elf_error.c:148
-msgid "invalid file descriptor"
-msgstr ""
-
-#: libelf/elf_error.c:152
-msgid "invalid operation"
-msgstr ""
-
-#: libelf/elf_error.c:156
-msgid "ELF version not set"
-msgstr ""
-
-#: libelf/elf_error.c:160 libelf/elf_error.c:208
-msgid "invalid command"
-msgstr ""
-
-#: libelf/elf_error.c:164 libelf/elf_error.c:224
-msgid "offset out of range"
-msgstr ""
-
-#: libelf/elf_error.c:168
-msgid "invalid fmag field in archive header"
-msgstr ""
-
-#: libelf/elf_error.c:172
-msgid "invalid archive file"
-msgstr ""
-
-#: libelf/elf_error.c:176
-msgid "descriptor is not for an archive"
-msgstr ""
-
-#: libelf/elf_error.c:180
-msgid "no index available"
-msgstr ""
-
-#: libelf/elf_error.c:184
-msgid "cannot read data from file"
-msgstr ""
-
-#: libelf/elf_error.c:188
-msgid "cannot write data to file"
-msgstr ""
-
-#: libelf/elf_error.c:192
-msgid "invalid binary class"
-msgstr ""
-
-#: libelf/elf_error.c:196
-msgid "invalid section index"
-msgstr ""
-
-#: libelf/elf_error.c:200
-msgid "invalid operand"
-msgstr ""
-
-#: libelf/elf_error.c:204
-msgid "invalid section"
-msgstr ""
-
-#: libelf/elf_error.c:212
-msgid "executable header not created first"
-msgstr ""
-
-#: libelf/elf_error.c:216
-msgid "file descriptor disabled"
-msgstr ""
-
-#: libelf/elf_error.c:220
-msgid "archive/member fildes mismatch"
-msgstr ""
-
-#: libelf/elf_error.c:228
-msgid "cannot manipulate null section"
-msgstr ""
-
-#: libelf/elf_error.c:232
-msgid "data/scn mismatch"
-msgstr ""
-
-#: libelf/elf_error.c:236
-msgid "invalid section header"
-msgstr ""
-
-#: libelf/elf_error.c:240
-msgid "invalid data"
-msgstr ""
-
-#: libelf/elf_error.c:244
-msgid "unknown data encoding"
-msgstr ""
-
-#: libelf/elf_error.c:248
-msgid "section `sh_size' too small for data"
-msgstr ""
-
-#: libelf/elf_error.c:252
-msgid "invalid section alignment"
-msgstr ""
-
-#: libelf/elf_error.c:256
-msgid "invalid section entry size"
-msgstr ""
-
-#: libelf/elf_error.c:260
-msgid "update() for write on read-only file"
-msgstr ""
-
-#: libelf/elf_error.c:264
-msgid "no such file"
-msgstr ""
-
-#: libelf/elf_error.c:268
-msgid "only relocatable files can contain section groups"
-msgstr ""
-
-#: libelf/elf_error.c:273
-msgid ""
-"program header only allowed in executables, shared objects, and core files"
-msgstr ""
-
-#: libelf/elf_error.c:280
-msgid "file has no program header"
-msgstr ""
-
-#: libelf/elf_error.c:285
-msgid "invalid offset"
-msgstr ""
diff --git a/elfutils/libelf-po/quot.sed b/elfutils/libelf-po/quot.sed
deleted file mode 100644
index 0122c463..00000000
--- a/elfutils/libelf-po/quot.sed
+++ /dev/null
@@ -1,6 +0,0 @@
-s/"\([^"]*\)"/“\1”/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“”/""/g
diff --git a/elfutils/libelf/ChangeLog b/elfutils/libelf/ChangeLog
index 17985781..6860fa71 100644
--- a/elfutils/libelf/ChangeLog
+++ b/elfutils/libelf/ChangeLog
@@ -1,3 +1,100 @@
+2007-11-03 Roland McGrath <roland@redhat.com>
+
+ * libelf.h (Elf_Data): Comment fix.
+
+2007-10-18 Roland McGrath <roland@redhat.com>
+
+ * elf.h: Update from glibc.
+
+2007-10-07 Roland McGrath <roland@redhat.com>
+
+ * elf_begin.c (__libelf_next_arhdr): Fix fencepost error and wrong
+ member access in terminating name with no trailing /. Trim trailing
+ spaces when there is no /.
+
+2007-10-04 Roland McGrath <roland@redhat.com>
+
+ * elf_end.c (elf_end): Don't free ELF->state.ar.ar_sym when it's -1l.
+
+2007-10-03 Roland McGrath <roland@redhat.com>
+
+ * libelf.h (Elf_Data): Use off64_t for d_off.
+ (Elf_Arhdr): Use off64_t for ar_size.
+ (elf_update, elf_getbase, elf_getaroff): Return off64_t.
+
+ * gelf_rawchunk.c: File removed.
+ * gelf_freechunk.c: File removed.
+ * Makefile.am (libelf_a_SOURCES): Remove them.
+ * libelf.map (ELFUTILS_1.0): Remove exports.
+ * gelf.h: Remove decls.
+
+ * elf_getdata_rawchunk.c: New file.
+ * Makefile.am (libelf_a_SOURCES): Add it.
+ * libelf.map (ELFUTILS_1.3): Add elf_getdata_rawchunk.
+ * libelf.h: Declare it.
+ * libelfP.h (Elf_Data_Chunk): New type.
+ (struct Elf.elf): New member `rawchunks'.
+ * elf_end.c (elf_end): Free recorded rawchunk buffers.
+
+2007-08-24 Roland McGrath <roland@redhat.com>
+
+ * gelf_getnote.c: New file.
+ * Makefile.am (libelf_a_SOURCES): Add it.
+ * gelf.h: Declare gelf_getnote.
+ * libelf.map (ELFUTILS_1.3): Add gelf_getnote.
+
+ * libelfP.h (NOTE_ALIGN): New macro.
+ * note_xlate.h: New file.
+ * Makefile.am (noinst_HEADERS): Add it.
+ * gelf_xlate.c: Include it.
+ (__elf_xfctstom): Use elf_cvt_note.
+ * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
+ (__libelf_set_rawdata): Likewise.
+
+2007-08-19 Roland McGrath <roland@redhat.com>
+
+ * gelf_update_auxv.c: New file.
+ * gelf_getauxv.c: New file.
+ * Makefile.am (libelf_a_SOURCES): Add them.
+ * gelf.h: Declare gelf_getauxv, gelf_update_auxv.
+ * libelf.map (ELFUTILS_1.3): New set, inherits fom ELFUTILS_1.2.
+ Export gelf_getauxv, gelf_update_auxv.
+
+ * libelf.h (Elf_Type): Add ELF_T_AUXV.
+ * abstract.h: Add auxv_t entries.
+ * exttypes.h: Likewise.
+ * gelf_xlate.h: Likewise.
+ * gelf_xlate.c (__elf_xfctstom): Add ELF_T_AUXV entries.
+ * gelf_fsize.c (__libelf_type_sizes): Likewise.
+
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
+ and only tertiarily on index.
+
+2007-07-09 Roland McGrath <roland@redhat.com>
+
+ * elf.h: Update from glibc.
+
+2007-04-22 Roland McGrath <roland@redhat.com>
+
+ * elf.h: Update from glibc.
+
+2007-03-18 Roland McGrath <roland@redhat.com>
+
+ * elf_begin.c (get_shnum): Fix test for e_shoff being out of bounds.
+ Return zero when the section headers do not fit within MAXSIZE.
+
+2007-03-09 Roland McGrath <roland@redhat.com>
+
+ * libelfP.h (LIBELF_EV_IDX): New macro.
+ (__libelf_type_align): New macro.
+ [! ALLOW_UNALIGNED]: Declare __libc_type_aligns array.
+ * elf_getdata.c (shtype_map): Convert to just Elf_Type[][].
+ (convert_data, __libelf_set_rawdata): Use that, __libelf_type_align,
+ and __libelf_type_sizes, in place of old table.
+ (__libc_type_aligns): New const variable.
+
2007-02-04 Ulrich Drepper <drepper@redhat.com>
* Makefile (libelf.so): Build with -z relro.
diff --git a/elfutils/libelf/Makefile.am b/elfutils/libelf/Makefile.am
index b93f49c6..58c9b5a8 100644
--- a/elfutils/libelf/Makefile.am
+++ b/elfutils/libelf/Makefile.am
@@ -71,6 +71,7 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
elf32_getshdr.c elf64_getshdr.c gelf_getshdr.c \
gelf_update_shdr.c \
elf_strptr.c elf_rawdata.c elf_getdata.c elf_newdata.c \
+ elf_getdata_rawchunk.c \
elf_flagelf.c elf_flagehdr.c elf_flagphdr.c elf_flagscn.c \
elf_flagshdr.c elf_flagdata.c elf_memory.c \
elf_update.c elf32_updatenull.c elf64_updatenull.c \
@@ -83,6 +84,8 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
gelf_getdyn.c gelf_update_dyn.c \
gelf_getmove.c gelf_update_move.c \
gelf_getsyminfo.c gelf_update_syminfo.c \
+ gelf_getauxv.c gelf_update_auxv.c \
+ gelf_getnote.c \
gelf_xlatetof.c gelf_xlatetom.c \
nlist.c \
gelf_getsymshndx.c gelf_update_symshndx.c \
@@ -91,7 +94,6 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
gelf_update_verdaux.c \
elf_getshnum.c elf_getshstrndx.c \
gelf_checksum.c elf32_checksum.c elf64_checksum.c \
- gelf_rawchunk.c gelf_freechunk.c \
libelf_crc32.c libelf_next_prime.c \
elf_clone.c \
gelf_getlib.c gelf_update_lib.c \
@@ -132,7 +134,7 @@ uninstall: uninstall-am
endif
noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
- version_xlate.h gnuhash_xlate.h dl-hash.h
+ version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
EXTRA_DIST = libelf.map
CLEANFILES = $(am_libelf_pic_a_OBJECTS) *.gcno *.gcda libelf.so.$(VERSION)
diff --git a/elfutils/libelf/Makefile.in b/elfutils/libelf/Makefile.in
index f612a28c..04fa3c8b 100644
--- a/elfutils/libelf/Makefile.in
+++ b/elfutils/libelf/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +16,11 @@
-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
@@ -46,11 +42,11 @@ DIST_COMMON = $(euinclude_HEADERS) $(include_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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -91,21 +87,23 @@ am_libelf_a_OBJECTS = elf_version.$(OBJEXT) elf_hash.$(OBJEXT) \
gelf_getshdr.$(OBJEXT) gelf_update_shdr.$(OBJEXT) \
elf_strptr.$(OBJEXT) elf_rawdata.$(OBJEXT) \
elf_getdata.$(OBJEXT) elf_newdata.$(OBJEXT) \
- elf_flagelf.$(OBJEXT) elf_flagehdr.$(OBJEXT) \
- elf_flagphdr.$(OBJEXT) elf_flagscn.$(OBJEXT) \
- elf_flagshdr.$(OBJEXT) elf_flagdata.$(OBJEXT) \
- elf_memory.$(OBJEXT) elf_update.$(OBJEXT) \
- elf32_updatenull.$(OBJEXT) elf64_updatenull.$(OBJEXT) \
- elf32_updatefile.$(OBJEXT) elf64_updatefile.$(OBJEXT) \
- gelf_getsym.$(OBJEXT) gelf_update_sym.$(OBJEXT) \
- gelf_getversym.$(OBJEXT) gelf_getverneed.$(OBJEXT) \
- gelf_getvernaux.$(OBJEXT) gelf_getverdef.$(OBJEXT) \
- gelf_getverdaux.$(OBJEXT) gelf_getrel.$(OBJEXT) \
- gelf_getrela.$(OBJEXT) gelf_update_rel.$(OBJEXT) \
- gelf_update_rela.$(OBJEXT) gelf_getdyn.$(OBJEXT) \
- gelf_update_dyn.$(OBJEXT) gelf_getmove.$(OBJEXT) \
- gelf_update_move.$(OBJEXT) gelf_getsyminfo.$(OBJEXT) \
- gelf_update_syminfo.$(OBJEXT) gelf_xlatetof.$(OBJEXT) \
+ elf_getdata_rawchunk.$(OBJEXT) elf_flagelf.$(OBJEXT) \
+ elf_flagehdr.$(OBJEXT) elf_flagphdr.$(OBJEXT) \
+ elf_flagscn.$(OBJEXT) elf_flagshdr.$(OBJEXT) \
+ elf_flagdata.$(OBJEXT) elf_memory.$(OBJEXT) \
+ elf_update.$(OBJEXT) elf32_updatenull.$(OBJEXT) \
+ elf64_updatenull.$(OBJEXT) elf32_updatefile.$(OBJEXT) \
+ elf64_updatefile.$(OBJEXT) gelf_getsym.$(OBJEXT) \
+ gelf_update_sym.$(OBJEXT) gelf_getversym.$(OBJEXT) \
+ gelf_getverneed.$(OBJEXT) gelf_getvernaux.$(OBJEXT) \
+ gelf_getverdef.$(OBJEXT) gelf_getverdaux.$(OBJEXT) \
+ gelf_getrel.$(OBJEXT) gelf_getrela.$(OBJEXT) \
+ gelf_update_rel.$(OBJEXT) gelf_update_rela.$(OBJEXT) \
+ gelf_getdyn.$(OBJEXT) gelf_update_dyn.$(OBJEXT) \
+ gelf_getmove.$(OBJEXT) gelf_update_move.$(OBJEXT) \
+ gelf_getsyminfo.$(OBJEXT) gelf_update_syminfo.$(OBJEXT) \
+ gelf_getauxv.$(OBJEXT) gelf_update_auxv.$(OBJEXT) \
+ gelf_getnote.$(OBJEXT) gelf_xlatetof.$(OBJEXT) \
gelf_xlatetom.$(OBJEXT) nlist.$(OBJEXT) \
gelf_getsymshndx.$(OBJEXT) gelf_update_symshndx.$(OBJEXT) \
gelf_update_versym.$(OBJEXT) gelf_update_verneed.$(OBJEXT) \
@@ -113,7 +111,6 @@ am_libelf_a_OBJECTS = elf_version.$(OBJEXT) elf_hash.$(OBJEXT) \
gelf_update_verdaux.$(OBJEXT) elf_getshnum.$(OBJEXT) \
elf_getshstrndx.$(OBJEXT) gelf_checksum.$(OBJEXT) \
elf32_checksum.$(OBJEXT) elf64_checksum.$(OBJEXT) \
- gelf_rawchunk.$(OBJEXT) gelf_freechunk.$(OBJEXT) \
libelf_crc32.$(OBJEXT) libelf_next_prime.$(OBJEXT) \
elf_clone.$(OBJEXT) gelf_getlib.$(OBJEXT) \
gelf_update_lib.$(OBJEXT) elf32_offscn.$(OBJEXT) \
@@ -128,7 +125,7 @@ PROGRAMS = $(noinst_PROGRAMS)
am_libelf_so_OBJECTS =
libelf_so_OBJECTS = $(am_libelf_so_OBJECTS)
libelf_so_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -146,15 +143,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -167,13 +160,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -188,19 +177,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -212,20 +194,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = 1
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -238,28 +218,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
@MUDFLAP_FALSE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \
@MUDFLAP_FALSE@ $($(*F)_CFLAGS)
@@ -294,6 +285,7 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
elf32_getshdr.c elf64_getshdr.c gelf_getshdr.c \
gelf_update_shdr.c \
elf_strptr.c elf_rawdata.c elf_getdata.c elf_newdata.c \
+ elf_getdata_rawchunk.c \
elf_flagelf.c elf_flagehdr.c elf_flagphdr.c elf_flagscn.c \
elf_flagshdr.c elf_flagdata.c elf_memory.c \
elf_update.c elf32_updatenull.c elf64_updatenull.c \
@@ -306,6 +298,8 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
gelf_getdyn.c gelf_update_dyn.c \
gelf_getmove.c gelf_update_move.c \
gelf_getsyminfo.c gelf_update_syminfo.c \
+ gelf_getauxv.c gelf_update_auxv.c \
+ gelf_getnote.c \
gelf_xlatetof.c gelf_xlatetom.c \
nlist.c \
gelf_getsymshndx.c gelf_update_symshndx.c \
@@ -314,7 +308,6 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
gelf_update_verdaux.c \
elf_getshnum.c elf_getshstrndx.c \
gelf_checksum.c elf32_checksum.c elf64_checksum.c \
- gelf_rawchunk.c gelf_freechunk.c \
libelf_crc32.c libelf_next_prime.c \
elf_clone.c \
gelf_getlib.c gelf_update_lib.c \
@@ -326,7 +319,7 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
@MUDFLAP_FALSE@am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
@MUDFLAP_FALSE@libelf_so_SOURCES =
noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
- version_xlate.h gnuhash_xlate.h dl-hash.h
+ version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
EXTRA_DIST = libelf.map
CLEANFILES = $(am_libelf_pic_a_OBJECTS) *.gcno *.gcda libelf.so.$(VERSION)
@@ -365,7 +358,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
@@ -408,7 +401,7 @@ clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
@MUDFLAP_TRUE@libelf.so$(EXEEXT): $(libelf_so_OBJECTS) $(libelf_so_DEPENDENCIES)
@MUDFLAP_TRUE@ @rm -f libelf.so$(EXEEXT)
-@MUDFLAP_TRUE@ $(LINK) $(libelf_so_LDFLAGS) $(libelf_so_OBJECTS) $(libelf_so_LDADD) $(LIBS)
+@MUDFLAP_TRUE@ $(LINK) $(libelf_so_OBJECTS) $(libelf_so_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -457,6 +450,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getarsym.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getbase.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getdata.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getdata_rawchunk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getident.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getscn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_getshnum.Po@am__quote@
@@ -478,13 +472,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_update.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf_version.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_checksum.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_freechunk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_fsize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getauxv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getclass.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getdyn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getehdr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getlib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getmove.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getnote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getphdr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getrel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_getrela.Po@am__quote@
@@ -500,7 +495,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_newehdr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_newphdr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_offscn.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_rawchunk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_update_auxv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_update_dyn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_update_ehdr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gelf_update_lib.Po@am__quote@
@@ -525,22 +520,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlist.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
install-euincludeHEADERS: $(euinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)"
+ test -z "$(euincludedir)" || $(MKDIR_P) "$(DESTDIR)$(euincludedir)"
@list='$(euinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -557,7 +551,7 @@ uninstall-euincludeHEADERS:
done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
@@ -622,22 +616,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -653,7 +646,7 @@ check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)" "$(DESTDIR)$(includedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
@MUDFLAP_TRUE@install: install-am
install-exec: install-exec-am
@@ -703,12 +696,20 @@ info-am:
install-data-am: install-euincludeHEADERS install-includeHEADERS
+install-dvi: install-dvi-am
+
install-exec-am: install-libLIBRARIES
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -729,22 +730,25 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-euincludeHEADERS uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLIBRARIES
+ uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
ctags distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-euincludeHEADERS install-exec install-exec-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-euincludeHEADERS install-exec \
+ install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
- install-libLIBRARIES install-man install-strip installcheck \
+ install-libLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-euincludeHEADERS \
- uninstall-includeHEADERS uninstall-info-am \
- uninstall-libLIBRARIES
+ uninstall-includeHEADERS uninstall-libLIBRARIES
@MUDFLAP_FALSE@libelf.so: libelf_pic.a libelf.map
@MUDFLAP_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
diff --git a/elfutils/libelf/abstract.h b/elfutils/libelf/abstract.h
index 3c6250d0..e359f96b 100644
--- a/elfutils/libelf/abstract.h
+++ b/elfutils/libelf/abstract.h
@@ -1,5 +1,5 @@
/* Abstract description of component ELF types.
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -314,3 +314,20 @@ END (Bits, Ext##Lib)
Lib (32, Ext)
#define Lib64(Ext) \
Lib (64, Ext)
+
+#define auxv_t32(Ext) \
+START (32, auxv_t, Ext##auxv_t) \
+ TYPE_NAME (ElfW2(32, Ext##Word), a_type) \
+ TYPE_EXTRA (union {) \
+ TYPE_EXTRA (ElfW2(32, Ext##Word) a_val;) \
+ TYPE_XLATE (Elf32_cvt_Addr1 (&tdest->a_un.a_val, &tsrc->a_un.a_val);) \
+ TYPE_EXTRA (} a_un;) \
+END (32, Ext##auxv_t)
+#define auxv_t64(Ext) \
+START (64, auxv_t, Ext##auxv_t) \
+ TYPE_NAME (ElfW2(64, Ext##Xword), a_type) \
+ TYPE_EXTRA (union {) \
+ TYPE_EXTRA (ElfW2(64, Ext##Xword) a_val;) \
+ TYPE_XLATE (Elf64_cvt_Addr1 (&tdest->a_un.a_val, &tsrc->a_un.a_val);) \
+ TYPE_EXTRA (} a_un;) \
+END (64, Ext##auxv_t)
diff --git a/elfutils/libelf/elf.h b/elfutils/libelf/elf.h
index dcadd60f..acd3d3e1 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, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003,2004,2005,2006,2007 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
@@ -329,8 +329,8 @@ typedef struct
#define SHT_GROUP 17 /* Section group */
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
#define SHT_NUM 19 /* Number of defined types. */
-#define SHT_LOOS 0x60000000 /* Start OS-specific */
-#define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table. */
+#define SHT_LOOS 0x60000000 /* Start OS-specific. */
+#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
@@ -602,7 +602,9 @@ typedef struct
#define NT_UTSNAME 15 /* Contains copy of utsname struct */
#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
-#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/
+#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */
+#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */
+#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
/* Legal values for the note segment descriptor types for object files. */
@@ -692,7 +694,7 @@ typedef struct
#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
#define DT_VALRNGHI 0x6ffffdff
#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */
-#define DT_VALNUM 11
+#define DT_VALNUM 12
/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
@@ -700,7 +702,7 @@ typedef struct
If any adjustment is made to the ELF object after it has been
built these entries will need to be adjusted. */
#define DT_ADDRRNGLO 0x6ffffe00
-#define DT_GNU_HASH 0x6ffffef5 /* Address of GNU symbol hash table */
+#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */
#define DT_TLSDESC_PLT 0x6ffffef6
#define DT_TLSDESC_GOT 0x6ffffef7
#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
@@ -1016,15 +1018,28 @@ typedef struct
word 2: minor version of the ABI
word 3: subminor version of the ABI
*/
-#define ELF_NOTE_ABI 1
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_ABI NT_GNU_ABI_TAG /* Old name. */
-/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI
- note section entry. */
+/* Known OSes. These values can appear in word 0 of an
+ NT_GNU_ABI_TAG note section entry. */
#define ELF_NOTE_OS_LINUX 0
#define ELF_NOTE_OS_GNU 1
#define ELF_NOTE_OS_SOLARIS2 2
#define ELF_NOTE_OS_FREEBSD 3
+/* Synthetic hwcap information. The descriptor begins with two words:
+ word 0: number of entries
+ word 1: bitmask of enabled entries
+ Then follow variable-length entries, one byte followed by a
+ '\0'-terminated hwcap name string. The byte gives the bit
+ number to test if enabled, (1U << bit) & bitmask. */
+#define NT_GNU_HWCAP 2
+
+/* Build ID bits as generated by ld --build-id.
+ The descriptor consists of any nonzero number of bytes. */
+#define NT_GNU_BUILD_ID 3
+
/* Move records. */
typedef struct
@@ -1254,14 +1269,15 @@ typedef struct
#define DT_SPARC_REGISTER 0x70000001
#define DT_SPARC_NUM 2
-/* Bits present in AT_HWCAP, primarily for Sparc32. */
+/* Bits present in AT_HWCAP on SPARC. */
-#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */
+#define HWCAP_SPARC_FLUSH 1 /* The CPU supports flush insn. */
#define HWCAP_SPARC_STBAR 2
#define HWCAP_SPARC_SWAP 4
#define HWCAP_SPARC_MULDIV 8
-#define HWCAP_SPARC_V9 16 /* The cpu is v9, so v8plus is ok. */
+#define HWCAP_SPARC_V9 16 /* The CPU is v9, so v8plus is ok. */
#define HWCAP_SPARC_ULTRA3 32
+#define HWCAP_SPARC_BLKINIT 64 /* Sun4v with block-init/load-twin. */
/* MIPS R3000 specific definitions. */
@@ -1510,8 +1526,9 @@ typedef struct
#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 */
+#define R_MIPS_GLOB_DAT 51
/* Keep this the last entry. */
-#define R_MIPS_NUM 51
+#define R_MIPS_NUM 52
/* Legal values for p_type field of Elf32_Phdr. */
@@ -1707,6 +1724,8 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
#define R_PARISC_FPTR64 64 /* 64 bits function address. */
#define R_PARISC_PLABEL32 65 /* 32 bits function address. */
+#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */
+#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */
#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
@@ -1767,6 +1786,26 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_GNU_VTENTRY 232
+#define R_PARISC_GNU_VTINHERIT 233
+#define R_PARISC_TLS_GD21L 234 /* GD 21-bit left. */
+#define R_PARISC_TLS_GD14R 235 /* GD 14-bit right. */
+#define R_PARISC_TLS_GDCALL 236 /* GD call to __t_g_a. */
+#define R_PARISC_TLS_LDM21L 237 /* LD module 21-bit left. */
+#define R_PARISC_TLS_LDM14R 238 /* LD module 14-bit right. */
+#define R_PARISC_TLS_LDMCALL 239 /* LD module call to __t_g_a. */
+#define R_PARISC_TLS_LDO21L 240 /* LD offset 21-bit left. */
+#define R_PARISC_TLS_LDO14R 241 /* LD offset 14-bit right. */
+#define R_PARISC_TLS_DTPMOD32 242 /* DTP module 32-bit. */
+#define R_PARISC_TLS_DTPMOD64 243 /* DTP module 64-bit. */
+#define R_PARISC_TLS_DTPOFF32 244 /* DTP offset 32-bit. */
+#define R_PARISC_TLS_DTPOFF64 245 /* DTP offset 32-bit. */
+#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
#define R_PARISC_HIRESERVE 255
/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
diff --git a/elfutils/libelf/elf32_updatefile.c b/elfutils/libelf/elf32_updatefile.c
index 68253651..e94de831 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, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -85,6 +85,14 @@ compare_sections (const void *a, const void *b)
> (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_offset)
return 1;
+ if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size
+ < (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size)
+ return -1;
+
+ if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size
+ > (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size)
+ return 1;
+
if ((*scna)->index < (*scnb)->index)
return -1;
@@ -97,7 +105,10 @@ compare_sections (const void *a, const void *b)
/* Insert the sections in the list into the provided array and sort
them according to their start offsets. For sections with equal
- start offsets the section index is used. */
+ start offsets, the size is used; for sections with equal start
+ offsets and sizes, the section index is used. Sorting by size
+ ensures that zero-length sections are processed first, which
+ is what we want since they do not advance our file writing position. */
static void
sort_sections (Elf_Scn **scns, Elf_ScnList *list)
{
@@ -684,7 +695,7 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum)
sizeof (ElfW2(LIBELFBITS,Shdr)));
shdr_flags |= scn->shdr_flags;
- scn->shdr_flags &= ~ELF_F_DIRTY;
+ scn->shdr_flags &= ~ELF_F_DIRTY;
}
/* Fill the gap between last section and section header table if
diff --git a/elfutils/libelf/elf_begin.c b/elfutils/libelf/elf_begin.c
index 24bac42b..13f965f7 100644
--- a/elfutils/libelf/elf_begin.c
+++ b/elfutils/libelf/elf_begin.c
@@ -155,9 +155,9 @@ get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset,
if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
{
- if (offset + ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
+ if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
/* Cannot read the first section header. */
- return (size_t) -1l;
+ return 0;
if (likely (map_address != NULL) && e_ident[EI_DATA] == MY_ELFDATA
&& (ALLOW_UNALIGNED
@@ -190,6 +190,11 @@ get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset,
result = size;
}
}
+
+ /* If the section headers were truncated, pretend none were there. */
+ if (ehdr.e32->e_shoff > maxsize
+ || maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr) * result)
+ result = 0;
}
else
{
@@ -198,9 +203,9 @@ get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset,
if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
{
- if (offset + ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
+ if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
/* Cannot read the first section header. */
- return (size_t) -1l;
+ return 0;
Elf64_Xword size;
if (likely (map_address != NULL) && e_ident[EI_DATA] == MY_ELFDATA
@@ -236,6 +241,11 @@ get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset,
result = size;
}
+
+ /* If the section headers were truncated, pretend none were there. */
+ if (ehdr.e64->e_shoff > maxsize
+ || maxsize - ehdr.e64->e_shoff < sizeof (Elf64_Shdr) * result)
+ result = 0;
}
return result;
@@ -802,7 +812,14 @@ __libelf_next_arhdr (elf)
if (endp != NULL)
endp[-1] = '\0';
else
- elf->state.ar.raw_name[16] = '\0';
+ {
+ /* In the old BSD style of archive, there is no / terminator.
+ Instead, there is space padding at the end of the name. */
+ size_t i = 15;
+ do
+ elf->state.ar.ar_name[i] = '\0';
+ while (i > 0 && elf->state.ar.ar_name[--i] == ' ');
+ }
elf_ar_hdr->ar_name = elf->state.ar.ar_name;
}
diff --git a/elfutils/libelf/elf_end.c b/elfutils/libelf/elf_end.c
index 4b4e11fe..5112eaea 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, 2005 Red Hat, Inc.
+ Copyright (C) 1998,1999,2000,2001,2002,2004,2005,2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -89,7 +89,8 @@ elf_end (elf)
descriptor. The long name table cannot be freed yet since
the archive headers for the ELF files in the archive point
into this array. */
- free (elf->state.ar.ar_sym);
+ if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l)
+ free (elf->state.ar.ar_sym);
elf->state.ar.ar_sym = NULL;
if (elf->state.ar.children != NULL)
@@ -134,6 +135,21 @@ elf_end (elf)
case ELF_K_ELF:
{
+ Elf_Data_Chunk *rawchunks
+ = (elf->class == ELFCLASS32
+ || (offsetof (struct Elf, state.elf32.rawchunks)
+ == offsetof (struct Elf, state.elf64.rawchunks))
+ ? elf->state.elf32.rawchunks
+ : elf->state.elf64.rawchunks);
+ while (rawchunks != NULL)
+ {
+ Elf_Data_Chunk *next = rawchunks->next;
+ if (rawchunks->dummy_scn.flags & ELF_F_MALLOCED)
+ free (rawchunks->data.d.d_buf);
+ free (rawchunks);
+ rawchunks = next;
+ }
+
Elf_ScnList *list = (elf->class == ELFCLASS32
|| (offsetof (struct Elf, state.elf32.scns)
== offsetof (struct Elf, state.elf64.scns))
diff --git a/elfutils/libelf/elf_getdata.c b/elfutils/libelf/elf_getdata.c
index 1fa4a17f..ae5b41df 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-2005, 2006 Red Hat, Inc.
+ Copyright (C) 1998-2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -63,13 +63,6 @@
#include "elf-knowledge.h"
-#if _STRING_ARCH_unaligned
-# define ALLOW_ALIGNED 1
-#else
-# define ALLOW_ALIGNED 0
-#endif
-
-
#define TYPEIDX(Sh_Type) \
(Sh_Type >= SHT_NULL && Sh_Type < SHT_NUM \
? Sh_Type \
@@ -77,95 +70,75 @@
? SHT_NUM + Sh_Type - SHT_GNU_HASH \
: 0))
-static const struct
-{
- Elf_Type type;
- size_t size;
-#if ALLOW_ALIGNED
-# define AL(val)
-#else
- size_t align;
-# define AL(val), val
-#endif
-} shtype_map[EV_NUM - 1][ELFCLASSNUM - 1][TYPEIDX (SHT_HISUNW) + 1] =
-{
- [EV_CURRENT - 1] =
+/* Associate section types with libelf types. */
+static const Elf_Type shtype_map[EV_NUM - 1][TYPEIDX (SHT_HISUNW) + 1] =
{
- [ELFCLASS32 - 1] =
+ [EV_CURRENT - 1] =
{
- /* Associate section types with libelf types, their sizes and
- alignment. SHT_GNU_verdef is special since the section does
- not contain entries of only one size. */
-#define DEFINE(Bits) \
- [SHT_SYMTAB] = { ELF_T_SYM, sizeof (ElfW2(Bits,Sym)) \
- AL (__alignof__ (ElfW2(Bits,Sym))) }, \
- [SHT_RELA] = { ELF_T_RELA, sizeof (ElfW2(Bits,Rela)) \
- AL (__alignof__ (ElfW2(Bits,Rela))) }, \
- [SHT_HASH] = { ELF_T_WORD, sizeof (ElfW2(Bits,Word)) \
- AL (__alignof__ (ElfW2(Bits,Word))) }, \
- [SHT_DYNAMIC] = { ELF_T_DYN, sizeof (ElfW2(Bits,Dyn)) \
- AL (__alignof__ (ElfW2(Bits,Dyn))) }, \
- [SHT_REL] = { ELF_T_REL, sizeof (ElfW2(Bits,Rel)) \
- AL (__alignof__ (ElfW2(Bits,Rel))) }, \
- [SHT_DYNSYM] = { ELF_T_SYM, sizeof (ElfW2(Bits,Sym)) \
- AL (__alignof__ (ElfW2(Bits,Sym))) }, \
- [SHT_INIT_ARRAY] = { ELF_T_ADDR, sizeof (ElfW2(Bits,Addr)) \
- AL (__alignof__ (ElfW2(Bits,Addr))) }, \
- [SHT_FINI_ARRAY] = { ELF_T_ADDR, sizeof (ElfW2(Bits,Addr)) \
- AL (__alignof__ (ElfW2(Bits,Addr))) }, \
- [SHT_PREINIT_ARRAY] = { ELF_T_ADDR, sizeof (ElfW2(Bits,Addr)) \
- AL (__alignof__ (ElfW2(Bits,Addr))) }, \
- [SHT_GROUP] = { ELF_T_WORD, sizeof (Elf32_Word) \
- AL (__alignof__ (Elf32_Word)) }, \
- [SHT_SYMTAB_SHNDX] = { ELF_T_WORD, sizeof (Elf32_Word) \
- AL (__alignof__ (Elf32_Word)) }, \
- [TYPEIDX (SHT_GNU_verdef)] = { ELF_T_VDEF, 1 AL (1) }, \
- [TYPEIDX (SHT_GNU_verneed)] = { ELF_T_VNEED, \
- sizeof (ElfW2(Bits,Verneed)) \
- AL (__alignof__ (ElfW2(Bits,Verneed)))},\
- [TYPEIDX (SHT_GNU_versym)] = { ELF_T_HALF, sizeof (ElfW2(Bits,Versym)) \
- AL (__alignof__ (ElfW2(Bits,Versym))) }, \
- [TYPEIDX (SHT_SUNW_syminfo)] = { ELF_T_SYMINFO, \
- sizeof (ElfW2(Bits,Syminfo)) \
- AL(__alignof__ (ElfW2(Bits,Syminfo)))},\
- [TYPEIDX (SHT_SUNW_move)] = { ELF_T_MOVE, sizeof (ElfW2(Bits,Move)) \
- AL (__alignof__ (ElfW2(Bits,Move))) }, \
- [TYPEIDX (SHT_GNU_LIBLIST)] = { ELF_T_LIB, sizeof (ElfW2(Bits,Lib)) \
- AL (__alignof__ (ElfW2(Bits,Lib))) }
- DEFINE (32),
- [TYPEIDX (SHT_GNU_HASH)] = { ELF_T_WORD, sizeof (Elf32_Word)
- AL (__alignof__ (Elf32_Word)) }
- },
- [ELFCLASS64 - 1] =
+ [SHT_SYMTAB] = ELF_T_SYM,
+ [SHT_RELA] = ELF_T_RELA,
+ [SHT_HASH] = ELF_T_WORD,
+ [SHT_DYNAMIC] = ELF_T_DYN,
+ [SHT_REL] = ELF_T_REL,
+ [SHT_DYNSYM] = ELF_T_SYM,
+ [SHT_INIT_ARRAY] = ELF_T_ADDR,
+ [SHT_FINI_ARRAY] = ELF_T_ADDR,
+ [SHT_PREINIT_ARRAY] = ELF_T_ADDR,
+ [SHT_GROUP] = ELF_T_WORD,
+ [SHT_SYMTAB_SHNDX] = ELF_T_WORD,
+ [SHT_NOTE] = ELF_T_NHDR,
+ [TYPEIDX (SHT_GNU_verdef)] = ELF_T_VDEF,
+ [TYPEIDX (SHT_GNU_verneed)] = ELF_T_VNEED,
+ [TYPEIDX (SHT_GNU_versym)] = ELF_T_HALF,
+ [TYPEIDX (SHT_SUNW_syminfo)] = ELF_T_SYMINFO,
+ [TYPEIDX (SHT_SUNW_move)] = ELF_T_MOVE,
+ [TYPEIDX (SHT_GNU_LIBLIST)] = ELF_T_LIB,
+ [TYPEIDX (SHT_GNU_HASH)] = ELF_T_GNUHASH,
+ }
+ };
+
+#if !ALLOW_UNALIGNED
+/* Associate libelf types with their internal alignment requirements. */
+const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
+ {
+# define TYPE_ALIGNS(Bits) \
+ { \
+ [ELF_T_ADDR] = __alignof__ (ElfW2(Bits,Addr)), \
+ [ELF_T_HALF] = __alignof__ (ElfW2(Bits,Half)), \
+ [ELF_T_WORD] = __alignof__ (ElfW2(Bits,Word)), \
+ [ELF_T_SYM] = __alignof__ (ElfW2(Bits,Sym)), \
+ [ELF_T_SYMINFO] = __alignof__ (ElfW2(Bits,Syminfo)), \
+ [ELF_T_REL] = __alignof__ (ElfW2(Bits,Rel)), \
+ [ELF_T_RELA] = __alignof__ (ElfW2(Bits,Rela)), \
+ [ELF_T_DYN] = __alignof__ (ElfW2(Bits,Dyn)), \
+ [ELF_T_VDEF] = __alignof__ (ElfW2(Bits,Verdef)), \
+ [ELF_T_VDAUX] = __alignof__ (ElfW2(Bits,Verdaux)), \
+ [ELF_T_VNEED] = __alignof__ (ElfW2(Bits,Verneed)), \
+ [ELF_T_VNAUX] = __alignof__ (ElfW2(Bits,Vernaux)), \
+ [ELF_T_MOVE] = __alignof__ (ElfW2(Bits,Move)), \
+ [ELF_T_LIB] = __alignof__ (ElfW2(Bits,Lib)), \
+ [ELF_T_NHDR] = __alignof__ (ElfW2(Bits,Nhdr)), \
+ }
+ [EV_CURRENT - 1] =
{
- DEFINE (64),
- [TYPEIDX (SHT_GNU_HASH)] = { ELF_T_GNUHASH, 1
- AL (__alignof__ (Elf64_Xword)) }
+ [ELFCLASS32 - 1] = TYPE_ALIGNS (32),
+ [ELFCLASS64 - 1] = TYPE_ALIGNS (64),
}
- }
-};
+# undef TYPE_ALIGNS
+ };
+#endif
/* Convert the data in the current section. */
static void
convert_data (Elf_Scn *scn, int version __attribute__ ((unused)), int eclass,
- int data, size_t size, size_t type)
+ int data, size_t size, Elf_Type 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[version - 1][eclass - 1][type].align;
-# else
- size_t align = shtype_map[0][eclass - 1][type].align;
-# endif
-#endif
+ const size_t align = __libelf_type_align (eclass, type);
if (data == MY_ELFDATA)
{
- if (ALLOW_ALIGNED
- || (((size_t) ((char *) scn->rawdata_base)) & (align - 1)) == 0)
+ if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0)
/* No need to copy, we can use the raw data. */
scn->data_base = scn->rawdata_base;
else
@@ -266,11 +239,12 @@ __libelf_set_rawdata (Elf_Scn *scn)
}
else
{
-#if EV_NUM != 2
- entsize = shtype_map[__libelf_version - 1][elf->class - 1][TYPEIDX (type)].size;
-#else
- entsize = shtype_map[0][elf->class - 1][TYPEIDX (type)].size;
-#endif
+ Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (type)];
+ if (t == ELF_T_VDEF || t == ELF_T_NHDR
+ || (t == ELF_T_GNUHASH && elf->class == ELFCLASS64))
+ entsize = 1;
+ else
+ entsize = __libelf_type_sizes[LIBELF_EV_IDX][elf->class - 1][t];
}
/* We assume it is an array of bytes if it is none of the structured
@@ -343,15 +317,7 @@ __libelf_set_rawdata (Elf_Scn *scn)
? ELF_T_WORD : ELF_T_XWORD);
}
else
- {
-#if EV_NUM != 2
- scn->rawdata.d.d_type =
- shtype_map[__libelf_version - 1][elf->class - 1][TYPEIDX (type)].type;
-#else
- scn->rawdata.d.d_type =
- shtype_map[0][elf->class - 1][TYPEIDX (type)].type;
-#endif
- }
+ scn->rawdata.d.d_type = shtype_map[LIBELF_EV_IDX][TYPEIDX (type)];
scn->rawdata.d.d_off = 0;
scn->rawdata.d.d_align = align;
if (elf->class == ELFCLASS32
diff --git a/elfutils/libelf/elf_getdata_rawchunk.c b/elfutils/libelf/elf_getdata_rawchunk.c
new file mode 100644
index 00000000..bea0f3f6
--- /dev/null
+++ b/elfutils/libelf/elf_getdata_rawchunk.c
@@ -0,0 +1,188 @@
+/* Return converted data from raw chunk of ELF file.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <system.h>
+#include "libelfP.h"
+#include "common.h"
+
+Elf_Data *
+elf_getdata_rawchunk (elf, offset, size, type)
+ Elf *elf;
+ off64_t offset;
+ size_t size;
+ Elf_Type type;
+{
+ if (unlikely (elf == NULL))
+ return NULL;
+
+ if (unlikely (elf->kind != ELF_K_ELF))
+ {
+ /* No valid descriptor. */
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+ return NULL;
+ }
+
+ if (unlikely (size > elf->maximum_size
+ || (off64_t) (elf->maximum_size - size) < offset))
+ {
+ /* Invalid request. */
+ __libelf_seterrno (ELF_E_INVALID_OP);
+ return NULL;
+ }
+
+ if (type >= ELF_T_NUM)
+ {
+ __libelf_seterrno (ELF_E_UNKNOWN_TYPE);
+ return NULL;
+ }
+
+ /* Get the raw bytes from the file. */
+ void *rawchunk;
+ int flags = 0;
+
+ /* If the file is mmap'ed we can use it directly. */
+ if (elf->map_address != NULL)
+ rawchunk = elf->map_address + elf->start_offset + offset;
+ else
+ {
+ /* We allocate the memory and read the data from the file. */
+ rawchunk = malloc (size);
+ if (rawchunk == NULL)
+ {
+ nomem:
+ __libelf_seterrno (ELF_E_NOMEM);
+ return NULL;
+ }
+
+ /* Read the file content. */
+ if (unlikely ((size_t) pread_retry (elf->fildes, rawchunk, size,
+ elf->start_offset + offset)
+ != size))
+ {
+ /* Something went wrong. */
+ free (rawchunk);
+ __libelf_seterrno (ELF_E_READ_ERROR);
+ return NULL;
+ }
+
+ flags = ELF_F_MALLOCED;
+ }
+
+ /* Copy and/or convert the data as needed for aligned native-order access. */
+ size_t align = __libelf_type_align (elf->class, type);
+ void *buffer;
+ if (elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA)
+ {
+ if (((uintptr_t) rawchunk & (align - 1)) == 0)
+ /* No need to copy, we can use the raw data. */
+ buffer = rawchunk;
+ else
+ {
+ /* A malloc'd block is always sufficiently aligned. */
+ assert (flags == 0);
+
+ buffer = malloc (size);
+ if (unlikely (buffer == NULL))
+ goto nomem;
+ flags = ELF_F_MALLOCED;
+
+ /* The copy will be appropriately aligned for direct access. */
+ memcpy (buffer, rawchunk, size);
+ }
+ }
+ else
+ {
+ if (flags)
+ buffer = rawchunk;
+ else
+ {
+ buffer = malloc (size);
+ if (unlikely (buffer == NULL))
+ goto nomem;
+ flags = ELF_F_MALLOCED;
+ }
+
+ /* Call the conversion function. */
+ (*__elf_xfctstom[LIBELF_EV_IDX][LIBELF_EV_IDX][elf->class - 1][type])
+ (buffer, rawchunk, size, 0);
+ }
+
+ /* Allocate the dummy container to point at this buffer. */
+ Elf_Data_Chunk *chunk = calloc (1, sizeof *chunk);
+ if (chunk == NULL)
+ {
+ if (flags)
+ free (buffer);
+ goto nomem;
+ }
+
+ chunk->dummy_scn.elf = elf;
+ chunk->dummy_scn.flags = flags;
+ chunk->data.s = &chunk->dummy_scn;
+ chunk->data.d.d_buf = buffer;
+ chunk->data.d.d_size = size;
+ chunk->data.d.d_type = type;
+ chunk->data.d.d_align = align;
+ chunk->data.d.d_version = __libelf_version;
+
+ chunk->next = elf->state.elf.rawchunks;
+ elf->state.elf.rawchunks = chunk;
+
+ return &chunk->data.d;
+}
diff --git a/elfutils/libelf/exttypes.h b/elfutils/libelf/exttypes.h
index 1dff8ce3..3bb90c3a 100644
--- a/elfutils/libelf/exttypes.h
+++ b/elfutils/libelf/exttypes.h
@@ -1,5 +1,5 @@
/* External ELF types.
- Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -94,6 +94,7 @@ Verneed32 (Ext_);
Vernaux32 (Ext_);
Syminfo32 (Ext_);
Move32 (Ext_);
+auxv_t32 (Ext_);
Ehdr64 (Ext_);
Phdr64 (Ext_);
@@ -109,6 +110,7 @@ Verneed64 (Ext_);
Vernaux64 (Ext_);
Syminfo64 (Ext_);
Move64 (Ext_);
+auxv_t64 (Ext_);
#undef START
#undef END
diff --git a/elfutils/libelf/gelf.h b/elfutils/libelf/gelf.h
index 2ef256cc..533e15a9 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, 2005 Red Hat, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -327,11 +327,20 @@ extern int gelf_update_verdaux (Elf_Data *__data, int __offset,
GElf_Verdaux *__src);
-/* Retrieve uninterpreted chunk of the file contents. */
-extern char *gelf_rawchunk (Elf *__elf, GElf_Off __offset, GElf_Word __size);
+/* Get auxv entry at the given index. */
+extern GElf_auxv_t *gelf_getauxv (Elf_Data *__data, int __ndx,
+ GElf_auxv_t *__dst);
-/* Release uninterpreted chunk of the file contents. */
-extern void gelf_freechunk (Elf *__elf, char *__ptr);
+/* Update auxv entry at the given index. */
+extern int gelf_update_auxv (Elf_Data *__data, int __ndx, GElf_auxv_t *__src);
+
+
+/* Get note header at the given offset into the data, and the offsets of
+ the note's name and descriptor data. Returns the offset of the next
+ note header, or 0 for an invalid offset or corrupt note header. */
+extern size_t gelf_getnote (Elf_Data *__data, size_t __offset,
+ GElf_Nhdr *__result,
+ size_t *__name_offset, size_t *__desc_offset);
/* Compute simple checksum from permanent parts of the ELF file. */
diff --git a/elfutils/libelf/gelf_fsize.c b/elfutils/libelf/gelf_fsize.c
index a8c368c3..98197e0f 100644
--- a/elfutils/libelf/gelf_fsize.c
+++ b/elfutils/libelf/gelf_fsize.c
@@ -1,5 +1,5 @@
/* Return the size of an object file type.
- Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -86,7 +86,8 @@ const size_t __libelf_type_sizes[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
[ELF_T_VNAUX] = sizeof (ElfW2(LIBELFBITS, Ext_Vernaux)), \
[ELF_T_NHDR] = sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)), \
[ELF_T_SYMINFO] = sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)), \
- [ELF_T_MOVE] = sizeof (ElfW2(LIBELFBITS, Ext_Move))
+ [ELF_T_MOVE] = sizeof (ElfW2(LIBELFBITS, Ext_Move)), \
+ [ELF_T_AUXV] = sizeof (ElfW2(LIBELFBITS, Ext_auxv_t))
TYPE_SIZES (32)
},
[ELFCLASS64 - 1] = {
diff --git a/elfutils/libelf/gelf_getauxv.c b/elfutils/libelf/gelf_getauxv.c
new file mode 100644
index 00000000..036bdccf
--- /dev/null
+++ b/elfutils/libelf/gelf_getauxv.c
@@ -0,0 +1,130 @@
+/* Get information from auxiliary vector at the given index.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <gelf.h>
+#include <string.h>
+
+#include "libelfP.h"
+
+
+GElf_auxv_t *
+gelf_getauxv (data, ndx, dst)
+ Elf_Data *data;
+ int ndx;
+ GElf_auxv_t *dst;
+{
+ Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
+ GElf_auxv_t *result = NULL;
+ Elf *elf;
+
+ if (data_scn == NULL)
+ return NULL;
+
+ if (unlikely (data_scn->d.d_type != ELF_T_AUXV))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+ return NULL;
+ }
+
+ elf = data_scn->s->elf;
+
+ rwlock_rdlock (elf->lock);
+
+ /* This is the one place where we have to take advantage of the fact
+ that an `Elf_Data' pointer is also a pointer to `Elf_Data_Scn'.
+ The interface is broken so that it requires this hack. */
+ if (elf->class == ELFCLASS32)
+ {
+ Elf32_auxv_t *src;
+
+ /* Here it gets a bit more complicated. The format of the vector
+ entries has to be converted. The user better have provided a
+ buffer where we can store the information. While copying the data
+ we convert the format. */
+ if (unlikely ((ndx + 1) * sizeof (Elf32_auxv_t) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+ }
+
+ src = &((Elf32_auxv_t *) data_scn->d.d_buf)[ndx];
+
+ /* This might look like a simple copy operation but it's
+ not. There are zero- and sign-extensions going on. */
+ dst->a_type = src->a_type;
+ dst->a_un.a_val = src->a_un.a_val;
+ }
+ else
+ {
+ /* If this is a 64 bit object it's easy. */
+ assert (sizeof (GElf_auxv_t) == sizeof (Elf64_auxv_t));
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+ if (unlikely ((ndx + 1) * sizeof (GElf_auxv_t) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+ }
+
+ *dst = ((GElf_auxv_t *) data_scn->d.d_buf)[ndx];
+ }
+
+ result = dst;
+
+ out:
+ rwlock_unlock (elf->lock);
+
+ return result;
+}
diff --git a/elfutils/libelf/gelf_getnote.c b/elfutils/libelf/gelf_getnote.c
new file mode 100644
index 00000000..e4900185
--- /dev/null
+++ b/elfutils/libelf/gelf_getnote.c
@@ -0,0 +1,119 @@
+/* Get note information at the supplied offset.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <gelf.h>
+#include <string.h>
+
+#include "libelfP.h"
+
+size_t
+gelf_getnote (data, offset, result, name_offset, desc_offset)
+ Elf_Data *data;
+ size_t offset;
+ GElf_Nhdr *result;
+ size_t *name_offset;
+ size_t *desc_offset;
+{
+ if (data == NULL)
+ return 0;
+
+ if (unlikely (data->d_type != ELF_T_NHDR))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+ return 0;
+ }
+
+ /* It's easy to handle this type. It has the same size for 32 and
+ 64 bit objects. */
+ assert (sizeof (GElf_Nhdr) == sizeof (Elf32_Nhdr));
+ assert (sizeof (GElf_Nhdr) == sizeof (Elf64_Nhdr));
+
+ rwlock_rdlock (((Elf_Data_Scn *) data)->s->elf->lock);
+
+ /* The data is already in the correct form. Just make sure the
+ offset is OK. */
+ if (unlikely (offset + sizeof (GElf_Nhdr) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_OFFSET_RANGE);
+ offset = 0;
+ }
+ else
+ {
+ const GElf_Nhdr *n = data->d_buf + offset;
+ offset += sizeof *n;
+
+ GElf_Word namesz = NOTE_ALIGN (n->n_namesz);
+ GElf_Word descsz = NOTE_ALIGN (n->n_descsz);
+
+ if (unlikely (data->d_size - offset < namesz))
+ offset = 0;
+ else
+ {
+ *name_offset = offset;
+ offset += namesz;
+ if (unlikely (data->d_size - offset < descsz))
+ offset = 0;
+ else
+ {
+ *desc_offset = offset;
+ offset += descsz;
+ *result = *n;
+ }
+ }
+ }
+
+ rwlock_unlock (((Elf_Data_Scn *) data)->s->elf->lock);
+
+ return offset;
+}
diff --git a/elfutils/libelf/gelf_update_auxv.c b/elfutils/libelf/gelf_update_auxv.c
new file mode 100644
index 00000000..b294ead7
--- /dev/null
+++ b/elfutils/libelf/gelf_update_auxv.c
@@ -0,0 +1,135 @@
+/* Update information in dynamic table at the given index.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gelf.h>
+#include <string.h>
+
+#include "libelfP.h"
+
+
+int
+gelf_update_auxv (data, ndx, src)
+ Elf_Data *data;
+ int ndx;
+ GElf_auxv_t *src;
+{
+ Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
+ Elf_Scn *scn;
+ int result = 0;
+
+ if (data == NULL)
+ return 0;
+
+ if (unlikely (ndx < 0))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ return 0;
+ }
+
+ if (unlikely (data_scn->d.d_type != ELF_T_AUXV))
+ {
+ /* The type of the data better should match. */
+ __libelf_seterrno (ELF_E_DATA_MISMATCH);
+ return 0;
+ }
+
+ scn = data_scn->s;
+ rwlock_wrlock (scn->elf->lock);
+
+ if (scn->elf->class == ELFCLASS32)
+ {
+ Elf32_auxv_t *auxv;
+
+ /* There is the possibility that the values in the input are
+ too large. */
+ if (unlikely (src->a_type > 0xffffffffll)
+ || unlikely (src->a_un.a_val > 0xffffffffull))
+ {
+ __libelf_seterrno (ELF_E_INVALID_DATA);
+ goto out;
+ }
+
+ /* Check whether we have to resize the data buffer. */
+ if (unlikely ((ndx + 1) * sizeof (Elf32_auxv_t) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+ }
+
+ auxv = &((Elf32_auxv_t *) data_scn->d.d_buf)[ndx];
+
+ auxv->a_type = src->a_type;
+ auxv->a_un.a_val = src->a_un.a_val;
+ }
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+ if (unlikely ((ndx + 1) * sizeof (Elf64_auxv_t) > data_scn->d.d_size))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+ }
+
+ ((Elf64_auxv_t *) data_scn->d.d_buf)[ndx] = *src;
+ }
+
+ result = 1;
+
+ /* Mark the section as modified. */
+ scn->flags |= ELF_F_DIRTY;
+
+ out:
+ rwlock_unlock (scn->elf->lock);
+
+ return result;
+}
diff --git a/elfutils/libelf/gelf_xlate.c b/elfutils/libelf/gelf_xlate.c
index f1bbdf3a..a4134c30 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, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 1998,1999,2000,2002,2004,2005,2006,2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -185,6 +185,7 @@ union unaligned
do not contain records of only one type. */
#include "version_xlate.h"
#include "gnuhash_xlate.h"
+#include "note_xlate.h"
/* Now the externally visible table with the function pointers. */
@@ -213,10 +214,11 @@ const xfct_t __elf_xfctstom[EV_NUM - 1][EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM]
[ELF_T_VDAUX] = elf_cvt_Verdef, \
[ELF_T_VNEED] = elf_cvt_Verneed, \
[ELF_T_VNAUX] = elf_cvt_Verneed, \
- [ELF_T_NHDR] = ElfW2(Bits, cvt_Nhdr), \
+ [ELF_T_NHDR] = elf_cvt_note, \
[ELF_T_SYMINFO] = ElfW2(Bits, cvt_Syminfo), \
[ELF_T_MOVE] = ElfW2(Bits, cvt_Move), \
- [ELF_T_LIB] = ElfW2(Bits, cvt_Lib)
+ [ELF_T_LIB] = ElfW2(Bits, cvt_Lib), \
+ [ELF_T_AUXV] = ElfW2(Bits, cvt_auxv_t)
define_xfcts (32),
[ELF_T_GNUHASH] = Elf32_cvt_Word
},
diff --git a/elfutils/libelf/gelf_xlate.h b/elfutils/libelf/gelf_xlate.h
index eec47ee6..e7659f12 100644
--- a/elfutils/libelf/gelf_xlate.h
+++ b/elfutils/libelf/gelf_xlate.h
@@ -1,5 +1,5 @@
/* Helper file for type conversion function generation.
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -70,6 +70,7 @@ TYPE (Dyn, LIBELFBITS)
TYPE (Syminfo, LIBELFBITS)
TYPE (Move, LIBELFBITS)
TYPE (Lib, LIBELFBITS)
+TYPE (auxv_t, LIBELFBITS)
/* Prepare for the next round. */
diff --git a/elfutils/libelf/libelf.h b/elfutils/libelf/libelf.h
index 2f58e4c4..8f2f53b3 100644
--- a/elfutils/libelf/libelf.h
+++ b/elfutils/libelf/libelf.h
@@ -1,5 +1,5 @@
/* Interface for libelf.
- Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -83,6 +83,7 @@ typedef enum
ELF_T_MOVE, /* Elf32_Move, Elf64_Move, ... */
ELF_T_LIB, /* Elf32_Lib, Elf64_Lib, ... */
ELF_T_GNUHASH, /* GNU-style hash section. */
+ ELF_T_AUXV, /* Elf32_auxv_t, Elf64_auxv_t, ... */
/* Keep this the last entry. */
ELF_T_NUM
} Elf_Type;
@@ -94,7 +95,7 @@ typedef struct
Elf_Type d_type; /* Type of this piece of data. */
unsigned int d_version; /* ELF version. */
size_t d_size; /* Size in bytes. */
- off_t d_off; /* Offset into section. */
+ off64_t d_off; /* Offset into section. */
size_t d_align; /* Alignment in section. */
} Elf_Data;
@@ -156,7 +157,7 @@ typedef struct
uid_t ar_uid; /* User ID. */
gid_t ar_gid; /* Group ID. */
mode_t ar_mode; /* File mode. */
- off_t ar_size; /* File size. */
+ off64_t ar_size; /* File size. */
char *ar_rawname; /* Original name of archive member. */
} Elf_Arhdr;
@@ -197,13 +198,13 @@ extern Elf_Cmd elf_next (Elf *__elf);
extern int elf_end (Elf *__elf);
/* Update ELF descriptor and write file to disk. */
-extern off_t elf_update (Elf *__elf, Elf_Cmd __cmd);
+extern off64_t elf_update (Elf *__elf, Elf_Cmd __cmd);
/* Determine what kind of file is associated with ELF. */
extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
/* Get the base offset for an object file. */
-extern off_t elf_getbase (Elf *__elf);
+extern off64_t elf_getbase (Elf *__elf);
/* Retrieve file identification data. */
@@ -297,6 +298,13 @@ extern Elf_Data *elf_rawdata (Elf_Scn *__scn, Elf_Data *__data);
/* Create new data descriptor for section SCN. */
extern Elf_Data *elf_newdata (Elf_Scn *__scn);
+/* Get data translated from a chunk of the file contents as section data
+ would be for TYPE. The resulting Elf_Data pointer is valid until
+ elf_end (ELF) is called. */
+extern Elf_Data *elf_getdata_rawchunk (Elf *__elf,
+ off64_t __offset, size_t __size,
+ Elf_Type __type);
+
/* Return pointer to string at OFFSET in section INDEX. */
extern char *elf_strptr (Elf *__elf, size_t __index, size_t __offset);
@@ -306,7 +314,7 @@ extern char *elf_strptr (Elf *__elf, size_t __index, size_t __offset);
extern Elf_Arhdr *elf_getarhdr (Elf *__elf);
/* Return offset in archive for current file ELF. */
-extern off_t elf_getaroff (Elf *__elf);
+extern off64_t elf_getaroff (Elf *__elf);
/* Select archive element at OFFSET. */
extern size_t elf_rand (Elf *__elf, size_t __offset);
diff --git a/elfutils/libelf/libelf.map b/elfutils/libelf/libelf.map
index 9549c317..aaaf9164 100644
--- a/elfutils/libelf/libelf.map
+++ b/elfutils/libelf/libelf.map
@@ -55,7 +55,6 @@ ELFUTILS_1.0 {
elf_update;
elf_version;
gelf_checksum;
- gelf_freechunk;
gelf_fsize;
gelf_getclass;
gelf_getdyn;
@@ -75,7 +74,6 @@ ELFUTILS_1.0 {
gelf_getversym;
gelf_newehdr;
gelf_newphdr;
- gelf_rawchunk;
gelf_update_dyn;
gelf_update_ehdr;
gelf_update_move;
@@ -117,3 +115,11 @@ ELFUTILS_1.2 {
global:
elf_gnu_hash;
} ELFUTILS_1.1.1;
+
+ELFUTILS_1.3 {
+ global:
+ elf_getdata_rawchunk;
+ gelf_getauxv;
+ gelf_update_auxv;
+ gelf_getnote;
+};
diff --git a/elfutils/libelf/libelfP.h b/elfutils/libelf/libelfP.h
index 54158aeb..7e6305cd 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, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 1998,1999,2000,2001,2002,2003,2005,2006,2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -255,6 +255,18 @@ typedef struct Elf_ScnList
} Elf_ScnList;
+/* elf_getdata_rawchunk result. */
+typedef struct Elf_Data_Chunk
+{
+ Elf_Data_Scn data;
+ union
+ {
+ Elf_Scn dummy_scn;
+ struct Elf_Data_Chunk *next;
+ };
+} Elf_Data_Chunk;
+
+
/* The ELF descriptor. */
struct Elf
{
@@ -313,6 +325,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
+ Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
off64_t sizestr_offset; /* Offset of the size string in the parent
@@ -332,6 +345,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
+ Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
off64_t sizestr_offset; /* Offset of the size string in the parent
@@ -357,6 +371,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
+ Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
off64_t sizestr_offset; /* Offset of the size string in the parent
@@ -423,6 +438,22 @@ extern int __libelf_fill_byte attribute_hidden;
/* Nonzero if the version was set. */
extern int __libelf_version_initialized attribute_hidden;
+/* Index for __libelf_type_sizes et al. */
+#if EV_NUM == 2
+# define LIBELF_EV_IDX 0
+#else
+# define LIBELF_EV_IDX (__libelf_version - 1)
+#endif
+
+#if !ALLOW_UNALIGNED
+/* Array with alignment requirements of the internal types indexed by ELF
+ version, binary class, and type. */
+extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
+# define __libelf_type_align(class, type) \
+ (__libelf_type_aligns[LIBELF_EV_IDX][class][type] ?: 1)
+#else
+# define __libelf_type_align(class, type) 1
+#endif
/* The libelf API does not have such a function but it is still useful.
Get the memory size for the given type.
@@ -558,4 +589,7 @@ extern uint32_t __libelf_crc32 (uint32_t crc, unsigned char *buf, size_t len)
} \
} while (0)
+/* Align offset to 4 bytes as needed for note name and descriptor data. */
+#define NOTE_ALIGN(n) (((n) + 3) & -4U)
+
#endif /* libelfP.h */
diff --git a/elfutils/libelf/note_xlate.h b/elfutils/libelf/note_xlate.h
new file mode 100644
index 00000000..6e8b78c6
--- /dev/null
+++ b/elfutils/libelf/note_xlate.h
@@ -0,0 +1,80 @@
+/* Conversion functions for notes.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+static void
+elf_cvt_note (void *dest, const void *src, size_t len, int encode)
+{
+ assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
+
+ while (len > 0)
+ {
+ (1 ? Elf32_cvt_Nhdr : Elf64_cvt_Nhdr) (dest, src, sizeof (Elf32_Nhdr),
+ encode);
+ const Elf32_Nhdr *n = encode ? src : dest;
+ Elf32_Word namesz = NOTE_ALIGN (n->n_namesz);
+ Elf32_Word descsz = NOTE_ALIGN (n->n_descsz);
+
+ len -= sizeof *n;
+ src += sizeof *n;
+ dest += sizeof *n;
+
+ if (namesz > len)
+ break;
+ len -= namesz;
+ if (descsz > len)
+ break;
+ len -= descsz;
+
+ if (src != dest)
+ memcpy (dest, src, namesz + descsz);
+
+ src += namesz + descsz;
+ dest += namesz + descsz;
+ }
+}
diff --git a/elfutils/m4/ChangeLog b/elfutils/m4/ChangeLog
index 112c9c7b..e285a0e4 100644
--- a/elfutils/m4/ChangeLog
+++ b/elfutils/m4/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-05 Ulrich Drepper <drepper@redhat.com>
+
+ * gettext.m4: Update from gettext 0.16.1.
+ * iconv.m4: Likewise.
+ * progtest.m4: Likewise.
+ * nls.m4: New file.
+ * po.m4: New file.
+
2005-02-15 Ulrich Drepper <drepper@redhat.com>
* Makefile.am (EXTRA_DIST): Remove glibc21.m4, intdiv0.m4,
diff --git a/elfutils/m4/Makefile.in b/elfutils/m4/Makefile.in
index 80edb286..0cb68efa 100644
--- a/elfutils/m4/Makefile.in
+++ b/elfutils/m4/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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.
@@ -13,15 +13,11 @@
# 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
@@ -38,26 +34,22 @@ host_triplet = @host@
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -70,13 +62,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -91,19 +79,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -115,20 +96,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -141,28 +120,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
EXTRA_DIST = codeset.m4 gettext.m4 iconv.m4 lcmessage.m4 progtest.m4
all: all-am
@@ -196,7 +186,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
tags: TAGS
TAGS:
@@ -205,22 +194,21 @@ 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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -279,12 +267,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -303,16 +299,19 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.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 install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
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
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
# 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.
diff --git a/elfutils/m4/gettext.m4 b/elfutils/m4/gettext.m4
index 0b758a67..91c345e9 100644
--- a/elfutils/m4/gettext.m4
+++ b/elfutils/m4/gettext.m4
@@ -1,10 +1,8 @@
-# gettext.m4 serial 16 (gettext-0.11.4)
-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.
+# gettext.m4 serial 59 (gettext-0.16.1)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
@@ -17,7 +15,7 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
dnl Macro to add for using GNU gettext.
@@ -65,8 +63,13 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
- define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
- define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
AC_REQUIRE([AM_PO_SUBDIRS])dnl
ifelse(gt_included_intl, yes, [
@@ -80,7 +83,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl Sometimes libintl requires libiconv, so first search for libiconv.
dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then
- dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions:
@@ -92,13 +95,11 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
- AC_MSG_CHECKING([whether NLS is requested])
- dnl Default is enabled NLS
- AC_ARG_ENABLE(nls,
- [ --disable-nls do not use Native Language Support],
- USE_NLS=$enableval, USE_NLS=yes)
- AC_MSG_RESULT($USE_NLS)
- AC_SUBST(USE_NLS)
+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
ifelse(gt_included_intl, yes, [
BUILD_INCLUDED_LIBINTL=no
@@ -108,6 +109,15 @@ AC_DEFUN([AM_GNU_GETTEXT],
LTLIBINTL=
POSUB=
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
@@ -126,28 +136,35 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
- dnl Add a version number to the cache macros.
- define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
- define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
- define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
-
- AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
- [AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
- gt_cv_func_gnugettext_libc=yes,
- gt_cv_func_gnugettext_libc=no)])
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
- if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
ifelse(gt_included_intl, yes, , [
AM_ICONV_LINK
@@ -158,52 +175,40 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
dnl even if libiconv doesn't exist.
AC_LIB_LINKFLAGS_BODY([intl])
AC_CACHE_CHECK([for GNU gettext in libintl],
- gt_cv_func_gnugettext_libintl,
+ [$gt_func_gnugettext_libintl],
[gt_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $INCINTL"
gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
-const char *_nl_expand_alias ();],
+const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
- gt_cv_func_gnugettext_libintl=yes,
- gt_cv_func_gnugettext_libintl=no)
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
dnl Now see whether libintl exists and depends on libiconv.
- if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
-const char *_nl_expand_alias ();],
+const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
[LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
- gt_cv_func_gnugettext_libintl=yes
+ eval "$gt_func_gnugettext_libintl=yes"
])
fi
CPPFLAGS="$gt_save_CPPFLAGS"
@@ -214,9 +219,10 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
- if test "$gt_cv_func_gnugettext_libc" = "yes" \
- || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
- && test "$PACKAGE" != gettext; }; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
gt_use_preinstalled_gnugettext=yes
else
dnl Reset the values set by searching for libintl.
@@ -235,14 +241,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
- INTLOBJS="\$(GETTOBJS)"
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
- LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
- LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
+ CATOBJEXT=
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions to use GNU gettext tools.
@@ -250,6 +256,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
fi
])
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
@@ -260,10 +275,26 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
fi
fi
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
if test "$USE_NLS" = "yes"; then
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
AC_MSG_CHECKING([how to link with libintl])
AC_MSG_RESULT([$LIBINTL])
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
@@ -283,7 +314,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
ifelse(gt_included_intl, yes, [
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it.
- if test "$PACKAGE" = gettext; then
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
BUILD_INCLUDED_LIBINTL=yes
fi
@@ -291,7 +322,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATOBJEXT)
- AC_SUBST(INTLOBJS)
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
@@ -309,6 +339,13 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
GENCAT=gencat
AC_SUBST(GENCAT)
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLOBJS=
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+ AC_SUBST(INTLOBJS)
+
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
@@ -325,261 +362,56 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
])
-dnl Checks for all prerequisites of the po subdirectory,
-dnl except for USE_NLS.
-AC_DEFUN([AM_PO_SUBDIRS],
+dnl Checks for special options needed on MacOS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
[
- AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_MKINSTALLDIRS])dnl
-
- dnl Perform the following tests also if --disable-nls has been given,
- dnl because they are needed for "make dist" to work.
-
- dnl Search for GNU msgfmt in the PATH.
- dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
- dnl The second test excludes FreeBSD msgfmt.
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [$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)],
- :)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-
- dnl Search for GNU xgettext 0.11 or newer in the PATH.
- dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
- dnl The second test excludes FreeBSD xgettext.
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [$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)],
- :)
- dnl Remove leftover from FreeBSD xgettext call.
- rm -f messages.po
-
- dnl Search for GNU msgmerge 0.11 or newer in the PATH.
- AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
- [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
-
- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
- dnl Test whether we really found GNU msgfmt.
- if test "$GMSGFMT" != ":"; then
- dnl If it is no GNU msgfmt we define it as : so that the
- dnl Makefiles still can work.
- 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,^.*/,,'`
- AC_MSG_RESULT(
- [found $GMSGFMT program is not GNU msgfmt; ignore it])
- GMSGFMT=":"
- fi
+ dnl Check for API introduced in MacOS X 10.2.
+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+ gt_cv_func_CFPreferencesCopyAppValue,
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
+ [CFPreferencesCopyAppValue(NULL, NULL)],
+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
+ [gt_cv_func_CFPreferencesCopyAppValue=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
+ [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
-
- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
- dnl Test whether we really found GNU xgettext.
- if test "$XGETTEXT" != ":"; then
- dnl If it is no GNU xgettext we define it as : so that the
- dnl Makefiles still can work.
- 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
- AC_MSG_RESULT(
- [found xgettext program is not GNU xgettext; ignore it])
- XGETTEXT=":"
- fi
- dnl Remove leftover from FreeBSD xgettext call.
- rm -f messages.po
+ dnl Check for API introduced in MacOS X 10.3.
+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
+ [gt_cv_func_CFLocaleCopyCurrent=yes],
+ [gt_cv_func_CFLocaleCopyCurrent=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
+ [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fi
-
- AC_OUTPUT_COMMANDS([
- for ac_file in $CONFIG_FILES; do
- # Support "outfile[:infile[:infile...]]"
- case "$ac_file" in
- *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- esac
- # PO directories have a Makefile.in generated from Makefile.in.in.
- case "$ac_file" in */Makefile.in)
- # Adjust a relative srcdir.
- ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
- ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
- # In autoconf-2.13 it is called $ac_given_srcdir.
- # In autoconf-2.50 it is called $srcdir.
- test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
- case "$ac_given_srcdir" in
- .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
- /*) top_srcdir="$ac_given_srcdir" ;;
- *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
- if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
- rm -f "$ac_dir/POTFILES"
- test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
- cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
- # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
- # on $ac_dir but don't depend on user-specified configuration
- # parameters.
- if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
- # The LINGUAS file contains the set of available languages.
- if test -n "$ALL_LINGUAS"; then
- test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
- fi
- ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
- # Hide the ALL_LINGUAS assigment from automake.
- eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
- fi
- case "$ac_given_srcdir" in
- .) srcdirpre= ;;
- *) srcdirpre='$(srcdir)/' ;;
- esac
- POFILES=
- GMOFILES=
- UPDATEPOFILES=
- DUMMYPOFILES=
- for lang in $ALL_LINGUAS; do
- POFILES="$POFILES $srcdirpre$lang.po"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
- DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
- done
- # CATALOGS depends on both $ac_dir and the user's LINGUAS
- # environment variable.
- INST_LINGUAS=
- if test -n "$ALL_LINGUAS"; then
- for presentlang in $ALL_LINGUAS; do
- useit=no
- if test "%UNSET%" != "$LINGUAS"; then
- desiredlanguages="$LINGUAS"
- else
- desiredlanguages="$ALL_LINGUAS"
- fi
- for desiredlang in $desiredlanguages; do
- # Use the presentlang catalog if desiredlang is
- # a. equal to presentlang, or
- # b. a variant of presentlang (because in this case,
- # presentlang can be used as a fallback for messages
- # which are not translated in the desiredlang catalog).
- case "$desiredlang" in
- "$presentlang"*) useit=yes;;
- esac
- done
- if test $useit = yes; then
- INST_LINGUAS="$INST_LINGUAS $presentlang"
- fi
- done
- fi
- CATALOGS=
- if test -n "$INST_LINGUAS"; then
- for lang in $INST_LINGUAS; do
- CATALOGS="$CATALOGS $lang.gmo"
- done
- fi
- test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
- for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
- if test -f "$f"; then
- case "$f" in
- *.orig | *.bak | *~) ;;
- *) cat "$f" >> "$ac_dir/Makefile" ;;
- esac
- fi
- done
- fi
- ;;
- esac
- done],
- [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
- # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
- # from automake.
- eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
- # Capture the value of LINGUAS because we need it to compute CATALOGS.
- LINGUAS="${LINGUAS-%UNSET%}"
- ])
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+ AC_SUBST([INTL_MACOSX_LIBS])
])
-dnl Checks for all prerequisites of the intl subdirectory,
-dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
-dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
-AC_DEFUN([AM_INTL_SUBDIR],
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
[
- AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_MKINSTALLDIRS])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])dnl
- AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_OFF_T])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
- AC_REQUIRE([jm_GLIBC21])dnl
- AC_REQUIRE([gt_INTDIV0])dnl
- AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
- AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
- AC_REQUIRE([gt_INTTYPES_PRI])dnl
-
- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
- AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
-geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
-strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
-
- AM_ICONV
- AM_LANGINFO_CODESET
- if test $ac_cv_header_locale_h = yes; then
- AM_LC_MESSAGES
- fi
-
- dnl intl/plural.c is generated from intl/plural.y. It requires bison,
- dnl because plural.y uses bison specific features. It requires at least
- dnl bison-1.26 because earlier versions generate a plural.c that doesn't
- dnl compile.
- dnl bison is only needed for the maintainer (who touches plural.y). But in
- dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
- dnl the rule in general Makefile. Now, some people carelessly touch the
- dnl files or have a broken "make" program, hence the plural.c rule will
- dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
- dnl present or too old.
- AC_CHECK_PROGS([INTLBISON], [bison])
- if test -z "$INTLBISON"; then
- ac_verc_fail=yes
- else
- dnl Found it, now check the version.
- AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
- ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- esac
- AC_MSG_RESULT([$ac_prog_version])
- fi
- if test $ac_verc_fail = yes; then
- INTLBISON=:
- fi
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
])
-AC_DEFUN([AM_MKINSTALLDIRS],
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
[
- dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
- dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
- dnl Try to locate is.
- MKINSTALLDIRS=
- if test -n "$ac_aux_dir"; then
- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
- fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
- fi
- AC_SUBST(MKINSTALLDIRS)
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
])
diff --git a/elfutils/m4/iconv.m4 b/elfutils/m4/iconv.m4
index c5f35798..654c4158 100644
--- a/elfutils/m4/iconv.m4
+++ b/elfutils/m4/iconv.m4
@@ -1,10 +1,8 @@
# iconv.m4 serial AM4 (gettext-0.11.3)
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.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
diff --git a/elfutils/m4/nls.m4 b/elfutils/m4/nls.m4
new file mode 100644
index 00000000..7967cc2f
--- /dev/null
+++ b/elfutils/m4/nls.m4
@@ -0,0 +1,31 @@
+# nls.m4 serial 3 (gettext-0.15)
+dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+])
diff --git a/elfutils/m4/po.m4 b/elfutils/m4/po.m4
new file mode 100644
index 00000000..00133ef3
--- /dev/null
+++ b/elfutils/m4/po.m4
@@ -0,0 +1,428 @@
+# po.m4 serial 13 (gettext-0.15)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 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)],
+ :)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[ ]*VARIABLE[ ]*=/{
+ # Seen the first line of the variable definition.
+ s/^[ ]*VARIABLE[ ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
diff --git a/elfutils/m4/progtest.m4 b/elfutils/m4/progtest.m4
index 443c8e30..a56365cd 100644
--- a/elfutils/m4/progtest.m4
+++ b/elfutils/m4/progtest.m4
@@ -1,10 +1,8 @@
-# progtest.m4 serial 2 (gettext-0.10.40)
-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.
+# progtest.m4 serial 4 (gettext-0.14.2)
+dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
@@ -18,36 +16,71 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
+AC_PREREQ(2.50)
+
# Search path for a program which passes the given test.
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
-[# Extract the first word of "$2", so it can be a program name with args.
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
- ;;
+ ;;
esac])dnl
$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
diff --git a/elfutils/po/ChangeLog b/elfutils/po/ChangeLog
index a4534c79..bbb72fad 100644
--- a/elfutils/po/ChangeLog
+++ b/elfutils/po/ChangeLog
@@ -1,3 +1,18 @@
+2007-06-05 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.in.in: Update from gettext 0.16.1.
+ * Rules-quot: Likewise.
+ * Makevars: Add more XGGETEXT_OPTIONS.
+
+ * remove-potcdata.sin: New file.
+
+ * POTFILES.in: Also include messages from libelf.
+
+2007-04-18 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.in.in: Remove MKINSTALLDIRS.
+ Define mkinstalldirs to mkdir -p.
+
2006-04-04 Roland McGrath <roland@redhat.com>
* POTFILES.in: Comment out lib/xstrdup.c, not distributed any more.
diff --git a/elfutils/po/Makefile.in.in b/elfutils/po/Makefile.in.in
index 0110ffbd..5022b8b1 100644
--- a/elfutils/po/Makefile.in.in
+++ b/elfutils/po/Makefile.in.in
@@ -1,5 +1,5 @@
# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU General Public
@@ -7,9 +7,12 @@
# functionality.
# Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.16
PACKAGE = @PACKAGE@
VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
SHELL = /bin/sh
@SET_MAKE@
@@ -20,19 +23,38 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
datadir = @datadir@
-localedir = $(datadir)/locale
+localedir = @localedir@
gettextsrcdir = $(datadir)/gettext/po
-top_builddir = ..
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
MSGMERGE = msgmerge
MSGMERGE_UPDATE = @MSGMERGE@ --update
MSGINIT = msginit
@@ -43,9 +65,9 @@ POFILES = @POFILES@
GMOFILES = @GMOFILES@
UPDATEPOFILES = @UPDATEPOFILES@
DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in Makevars \
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
-DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
$(POFILES) $(GMOFILES) \
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
@@ -55,70 +77,127 @@ CATALOGS = @CATALOGS@
# Makevars gets inserted here. (Don't remove this line!)
-XGETTEXT_OPTIONS += --flag=error:3:c-format --flag=ERROR:1:c-format
-
.SUFFIXES:
-.SUFFIXES: .po .gmo .mo .nop .po-update
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
.po.mo:
- $(MSGFMT) -c -o $@ $<
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
.po.gmo:
@lang=`echo $* | sed -e 's,.*/,,'`; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
all: all-@USE_NLS@
-all-yes: $(CATALOGS)
+all-yes: stamp-po
all-no:
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
# otherwise packages like GCC can not be built if only parts of the source
# have been downloaded.
-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
--files-from=$(srcdir)/POTFILES.in \
--copyright-holder='$(COPYRIGHT_HOLDER)' \
- && test ! -f $(DOMAIN).po \
- || ( rm -f $(srcdir)/$(DOMAIN).pot \
- && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
+ --msgid-bugs-address="$$msgid_bugs_address"
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
$(srcdir)/$(DOMAIN).pot:
$(MAKE) $(DOMAIN).pot-update
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
$(POFILES): $(srcdir)/$(DOMAIN).pot
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
- test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
- cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
install: install-exec install-data
install-exec:
install-data: install-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
- for file in $(DISTFILES.common); do \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
$(INSTALL_DATA) $(srcdir)/$$file \
$(DESTDIR)$(gettextsrcdir)/$$file; \
done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
else \
: ; \
fi
install-data-no: all
install-data-yes: all
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
@@ -157,20 +236,20 @@ install-strip: install
installdirs: installdirs-exec installdirs-data
installdirs-exec:
installdirs-data: installdirs-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
else \
: ; \
fi
installdirs-data-no:
installdirs-data-yes:
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
if test -n "$$lc"; then \
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
@@ -202,8 +281,8 @@ installcheck:
uninstall: uninstall-exec uninstall-data
uninstall-exec:
uninstall-data: uninstall-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- for file in $(DISTFILES.common); do \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
done; \
else \
@@ -222,10 +301,12 @@ uninstall-data-yes:
check: all
-dvi info tags TAGS ID:
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
mostlyclean:
- rm -f core core.* $(DOMAIN).po *.new.po
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
rm -fr *.o
clean: mostlyclean
@@ -236,35 +317,55 @@ distclean: clean
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
+ rm -f stamp-po $(GMOFILES)
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir:
$(MAKE) update-po
@$(MAKE) dist2
# This is a separate target because 'update-po' must be executed before.
-dist2: $(DISTFILES)
+dist2: stamp-po $(DISTFILES)
dists="$(DISTFILES)"; \
- if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
for file in $$dists; do \
if test -f $$file; then \
- cp -p $$file $(distdir); \
+ cp -p $$file $(distdir) || exit 1; \
else \
- cp -p $(srcdir)/$$file $(distdir); \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
fi; \
done
update-po: Makefile
$(MAKE) $(DOMAIN).pot-update
- $(MAKE) $(UPDATEPOFILES)
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
$(MAKE) update-gmo
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
# General rule for updating PO files.
.nop.po-update:
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
tmpdir=`pwd`; \
echo "$$lang:"; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
@@ -291,10 +392,9 @@ $(DUMMYPOFILES):
update-gmo: Makefile $(GMOFILES)
@:
-Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
force:
diff --git a/elfutils/po/Makevars b/elfutils/po/Makevars
index 0accb70a..b8ea7022 100644
--- a/elfutils/po/Makevars
+++ b/elfutils/po/Makevars
@@ -8,7 +8,8 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --flag=error:3:c-format \
+ --flag=ERROR:1:c-format
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@@ -20,6 +21,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# their copyright.
COPYRIGHT_HOLDER = Red Hat, Inc.
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = http://bugzilla.redhat.com/
+
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
diff --git a/elfutils/po/POTFILES.in b/elfutils/po/POTFILES.in
index 2ebdf082..e3a192be 100644
--- a/elfutils/po/POTFILES.in
+++ b/elfutils/po/POTFILES.in
@@ -7,6 +7,7 @@ lib/xmalloc.c
lib/xstrndup.c
# Library sources
+libelf/elf_error.c
libasm/asm_error.c
libdw/dwarf_error.c
diff --git a/elfutils/po/Rules-quot b/elfutils/po/Rules-quot
index 5f46d237..9c2a995e 100644
--- a/elfutils/po/Rules-quot
+++ b/elfutils/po/Rules-quot
@@ -4,6 +4,11 @@ DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.heade
.SUFFIXES: .insert-header .po-update-en
+en@quot.po-create:
+ $(MAKE) en@quot.po-update
+en@boldquot.po-create:
+ $(MAKE) en@boldquot.po-update
+
en@quot.po-update: en@quot.po-update-en
en@boldquot.po-update: en@boldquot.po-update-en
diff --git a/elfutils/po/elfutils.pot b/elfutils/po/elfutils.pot
index 0a016498..03836a32 100644
--- a/elfutils/po/elfutils.pot
+++ b/elfutils/po/elfutils.pot
@@ -7,8 +7,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-02-05 14:32-0800\n"
+"Report-Msgid-Bugs-To: http://bugzilla.redhat.com/\n"
+"POT-Creation-Date: 2007-11-11 11:34-0800\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"
@@ -17,19 +17,177 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: lib/xmalloc.c:51 lib/xmalloc.c:65 lib/xmalloc.c:79 src/readelf.c:2541
+#: lib/xmalloc.c:51 lib/xmalloc.c:65 lib/xmalloc.c:79 src/readelf.c:2690
+#: src/readelf.c:2865
#, c-format
msgid "memory exhausted"
msgstr ""
-#: libasm/asm_error.c:120 libdw/dwarf_error.c:111
+#: libelf/elf_error.c:113 libasm/asm_error.c:120 libdw/dwarf_error.c:111
msgid "no error"
msgstr ""
-#: libasm/asm_error.c:121 libdw/dwarf_error.c:120
+#: libelf/elf_error.c:116 libasm/asm_error.c:162 libdw/dwarf_error.c:112
+msgid "unknown error"
+msgstr ""
+
+#: libelf/elf_error.c:120
+msgid "unknown version"
+msgstr ""
+
+#: libelf/elf_error.c:124
+msgid "unknown type"
+msgstr ""
+
+#: libelf/elf_error.c:128
+msgid "invalid `Elf' handle"
+msgstr ""
+
+#: libelf/elf_error.c:132
+msgid "invalid size of source operand"
+msgstr ""
+
+#: libelf/elf_error.c:136
+msgid "invalid size of destination operand"
+msgstr ""
+
+#: libelf/elf_error.c:140
+msgid "invalid encoding"
+msgstr ""
+
+#: libelf/elf_error.c:144 libasm/asm_error.c:121 libdw/dwarf_error.c:120
msgid "out of memory"
msgstr ""
+#: libelf/elf_error.c:148
+msgid "invalid file descriptor"
+msgstr ""
+
+#: libelf/elf_error.c:152
+msgid "invalid operation"
+msgstr ""
+
+#: libelf/elf_error.c:156
+msgid "ELF version not set"
+msgstr ""
+
+#: libelf/elf_error.c:160 libelf/elf_error.c:208 libdw/dwarf_error.c:122
+msgid "invalid command"
+msgstr ""
+
+#: libelf/elf_error.c:164 libelf/elf_error.c:224
+msgid "offset out of range"
+msgstr ""
+
+#: libelf/elf_error.c:168
+msgid "invalid fmag field in archive header"
+msgstr ""
+
+#: libelf/elf_error.c:172
+msgid "invalid archive file"
+msgstr ""
+
+#: libelf/elf_error.c:176
+msgid "descriptor is not for an archive"
+msgstr ""
+
+#: libelf/elf_error.c:180
+msgid "no index available"
+msgstr ""
+
+#: libelf/elf_error.c:184
+msgid "cannot read data from file"
+msgstr ""
+
+#: libelf/elf_error.c:188
+msgid "cannot write data to file"
+msgstr ""
+
+#: libelf/elf_error.c:192
+msgid "invalid binary class"
+msgstr ""
+
+#: libelf/elf_error.c:196
+msgid "invalid section index"
+msgstr ""
+
+#: libelf/elf_error.c:200
+msgid "invalid operand"
+msgstr ""
+
+#: libelf/elf_error.c:204
+msgid "invalid section"
+msgstr ""
+
+#: libelf/elf_error.c:212
+msgid "executable header not created first"
+msgstr ""
+
+#: libelf/elf_error.c:216
+msgid "file descriptor disabled"
+msgstr ""
+
+#: libelf/elf_error.c:220
+msgid "archive/member fildes mismatch"
+msgstr ""
+
+#: libelf/elf_error.c:228
+msgid "cannot manipulate null section"
+msgstr ""
+
+#: libelf/elf_error.c:232
+msgid "data/scn mismatch"
+msgstr ""
+
+#: libelf/elf_error.c:236
+msgid "invalid section header"
+msgstr ""
+
+#: libelf/elf_error.c:240
+msgid "invalid data"
+msgstr ""
+
+#: libelf/elf_error.c:244
+msgid "unknown data encoding"
+msgstr ""
+
+#: libelf/elf_error.c:248
+msgid "section `sh_size' too small for data"
+msgstr ""
+
+#: libelf/elf_error.c:252
+msgid "invalid section alignment"
+msgstr ""
+
+#: libelf/elf_error.c:256
+msgid "invalid section entry size"
+msgstr ""
+
+#: libelf/elf_error.c:260
+msgid "update() for write on read-only file"
+msgstr ""
+
+#: libelf/elf_error.c:264
+msgid "no such file"
+msgstr ""
+
+#: libelf/elf_error.c:268
+msgid "only relocatable files can contain section groups"
+msgstr ""
+
+#: libelf/elf_error.c:273
+msgid ""
+"program header only allowed in executables, shared objects, and core files"
+msgstr ""
+
+#: libelf/elf_error.c:280
+msgid "file has no program header"
+msgstr ""
+
+#: libelf/elf_error.c:285 libdw/dwarf_error.c:144
+msgid "invalid offset"
+msgstr ""
+
#: libasm/asm_error.c:122 src/ldgeneric.c:2564
#, c-format
msgid "cannot create output file"
@@ -60,10 +218,6 @@ msgstr ""
msgid "error during output of data"
msgstr ""
-#: libasm/asm_error.c:162 libdw/dwarf_error.c:112
-msgid "unknown error"
-msgstr ""
-
#: libdw/dwarf_error.c:113
msgid "invalid access"
msgstr ""
@@ -96,10 +250,6 @@ msgstr ""
msgid "not implemented"
msgstr ""
-#: libdw/dwarf_error.c:122
-msgid "invalid command"
-msgstr ""
-
#: libdw/dwarf_error.c:123
msgid "invalid version"
msgstr ""
@@ -184,15 +334,11 @@ msgstr ""
msgid "no flag value"
msgstr ""
-#: libdw/dwarf_error.c:144
-msgid "invalid offset"
-msgstr ""
-
#: libdw/dwarf_error.c:145
msgid ".debug_ranges section missing"
msgstr ""
-#: src/nm.c:74 src/readelf.c:66 src/strip.c:72
+#: src/nm.c:74 src/readelf.c:71 src/strip.c:72
msgid "Output selection:"
msgstr ""
@@ -270,7 +416,7 @@ msgstr ""
msgid "Reverse the sense of the sort"
msgstr ""
-#: src/nm.c:103 src/addr2line.c:70 src/findtextrel.c:73 src/elfcmp.c:71
+#: src/nm.c:103 src/addr2line.c:71 src/findtextrel.c:73 src/elfcmp.c:74
#: src/strings.c:83
msgid "Miscellaneous:"
msgstr ""
@@ -289,9 +435,9 @@ msgstr ""
msgid "%s: INTERNAL ERROR %d (%s-%s): %s"
msgstr ""
-#: src/nm.c:253 src/readelf.c:368 src/size.c:219 src/strip.c:203 src/ld.c:869
-#: src/elflint.c:232 src/addr2line.c:185 src/findtextrel.c:168
-#: src/elfcmp.c:506 src/ranlib.c:136 src/strings.c:227
+#: src/nm.c:253 src/readelf.c:414 src/size.c:219 src/strip.c:203 src/ld.c:869
+#: src/elflint.c:235 src/addr2line.c:190 src/findtextrel.c:168
+#: src/elfcmp.c:519 src/ranlib.c:136 src/strings.c:227
#, c-format
msgid ""
"Copyright (C) %s Red Hat, Inc.\n"
@@ -299,21 +445,21 @@ msgid ""
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
msgstr ""
-#: src/nm.c:258 src/readelf.c:373 src/size.c:224 src/strip.c:208 src/ld.c:874
-#: src/elflint.c:237 src/addr2line.c:190 src/findtextrel.c:173
-#: src/elfcmp.c:511 src/ranlib.c:141 src/strings.c:232
+#: src/nm.c:258 src/readelf.c:419 src/size.c:224 src/strip.c:208 src/ld.c:874
+#: src/elflint.c:240 src/addr2line.c:195 src/findtextrel.c:173
+#: src/elfcmp.c:524 src/ranlib.c:141 src/strings.c:232
#, c-format
msgid "Written by %s.\n"
msgstr ""
#: src/nm.c:363 src/size.c:301 src/strip.c:430 src/strip.c:465
-#: src/ldgeneric.c:1676 src/findtextrel.c:227 src/elfcmp.c:554
+#: src/ldgeneric.c:1676 src/findtextrel.c:227 src/elfcmp.c:571
#: src/ranlib.c:169 src/strings.c:183
#, c-format
msgid "cannot open '%s'"
msgstr ""
-#: src/nm.c:380 src/nm.c:392 src/size.c:317 src/size.c:400 src/strip.c:1760
+#: src/nm.c:380 src/nm.c:392 src/size.c:317 src/size.c:400 src/strip.c:1771
#, c-format
msgid "while closing '%s'"
msgstr ""
@@ -354,11 +500,12 @@ msgstr ""
msgid "cannot create search tree"
msgstr ""
-#: src/nm.c:728 src/nm.c:973 src/readelf.c:676 src/readelf.c:815
-#: src/readelf.c:956 src/readelf.c:1138 src/readelf.c:1346 src/readelf.c:1500
-#: src/readelf.c:1667 src/readelf.c:1921 src/readelf.c:1987 src/readelf.c:2065
-#: src/readelf.c:2560 src/readelf.c:2596 src/readelf.c:4947 src/size.c:418
-#: src/size.c:492 src/strip.c:480
+#: src/nm.c:728 src/nm.c:978 src/readelf.c:825 src/readelf.c:964
+#: src/readelf.c:1105 src/readelf.c:1287 src/readelf.c:1495 src/readelf.c:1649
+#: src/readelf.c:1816 src/readelf.c:2070 src/readelf.c:2136 src/readelf.c:2214
+#: src/readelf.c:2709 src/readelf.c:2745 src/readelf.c:5132 src/readelf.c:5891
+#: src/readelf.c:6036 src/readelf.c:6105 src/size.c:418 src/size.c:492
+#: src/strip.c:480
#, c-format
msgid "cannot get section header string table index"
msgstr ""
@@ -388,379 +535,391 @@ msgid ""
"\n"
msgstr ""
-#: src/nm.c:983
+#: src/nm.c:988
#, c-format
msgid "%s: entry size in section `%s' is not what we expect"
msgstr ""
-#: src/nm.c:987
+#: src/nm.c:992
#, c-format
msgid "%s: size of section `%s' is not multiple of entry size"
msgstr ""
-#: src/nm.c:1220
+#: src/nm.c:1229
#, c-format
msgid "%s%s%s%s: Invalid operation"
msgstr ""
-#: src/nm.c:1277
+#: src/nm.c:1286
#, c-format
msgid "%s%s%s: no symbols"
msgstr ""
-#: src/readelf.c:67
+#: src/readelf.c:72
msgid "Equivalent to: -h -l"
msgstr ""
-#: src/readelf.c:68
+#: src/readelf.c:73
msgid "Display the dynamic segment"
msgstr ""
-#: src/readelf.c:69
+#: src/readelf.c:74
msgid "Display the ELF file header"
msgstr ""
-#: src/readelf.c:71
+#: src/readelf.c:76
msgid "Display histogram of bucket list lengths"
msgstr ""
-#: src/readelf.c:72
+#: src/readelf.c:77
msgid "Display the program headers"
msgstr ""
-#: src/readelf.c:73
+#: src/readelf.c:79
msgid "Display relocations"
msgstr ""
-#: src/readelf.c:74
+#: src/readelf.c:80
msgid "Display the sections' header"
msgstr ""
-#: src/readelf.c:75
+#: src/readelf.c:82
msgid "Display the symbol table"
msgstr ""
-#: src/readelf.c:76
+#: src/readelf.c:83
msgid "Display versioning information"
msgstr ""
-#: src/readelf.c:78
+#: src/readelf.c:85
msgid ""
"Display DWARF section content. SECTION can be one of abbrev, aranges, "
"frame, info, loc, line, ranges, pubnames, str, or macinfo."
msgstr ""
-#: src/readelf.c:81
+#: src/readelf.c:88
msgid "Display the core notes"
msgstr ""
-#: src/readelf.c:83
+#: src/readelf.c:90
msgid "Display architecture specific information (if any)"
msgstr ""
-#: src/readelf.c:85
+#: src/readelf.c:92
+msgid "Dump the uninterpreted contents of SECTION, by number or name"
+msgstr ""
+
+#: src/readelf.c:94
+msgid "Print string contents of sections"
+msgstr ""
+
+#: src/readelf.c:97
+msgid "Display the symbol index of an archive"
+msgstr ""
+
+#: src/readelf.c:99
msgid "Output control:"
msgstr ""
-#: src/readelf.c:91
+#: src/readelf.c:105
msgid "Print information from ELF file in human-readable form."
msgstr ""
-#: src/readelf.c:95 src/elflint.c:81
+#: src/readelf.c:109 src/elflint.c:81
msgid "FILE..."
msgstr ""
-#: src/readelf.c:215 src/elflint.c:151
+#: src/readelf.c:254 src/elflint.c:154
#, c-format
msgid "cannot open input file"
msgstr ""
-#: src/readelf.c:222 src/elflint.c:158
+#: src/readelf.c:361
#, c-format
-msgid "cannot generate Elf descriptor: %s\n"
+msgid "Unknown DWARF debug section `%s'.\n"
msgstr ""
-#: src/readelf.c:230
-#, c-format
-msgid "error while closing Elf descriptor: %s"
+#: src/readelf.c:390 src/elflint.c:218
+msgid "Missing file name.\n"
msgstr ""
-#: src/readelf.c:335
-#, c-format
-msgid "Unknown DWARF debug section `%s'.\n"
+#: src/readelf.c:395
+msgid "No operation specified.\n"
msgstr ""
-#: src/readelf.c:344 src/elflint.c:215
-msgid "Missing file name.\n"
+#: src/readelf.c:430
+#, c-format
+msgid "cannot generate Elf descriptor: %s"
msgstr ""
-#: src/readelf.c:349
-msgid "No operation specified.\n"
+#: src/readelf.c:442
+#, c-format
+msgid "'%s' is not an archive, cannot print archive index"
msgstr ""
-#: src/readelf.c:428 src/elflint.c:295
+#: src/readelf.c:447
#, c-format
-msgid " error while freeing sub-ELF descriptor: %s\n"
+msgid "error while closing Elf descriptor: %s"
msgstr ""
-#: src/readelf.c:436
+#: src/readelf.c:537
#, c-format
msgid "cannot stat input file"
msgstr ""
-#: src/readelf.c:438
+#: src/readelf.c:539
#, c-format
msgid "input file is empty"
msgstr ""
-#: src/readelf.c:441
+#: src/readelf.c:541
#, c-format
-msgid "Not an ELF file - it has the wrong magic bytes at the start"
+msgid "failed reading '%s': %s"
msgstr ""
-#: src/readelf.c:467
+#: src/readelf.c:573
#, c-format
msgid "cannot read ELF header: %s"
msgstr ""
-#: src/readelf.c:474
+#: src/readelf.c:581
#, c-format
msgid "cannot create EBL handle"
msgstr ""
-#: src/readelf.c:481 src/strip.c:540 src/ldgeneric.c:615 src/ldgeneric.c:1082
+#: src/readelf.c:588 src/strip.c:540 src/ldgeneric.c:615 src/ldgeneric.c:1082
#, c-format
msgid "cannot determine number of sections: %s"
msgstr ""
-#: src/readelf.c:523
+#: src/readelf.c:672
msgid "NONE (None)"
msgstr ""
-#: src/readelf.c:524
+#: src/readelf.c:673
msgid "REL (Relocatable file)"
msgstr ""
-#: src/readelf.c:525
+#: src/readelf.c:674
msgid "EXEC (Executable file)"
msgstr ""
-#: src/readelf.c:526
+#: src/readelf.c:675
msgid "DYN (Shared object file)"
msgstr ""
-#: src/readelf.c:527
+#: src/readelf.c:676
msgid "CORE (Core file)"
msgstr ""
-#: src/readelf.c:532
+#: src/readelf.c:681
#, c-format
msgid "OS Specific: (%x)\n"
msgstr ""
-#: src/readelf.c:534
+#: src/readelf.c:683
#, c-format
msgid "Processor Specific: (%x)\n"
msgstr ""
-#: src/readelf.c:544
+#: src/readelf.c:693
msgid ""
"ELF Header:\n"
" Magic: "
msgstr ""
-#: src/readelf.c:548
+#: src/readelf.c:697
#, c-format
msgid ""
"\n"
" Class: %s\n"
msgstr ""
-#: src/readelf.c:553
+#: src/readelf.c:702
#, c-format
msgid " Data: %s\n"
msgstr ""
-#: src/readelf.c:559
+#: src/readelf.c:708
#, c-format
msgid " Ident Version: %hhd %s\n"
msgstr ""
-#: src/readelf.c:561 src/readelf.c:578
+#: src/readelf.c:710 src/readelf.c:727
msgid "(current)"
msgstr ""
-#: src/readelf.c:565
+#: src/readelf.c:714
#, c-format
msgid " OS/ABI: %s\n"
msgstr ""
-#: src/readelf.c:568
+#: src/readelf.c:717
#, c-format
msgid " ABI Version: %hhd\n"
msgstr ""
-#: src/readelf.c:571
+#: src/readelf.c:720
msgid " Type: "
msgstr ""
-#: src/readelf.c:574
+#: src/readelf.c:723
#, c-format
msgid " Machine: %s\n"
msgstr ""
-#: src/readelf.c:576
+#: src/readelf.c:725
#, c-format
msgid " Version: %d %s\n"
msgstr ""
-#: src/readelf.c:580
+#: src/readelf.c:729
#, c-format
msgid " Entry point address: %#<PRIx64>\n"
msgstr ""
-#: src/readelf.c:583
+#: src/readelf.c:732
#, c-format
msgid " Start of program headers: %<PRId64> %s\n"
msgstr ""
-#: src/readelf.c:584 src/readelf.c:587
+#: src/readelf.c:733 src/readelf.c:736
msgid "(bytes into file)"
msgstr ""
-#: src/readelf.c:586
+#: src/readelf.c:735
#, c-format
msgid " Start of section headers: %<PRId64> %s\n"
msgstr ""
-#: src/readelf.c:589
+#: src/readelf.c:738
#, c-format
msgid " Flags: %s\n"
msgstr ""
-#: src/readelf.c:592
+#: src/readelf.c:741
#, c-format
msgid " Size of this header: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:593 src/readelf.c:596 src/readelf.c:602
+#: src/readelf.c:742 src/readelf.c:745 src/readelf.c:751
msgid "(bytes)"
msgstr ""
-#: src/readelf.c:595
+#: src/readelf.c:744
#, c-format
msgid " Size of program header entries: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:598
+#: src/readelf.c:747
#, c-format
msgid " Number of program headers entries: %<PRId16>\n"
msgstr ""
-#: src/readelf.c:601
+#: src/readelf.c:750
#, c-format
msgid " Size of section header entries: %<PRId16> %s\n"
msgstr ""
-#: src/readelf.c:604
+#: src/readelf.c:753
#, c-format
msgid " Number of section headers entries: %<PRId16>"
msgstr ""
-#: src/readelf.c:611
+#: src/readelf.c:760
#, c-format
msgid " (%<PRIu32> in [0].sh_size)"
msgstr ""
-#: src/readelf.c:614 src/readelf.c:628
+#: src/readelf.c:763 src/readelf.c:777
msgid " ([0] not available)"
msgstr ""
-#: src/readelf.c:624
+#: src/readelf.c:773
#, c-format
msgid " (%<PRIu32> in [0].sh_link)"
msgstr ""
-#: src/readelf.c:632
+#: src/readelf.c:781
#, c-format
msgid ""
" Section header string table index: XINDEX%s\n"
"\n"
msgstr ""
-#: src/readelf.c:636
+#: src/readelf.c:785
#, c-format
msgid ""
" Section header string table index: %<PRId16>\n"
"\n"
msgstr ""
-#: src/readelf.c:668
+#: src/readelf.c:817
#, c-format
msgid ""
"There are %d section headers, starting at offset %#<PRIx64>:\n"
"\n"
msgstr ""
-#: src/readelf.c:678
+#: src/readelf.c:827
msgid "Section Headers:"
msgstr ""
-#: src/readelf.c:681
+#: src/readelf.c:830
msgid ""
"[Nr] Name Type Addr Off Size ES Flags Lk "
"Inf Al"
msgstr ""
-#: src/readelf.c:683
+#: src/readelf.c:832
msgid ""
"[Nr] Name Type Addr Off Size ES "
"Flags Lk Inf Al"
msgstr ""
-#: src/readelf.c:690 src/readelf.c:839
+#: src/readelf.c:839 src/readelf.c:988
#, c-format
msgid "cannot get section: %s"
msgstr ""
-#: src/readelf.c:697 src/readelf.c:847
+#: src/readelf.c:846 src/readelf.c:996 src/readelf.c:6056
#, c-format
msgid "cannot get section header: %s"
msgstr ""
-#: src/readelf.c:755
+#: src/readelf.c:904
msgid "Program Headers:"
msgstr ""
-#: src/readelf.c:757
+#: src/readelf.c:906
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"
msgstr ""
-#: src/readelf.c:760
+#: src/readelf.c:909
msgid ""
" Type Offset VirtAddr PhysAddr FileSiz "
"MemSiz Flg Align"
msgstr ""
-#: src/readelf.c:800
+#: src/readelf.c:949
#, c-format
msgid "\t[Requesting program interpreter: %s]\n"
msgstr ""
-#: src/readelf.c:817
+#: src/readelf.c:966
msgid ""
"\n"
" Section to Segment mapping:\n"
" Segment Sections..."
msgstr ""
-#: src/readelf.c:828
+#: src/readelf.c:977
#, c-format
msgid "cannot get program header: %s"
msgstr ""
-#: src/readelf.c:962
+#: src/readelf.c:1111
#, c-format
msgid ""
"\n"
@@ -771,7 +930,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:967
+#: src/readelf.c:1116
#, c-format
msgid ""
"\n"
@@ -782,15 +941,15 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:975
+#: src/readelf.c:1124
msgid "<INVALID SYMBOL>"
msgstr ""
-#: src/readelf.c:989
+#: src/readelf.c:1138
msgid "<INVALID SECTION>"
msgstr ""
-#: src/readelf.c:1140
+#: src/readelf.c:1289
#, c-format
msgid ""
"\n"
@@ -803,43 +962,43 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1152
+#: src/readelf.c:1301
msgid " Type Value\n"
msgstr ""
-#: src/readelf.c:1176
+#: src/readelf.c:1325
#, c-format
msgid "Shared library: [%s]\n"
msgstr ""
-#: src/readelf.c:1181
+#: src/readelf.c:1330
#, c-format
msgid "Library soname: [%s]\n"
msgstr ""
-#: src/readelf.c:1186
+#: src/readelf.c:1335
#, c-format
msgid "Library rpath: [%s]\n"
msgstr ""
-#: src/readelf.c:1191
+#: src/readelf.c:1340
#, c-format
msgid "Library runpath: [%s]\n"
msgstr ""
-#: src/readelf.c:1211
+#: src/readelf.c:1360
#, c-format
msgid "%<PRId64> (bytes)\n"
msgstr ""
-#: src/readelf.c:1321 src/readelf.c:1475
+#: src/readelf.c:1470 src/readelf.c:1624
#, c-format
msgid ""
"\n"
"Invalid symbol table at offset %#0<PRIx64>\n"
msgstr ""
-#: src/readelf.c:1349
+#: src/readelf.c:1498
#, c-format
msgid ""
"\n"
@@ -852,7 +1011,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1364
+#: src/readelf.c:1513
#, c-format
msgid ""
"\n"
@@ -863,28 +1022,28 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1374
+#: src/readelf.c:1523
msgid " Offset Type Value Name\n"
msgstr ""
-#: src/readelf.c:1376
+#: src/readelf.c:1525
msgid " Offset Type Value Name\n"
msgstr ""
-#: src/readelf.c:1400 src/readelf.c:1411 src/readelf.c:1429 src/readelf.c:1441
-#: src/readelf.c:1541 src/readelf.c:1553 src/readelf.c:1572 src/readelf.c:1585
+#: src/readelf.c:1549 src/readelf.c:1560 src/readelf.c:1578 src/readelf.c:1590
+#: src/readelf.c:1690 src/readelf.c:1702 src/readelf.c:1721 src/readelf.c:1734
msgid "<INVALID RELOC>"
msgstr ""
-#: src/readelf.c:1401 src/readelf.c:1542
+#: src/readelf.c:1550 src/readelf.c:1691
msgid "INVALID SYMBOL"
msgstr ""
-#: src/readelf.c:1430 src/readelf.c:1573
+#: src/readelf.c:1579 src/readelf.c:1722
msgid "INVALID SECTION"
msgstr ""
-#: src/readelf.c:1502
+#: src/readelf.c:1651
#, c-format
msgid ""
"\n"
@@ -897,15 +1056,15 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1514
+#: src/readelf.c:1663
msgid " Offset Type Value Addend Name\n"
msgstr ""
-#: src/readelf.c:1516
+#: src/readelf.c:1665
msgid " Offset Type Value Addend Name\n"
msgstr ""
-#: src/readelf.c:1674
+#: src/readelf.c:1823
#, c-format
msgid ""
"\n"
@@ -916,40 +1075,40 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1680
+#: src/readelf.c:1829
#, 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:1690
+#: src/readelf.c:1839
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr ""
-#: src/readelf.c:1692
+#: src/readelf.c:1841
msgid " Num: Value Size Type Bind Vis Ndx Name\n"
msgstr ""
-#: src/readelf.c:1712
+#: src/readelf.c:1861
#, c-format
msgid "%5u: %0*<PRIx64> %6<PRId64> %-7s %-6s %-9s %6s %s"
msgstr ""
-#: src/readelf.c:1800
+#: src/readelf.c:1949
#, c-format
msgid "bad dynamic symbol"
msgstr ""
-#: src/readelf.c:1882
+#: src/readelf.c:2031
msgid "none"
msgstr ""
-#: src/readelf.c:1899
+#: src/readelf.c:2048
msgid "| <unknown>"
msgstr ""
-#: src/readelf.c:1924
+#: src/readelf.c:2073
#, c-format
msgid ""
"\n"
@@ -962,17 +1121,17 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:1947
+#: src/readelf.c:2096
#, c-format
msgid " %#06x: Version: %hu File: %s Cnt: %hu\n"
msgstr ""
-#: src/readelf.c:1960
+#: src/readelf.c:2109
#, c-format
msgid " %#06x: Name: %s Flags: %s Version: %hu\n"
msgstr ""
-#: src/readelf.c:1991
+#: src/readelf.c:2140
#, c-format
msgid ""
"\n"
@@ -985,17 +1144,17 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2021
+#: src/readelf.c:2170
#, c-format
msgid " %#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"
msgstr ""
-#: src/readelf.c:2036
+#: src/readelf.c:2185
#, c-format
msgid " %#06x: Parent %d: %s\n"
msgstr ""
-#: src/readelf.c:2268
+#: src/readelf.c:2417
#, c-format
msgid ""
"\n"
@@ -1008,15 +1167,15 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2298
+#: src/readelf.c:2447
msgid " 0 *local* "
msgstr ""
-#: src/readelf.c:2303
+#: src/readelf.c:2452
msgid " 1 *global* "
msgstr ""
-#: src/readelf.c:2334
+#: src/readelf.c:2483
#, c-format
msgid ""
"\n"
@@ -1031,41 +1190,41 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2357
+#: src/readelf.c:2506
#, c-format
msgid " Length Number % of total Coverage\n"
msgstr ""
-#: src/readelf.c:2359
+#: src/readelf.c:2508
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr ""
-#: src/readelf.c:2366
+#: src/readelf.c:2515
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr ""
-#: src/readelf.c:2379
+#: src/readelf.c:2528
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
" unsuccessful lookup: %f\n"
msgstr ""
-#: src/readelf.c:2397 src/readelf.c:2439 src/readelf.c:2480
+#: src/readelf.c:2546 src/readelf.c:2588 src/readelf.c:2629
#, c-format
msgid "cannot get data for section %d: %s"
msgstr ""
-#: src/readelf.c:2534
+#: src/readelf.c:2683
#, c-format
msgid ""
" Symbol Bias: %u\n"
" Bitmask Size: %zu bytes %<PRIuFAST32>%% bits set 2nd hash shift: %u\n"
msgstr ""
-#: src/readelf.c:2606
+#: src/readelf.c:2755
#, c-format
msgid ""
"\n"
@@ -1076,38 +1235,88 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2620
+#: src/readelf.c:2769
msgid ""
" Library Time Stamp Checksum Version "
"Flags"
msgstr ""
-#: src/readelf.c:2742
+#: src/readelf.c:2821
+#, c-format
+msgid "%s+%#<PRIx64> <%s+%#<PRIx64>>"
+msgstr ""
+
+#: src/readelf.c:2824
+#, c-format
+msgid "%s+%#0*<PRIx64> <%s+%#<PRIx64>>"
+msgstr ""
+
+#: src/readelf.c:2829
+#, c-format
+msgid "%#<PRIx64> <%s+%#<PRIx64>>"
+msgstr ""
+
+#: src/readelf.c:2832
+#, c-format
+msgid "%#0*<PRIx64> <%s+%#<PRIx64>>"
+msgstr ""
+
+#: src/readelf.c:2838
+#, c-format
+msgid "%s+%#<PRIx64> <%s>"
+msgstr ""
+
+#: src/readelf.c:2841
+#, c-format
+msgid "%s+%#0*<PRIx64> <%s>"
+msgstr ""
+
+#: src/readelf.c:2845
+#, c-format
+msgid "%#<PRIx64> <%s>"
+msgstr ""
+
+#: src/readelf.c:2848
+#, c-format
+msgid "%#0*<PRIx64> <%s>"
+msgstr ""
+
+#: src/readelf.c:2853
+#, c-format
+msgid "%s+%#<PRIx64>"
+msgstr ""
+
+#: src/readelf.c:2856
+#, c-format
+msgid "%s+%#0*<PRIx64>"
+msgstr ""
+
+#: src/readelf.c:2964
#, c-format
msgid "unknown tag %hx"
msgstr ""
-#: src/readelf.c:2744
+#: src/readelf.c:2966
#, c-format
msgid "unknown user tag %hx"
msgstr ""
-#: src/readelf.c:2954
+#: src/readelf.c:3176
#, c-format
msgid "unknown attribute %hx"
msgstr ""
-#: src/readelf.c:2957
+#: src/readelf.c:3179
#, c-format
msgid "unknown user attribute %hx"
msgstr ""
-#: src/readelf.c:3003
+#: src/readelf.c:3225
#, c-format
msgid "unknown form %<PRIx64>"
msgstr ""
-#: src/readelf.c:3578
+#: src/readelf.c:3810
#, c-format
msgid ""
"\n"
@@ -1115,37 +1324,37 @@ msgid ""
" [ Code]\n"
msgstr ""
-#: src/readelf.c:3585
+#: src/readelf.c:3817
#, c-format
msgid ""
"\n"
"Abbreviation section at offset %<PRIu64>:\n"
msgstr ""
-#: src/readelf.c:3598
+#: src/readelf.c:3830
#, c-format
msgid " *** error while reading abbreviation: %s\n"
msgstr ""
-#: src/readelf.c:3614
+#: src/readelf.c:3846
#, c-format
msgid " [%5u] offset: %<PRId64>, children: %s, tag: %s\n"
msgstr ""
-#: src/readelf.c:3617
+#: src/readelf.c:3849
msgid "yes"
msgstr ""
-#: src/readelf.c:3617
+#: src/readelf.c:3849
msgid "no"
msgstr ""
-#: src/readelf.c:3653
+#: src/readelf.c:3886
#, c-format
msgid "cannot get .debug_aranges content: %s"
msgstr ""
-#: src/readelf.c:3658
+#: src/readelf.c:3891
#, c-format
msgid ""
"\n"
@@ -1156,46 +1365,66 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:3688
+#: src/readelf.c:3921
#, c-format
msgid " [%*zu] ???\n"
msgstr ""
-#: src/readelf.c:3690
+#: src/readelf.c:3923
#, c-format
msgid ""
" [%*zu] start: %0#*<PRIx64>, length: %5<PRIu64>, CU DIE offset: %6<PRId64>\n"
msgstr ""
-#: src/readelf.c:3708
+#: src/readelf.c:3942
#, c-format
msgid "cannot get .debug_ranges content: %s"
msgstr ""
-#: src/readelf.c:3713 src/readelf.c:4190 src/readelf.c:4615 src/readelf.c:4705
-#: src/readelf.c:4877
+#: src/readelf.c:3947 src/readelf.c:4350 src/readelf.c:4798 src/readelf.c:4893
+#: src/readelf.c:5066
#, c-format
msgid ""
"\n"
"DWARF section '%s' at offset %#<PRIx64>:\n"
msgstr ""
-#: src/readelf.c:3797
+#: src/readelf.c:3961 src/readelf.c:4812
+#, c-format
+msgid " [%6tx] <INVALID DATA>\n"
+msgstr ""
+
+#: src/readelf.c:3983 src/readelf.c:4834
+#, c-format
+msgid " [%6tx] base address %s\n"
+msgstr ""
+
+#: src/readelf.c:3994
+#, c-format
+msgid " [%6tx] %s..%s\n"
+msgstr ""
+
+#: src/readelf.c:3996
+#, c-format
+msgid " %s..%s\n"
+msgstr ""
+
+#: src/readelf.c:4036
#, c-format
msgid "cannot get attribute code: %s"
msgstr ""
-#: src/readelf.c:3805
+#: src/readelf.c:4044
#, c-format
msgid "cannot get attribute form: %s"
msgstr ""
-#: src/readelf.c:3817
+#: src/readelf.c:4057
#, c-format
msgid "cannot get attribute value: %s"
msgstr ""
-#: src/readelf.c:3983
+#: src/readelf.c:4229
#, c-format
msgid ""
"\n"
@@ -1203,7 +1432,7 @@ msgid ""
" [Offset]\n"
msgstr ""
-#: src/readelf.c:4008
+#: src/readelf.c:4254
#, c-format
msgid ""
" Compilation unit at offset %<PRIu64>:\n"
@@ -1211,49 +1440,49 @@ msgid ""
"<PRIu8>, Offset size: %<PRIu8>\n"
msgstr ""
-#: src/readelf.c:4025
+#: src/readelf.c:4272
#, c-format
msgid "cannot get DIE at offset %<PRIu64> in section '%s': %s"
msgstr ""
-#: src/readelf.c:4036
+#: src/readelf.c:4283
#, c-format
msgid "cannot get DIE offset: %s"
msgstr ""
-#: src/readelf.c:4044
+#: src/readelf.c:4291
#, c-format
msgid "cannot get tag of DIE at offset %<PRIu64> in section '%s': %s"
msgstr ""
-#: src/readelf.c:4161
+#: src/readelf.c:4320
#, c-format
msgid "cannot get next DIE: %s\n"
msgstr ""
-#: src/readelf.c:4168
+#: src/readelf.c:4327
#, c-format
msgid "cannot get next DIE: %s"
msgstr ""
-#: src/readelf.c:4202
+#: src/readelf.c:4362
#, c-format
msgid "cannot get line data section data: %s"
msgstr ""
-#: src/readelf.c:4215
+#: src/readelf.c:4375
#, c-format
msgid ""
"\n"
"Table at offset %Zu:\n"
msgstr ""
-#: src/readelf.c:4224
+#: src/readelf.c:4384
#, c-format
msgid "invalid data in section [%zu] '%s'"
msgstr ""
-#: src/readelf.c:4267
+#: src/readelf.c:4427
#, c-format
msgid ""
"\n"
@@ -1269,139 +1498,154 @@ msgid ""
"Opcodes:\n"
msgstr ""
-#: src/readelf.c:4293
+#: src/readelf.c:4446
+#, c-format
+msgid "invalid data at offset %tu in section [%zu] '%s'"
+msgstr ""
+
+#: src/readelf.c:4461
#, c-format
msgid " [%*<PRIuFAST8>] %hhu argument\n"
msgid_plural " [%*<PRIuFAST8>] %hhu arguments\n"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:4301
+#: src/readelf.c:4469
msgid ""
"\n"
"Directory table:"
msgstr ""
-#: src/readelf.c:4317
+#: src/readelf.c:4485
msgid ""
"\n"
"File name table:\n"
" Entry Dir Time Size Name"
msgstr ""
-#: src/readelf.c:4346
+#: src/readelf.c:4514
msgid ""
"\n"
"Line number statements:"
msgstr ""
-#: src/readelf.c:4406
+#: src/readelf.c:4575
#, c-format
-msgid " special opcode %u: address+%u = %#<PRIx64>, line%+d = %zu\n"
+msgid " special opcode %u: address+%u = %s, line%+d = %zu\n"
msgstr ""
-#: src/readelf.c:4426
+#: src/readelf.c:4595
#, c-format
msgid " extended opcode %u: "
msgstr ""
-#: src/readelf.c:4431
+#: src/readelf.c:4600
msgid "end of sequence"
msgstr ""
-#: src/readelf.c:4444
+#: src/readelf.c:4615
#, c-format
-msgid "set address to %#<PRIx64>\n"
+msgid "set address to %s\n"
msgstr ""
-#: src/readelf.c:4464
+#: src/readelf.c:4636
#, c-format
msgid "define new file: dir=%u, mtime=%<PRIu64>, length=%<PRIu64>, name=%s\n"
msgstr ""
-#: src/readelf.c:4473
+#: src/readelf.c:4645
msgid "unknown opcode"
msgstr ""
-#: src/readelf.c:4485
+#: src/readelf.c:4657
msgid " copy"
msgstr ""
-#: src/readelf.c:4493
+#: src/readelf.c:4667
#, c-format
-msgid " advance address by %u to %#<PRIx64>\n"
+msgid "advance address by %u to %s\n"
msgstr ""
-#: src/readelf.c:4503
+#: src/readelf.c:4678
#, c-format
msgid " advance line by constant %d to %<PRId64>\n"
msgstr ""
-#: src/readelf.c:4511
+#: src/readelf.c:4686
#, c-format
msgid " set file to %<PRIu64>\n"
msgstr ""
-#: src/readelf.c:4521
+#: src/readelf.c:4696
#, c-format
msgid " set column to %<PRIu64>\n"
msgstr ""
-#: src/readelf.c:4528
+#: src/readelf.c:4703
#, c-format
msgid " set '%s' to %<PRIuFAST8>\n"
msgstr ""
-#: src/readelf.c:4534
+#: src/readelf.c:4709
msgid " set basic block flag"
msgstr ""
-#: src/readelf.c:4542
+#: src/readelf.c:4719
#, c-format
-msgid " advance address by constant %u to %#<PRIx64>\n"
+msgid "advance address by constant %u to %s\n"
msgstr ""
-#: src/readelf.c:4555
+#: src/readelf.c:4735
#, c-format
-msgid " advance address by fixed value %u to %#<PRIx64>\n"
+msgid "advance address by fixed value %u to %s\n"
msgstr ""
-#: src/readelf.c:4562
+#: src/readelf.c:4744
msgid " set prologue end flag"
msgstr ""
-#: src/readelf.c:4567
+#: src/readelf.c:4749
msgid " set epilogue begin flag"
msgstr ""
-#: src/readelf.c:4576
+#: src/readelf.c:4758
#, c-format
msgid " unknown opcode with %<PRIu8> parameter:"
msgid_plural " unknown opcode with %<PRIu8> parameters:"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:4610
+#: src/readelf.c:4793
#, c-format
msgid "cannot get .debug_loc content: %s"
msgstr ""
-#: src/readelf.c:4715
+#: src/readelf.c:4848
+#, c-format
+msgid " [%6tx] %s..%s"
+msgstr ""
+
+#: src/readelf.c:4850
+#, c-format
+msgid " %s..%s"
+msgstr ""
+
+#: src/readelf.c:4903
#, c-format
msgid "cannot get macro information section data: %s"
msgstr ""
-#: src/readelf.c:4794
+#: src/readelf.c:4982
#, c-format
msgid "%*s*** non-terminated string at end of section"
msgstr ""
-#: src/readelf.c:4862
+#: src/readelf.c:5050
#, c-format
msgid " [%5d] DIE offset: %6<PRId64>, CU DIE offset: %6<PRId64>, name: %s\n"
msgstr ""
-#: src/readelf.c:4901
+#: src/readelf.c:5091
#, c-format
msgid ""
"\n"
@@ -1409,37 +1653,135 @@ msgid ""
" %*s String\n"
msgstr ""
-#: src/readelf.c:4914
+#: src/readelf.c:5104
#, c-format
msgid " *** error while reading strings: %s\n"
msgstr ""
-#: src/readelf.c:4939
+#: src/readelf.c:5123
#, c-format
msgid "cannot get debug context descriptor: %s"
msgstr ""
-#: src/readelf.c:5017
+#: src/readelf.c:5253 src/readelf.c:5735
#, c-format
-msgid ""
-"\n"
-"Note segment of %<PRId64> bytes at offset %#0<PRIx64>:\n"
+msgid "cannot convert core note data: %s"
msgstr ""
-#: src/readelf.c:5024
+#: src/readelf.c:5504
#, c-format
-msgid "cannot get content of note section: %s"
+msgid "unable to handle register number %d"
+msgstr ""
+
+#: src/readelf.c:5651 src/readelf.c:5675
+#, c-format
+msgid "cannot register info: %s"
msgstr ""
-#: src/readelf.c:5027
+#: src/readelf.c:5827
msgid " Owner Data size Type\n"
msgstr ""
-#: src/readelf.c:5067
+#: src/readelf.c:5845
#, c-format
msgid " %-13.*s %9<PRId32> %s\n"
msgstr ""
+#: src/readelf.c:5876
+#, c-format
+msgid "cannot get content of note section: %s"
+msgstr ""
+
+#: src/readelf.c:5903
+#, c-format
+msgid ""
+"\n"
+"Note section [%2zu] '%s' of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
+msgstr ""
+
+#: src/readelf.c:5926
+#, c-format
+msgid ""
+"\n"
+"Note segment of %<PRIu64> bytes at offset %#0<PRIx64>:\n"
+msgstr ""
+
+#: src/readelf.c:5972
+#, c-format
+msgid ""
+"\n"
+"Section [%Zu] '%s' has no data to dump.\n"
+msgstr ""
+
+#: src/readelf.c:5978 src/readelf.c:6000
+#, c-format
+msgid "cannot get data for section [%Zu] '%s': %s"
+msgstr ""
+
+#: src/readelf.c:5982
+#, c-format
+msgid ""
+"\n"
+"Hex dump of section [%Zu] '%s', %<PRIu64> bytes at offset %#0<PRIx64>:\n"
+msgstr ""
+
+#: src/readelf.c:5995
+#, c-format
+msgid ""
+"\n"
+"Section [%Zu] '%s' is empty.\n"
+msgstr ""
+
+#: src/readelf.c:6004
+#, c-format
+msgid ""
+"\n"
+"String section [%Zu] '%s' contains %<PRIu64> bytes at offset %#0<PRIx64>:\n"
+msgstr ""
+
+#: src/readelf.c:6051
+#, c-format
+msgid ""
+"\n"
+"section [%lu] does not exist"
+msgstr ""
+
+#: src/readelf.c:6077
+#, c-format
+msgid ""
+"\n"
+"section '%s' does not exist"
+msgstr ""
+
+#: src/readelf.c:6138
+#, c-format
+msgid "cannot get symbol index of archive '%s': %s"
+msgstr ""
+
+#: src/readelf.c:6141
+#, c-format
+msgid ""
+"\n"
+"Archive '%s' has no symbol index\n"
+msgstr ""
+
+#: src/readelf.c:6145
+#, c-format
+msgid ""
+"\n"
+"Index of archive '%s' has %Zu entries:\n"
+msgstr ""
+
+#: src/readelf.c:6163
+#, c-format
+msgid "cannot extract member at offset %Zu in '%s': %s"
+msgstr ""
+
+#: src/readelf.c:6168
+#, c-format
+msgid "Archive member '%s' contains:\n"
+msgstr ""
+
#: src/size.c:68
msgid ""
"Use the output format FORMAT. FORMAT can be `bsd' or `sysv'. The default "
@@ -1592,62 +1934,62 @@ msgstr ""
msgid "illformed file '%s'"
msgstr ""
-#: src/strip.c:834 src/strip.c:912
+#: src/strip.c:834 src/strip.c:913
#, c-format
msgid "while generating output file: %s"
msgstr ""
-#: src/strip.c:885 src/strip.c:1616
+#: src/strip.c:886 src/strip.c:1627
#, c-format
msgid "%s: error while creating ELF header: %s"
msgstr ""
-#: src/strip.c:899
+#: src/strip.c:900
#, c-format
msgid "while preparing output for '%s'"
msgstr ""
-#: src/strip.c:950 src/strip.c:1006
+#: src/strip.c:951 src/strip.c:1007
#, c-format
msgid "while create section header section: %s"
msgstr ""
-#: src/strip.c:956
+#: src/strip.c:957
#, c-format
msgid "cannot allocate section data: %s"
msgstr ""
-#: src/strip.c:1015
+#: src/strip.c:1016
#, c-format
msgid "while create section header string table: %s"
msgstr ""
-#: src/strip.c:1541 src/strip.c:1638
+#: src/strip.c:1552 src/strip.c:1649
#, c-format
msgid "while writing '%s': %s"
msgstr ""
-#: src/strip.c:1552
+#: src/strip.c:1563
#, c-format
msgid "while creating '%s'"
msgstr ""
-#: src/strip.c:1564
+#: src/strip.c:1575
#, c-format
msgid "while computing checksum for debug information"
msgstr ""
-#: src/strip.c:1624
+#: src/strip.c:1635
#, c-format
msgid "%s: error while reading the file: %s"
msgstr ""
-#: src/strip.c:1666 src/strip.c:1673
+#: src/strip.c:1677 src/strip.c:1684
#, c-format
msgid "error while finishing '%s': %s"
msgstr ""
-#: src/strip.c:1696 src/strip.c:1753
+#: src/strip.c:1707 src/strip.c:1764
#, c-format
msgid "cannot set access and modification date of '%s'"
msgstr ""
@@ -2291,1350 +2633,1385 @@ msgstr ""
msgid "Pedantic checking of ELF files compliance with gABI/psABI spec."
msgstr ""
-#: src/elflint.c:177
+#: src/elflint.c:161
+#, c-format
+msgid "cannot generate Elf descriptor: %s\n"
+msgstr ""
+
+#: src/elflint.c:180
#, c-format
msgid "error while closing Elf descriptor: %s\n"
msgstr ""
-#: src/elflint.c:181
+#: src/elflint.c:184
msgid "No errors"
msgstr ""
-#: src/elflint.c:303
+#: src/elflint.c:298
+#, c-format
+msgid " error while freeing sub-ELF descriptor: %s\n"
+msgstr ""
+
+#: src/elflint.c:306
#, c-format
msgid "Not an ELF file - it has the wrong magic bytes at the start\n"
msgstr ""
-#: src/elflint.c:362
+#: src/elflint.c:365
#, c-format
msgid "e_ident[%d] == %d is no known class\n"
msgstr ""
-#: src/elflint.c:367
+#: src/elflint.c:370
#, c-format
msgid "e_ident[%d] == %d is no known data encoding\n"
msgstr ""
-#: src/elflint.c:371
+#: src/elflint.c:374
#, c-format
msgid "unknown ELF header version number e_ident[%d] == %d\n"
msgstr ""
-#: src/elflint.c:376
+#: src/elflint.c:379
#, c-format
msgid "unsupported OS ABI e_ident[%d] == '%s'\n"
msgstr ""
-#: src/elflint.c:382
+#: src/elflint.c:385
#, c-format
msgid "unsupport ABI version e_ident[%d] == %d\n"
msgstr ""
-#: src/elflint.c:387
+#: src/elflint.c:390
#, c-format
msgid "e_ident[%zu] is not zero\n"
msgstr ""
-#: src/elflint.c:392
+#: src/elflint.c:395
#, c-format
msgid "unknown object file type %d\n"
msgstr ""
-#: src/elflint.c:399
+#: src/elflint.c:402
#, c-format
msgid "unknown machine type %d\n"
msgstr ""
-#: src/elflint.c:403
+#: src/elflint.c:406
#, c-format
msgid "unknown object file version\n"
msgstr ""
-#: src/elflint.c:409
+#: src/elflint.c:412
#, c-format
msgid "invalid program header offset\n"
msgstr ""
-#: src/elflint.c:411
+#: src/elflint.c:414
#, c-format
msgid "executables and DSOs cannot have zero program header offset\n"
msgstr ""
-#: src/elflint.c:415
+#: src/elflint.c:418
#, c-format
msgid "invalid number of program header entries\n"
msgstr ""
-#: src/elflint.c:423
+#: src/elflint.c:426
#, c-format
msgid "invalid section header table offset\n"
msgstr ""
-#: src/elflint.c:426
+#: src/elflint.c:429
#, c-format
msgid "section header table must be present\n"
msgstr ""
-#: src/elflint.c:440
+#: src/elflint.c:443
#, c-format
msgid "invalid number of section header table entries\n"
msgstr ""
-#: src/elflint.c:457
+#: src/elflint.c:460
#, c-format
msgid "invalid section header index\n"
msgstr ""
-#: src/elflint.c:462
+#: src/elflint.c:465
#, c-format
msgid "invalid machine flags: %s\n"
msgstr ""
-#: src/elflint.c:469 src/elflint.c:486
+#: src/elflint.c:472 src/elflint.c:489
#, c-format
msgid "invalid ELF header size: %hd\n"
msgstr ""
-#: src/elflint.c:472 src/elflint.c:489
+#: src/elflint.c:475 src/elflint.c:492
#, c-format
msgid "invalid program header size: %hd\n"
msgstr ""
-#: src/elflint.c:475 src/elflint.c:492
+#: src/elflint.c:478 src/elflint.c:495
#, c-format
msgid "invalid program header position or size\n"
msgstr ""
-#: src/elflint.c:478 src/elflint.c:495
+#: src/elflint.c:481 src/elflint.c:498
#, c-format
msgid "invalid section header size: %hd\n"
msgstr ""
-#: src/elflint.c:481 src/elflint.c:498
+#: src/elflint.c:484 src/elflint.c:501
#, c-format
msgid "invalid section header position or size\n"
msgstr ""
-#: src/elflint.c:542
+#: 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:546
+#: src/elflint.c:549
#, c-format
msgid ""
"section [%2d] '%s': section group [%2zu] '%s' does not preceed group member\n"
msgstr ""
-#: src/elflint.c:562 src/elflint.c:1374 src/elflint.c:1424 src/elflint.c:1534
-#: src/elflint.c:2126 src/elflint.c:2624 src/elflint.c:2785 src/elflint.c:2915
+#: src/elflint.c:565 src/elflint.c:1386 src/elflint.c:1436 src/elflint.c:1546
+#: src/elflint.c:2138 src/elflint.c:2639 src/elflint.c:2800 src/elflint.c:2930
+#: src/elflint.c:3716
#, c-format
msgid "section [%2d] '%s': cannot get section data\n"
msgstr ""
-#: src/elflint.c:574 src/elflint.c:1541
+#: src/elflint.c:577 src/elflint.c:1553
#, 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:596
+#: src/elflint.c:599
#, c-format
msgid ""
"section [%2d] '%s': symbol table cannot have more than one extended index "
"section\n"
msgstr ""
-#: src/elflint.c:607
+#: src/elflint.c:610
#, c-format
msgid "section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"
msgstr ""
-#: src/elflint.c:616
+#: src/elflint.c:619
#, c-format
msgid "section [%2d] '%s': cannot get symbol %d: %s\n"
msgstr ""
-#: src/elflint.c:621 src/elflint.c:624 src/elflint.c:627 src/elflint.c:630
-#: src/elflint.c:633 src/elflint.c:636
+#: src/elflint.c:624 src/elflint.c:627 src/elflint.c:630 src/elflint.c:633
+#: src/elflint.c:636 src/elflint.c:639
#, c-format
msgid "section [%2d] '%s': '%s' in zeroth entry not zero\n"
msgstr ""
-#: src/elflint.c:639
+#: src/elflint.c:642
#, c-format
msgid "section [%2d] '%s': XINDEX for zeroth entry not zero\n"
msgstr ""
-#: src/elflint.c:649
+#: src/elflint.c:652
#, c-format
msgid "section [%2d] '%s': cannot get symbol %zu: %s\n"
msgstr ""
-#: src/elflint.c:656
+#: src/elflint.c:659
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid name value\n"
msgstr ""
-#: src/elflint.c:669
+#: src/elflint.c:672
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: too large section index but no extended "
"section index section\n"
msgstr ""
-#: src/elflint.c:675
+#: src/elflint.c:678
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in "
"st_shndx (%<PRIu32>)\n"
msgstr ""
-#: src/elflint.c:687
+#: src/elflint.c:690
#, c-format
msgid "section [%2d] '%s': symbol %zu: invalid section index\n"
msgstr ""
-#: src/elflint.c:695
+#: src/elflint.c:698
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown type\n"
msgstr ""
-#: src/elflint.c:699
+#: src/elflint.c:702
#, c-format
msgid "section [%2d] '%s': symbol %zu: unknown symbol binding\n"
msgstr ""
-#: src/elflint.c:707
+#: src/elflint.c:710
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"
msgstr ""
-#: src/elflint.c:711
+#: src/elflint.c:714
#, c-format
msgid "section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"
msgstr ""
-#: src/elflint.c:715
+#: src/elflint.c:718
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"
msgstr ""
-#: src/elflint.c:746
+#: src/elflint.c:750
#, c-format
msgid "section [%2d] '%s': symbol %zu: st_value out of bounds\n"
msgstr ""
-#: src/elflint.c:752 src/elflint.c:777 src/elflint.c:820
+#: src/elflint.c:756 src/elflint.c:781 src/elflint.c:824
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu does not fit completely in referenced section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:761
+#: src/elflint.c:765
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have "
"SHF_TLS flag set\n"
msgstr ""
-#: src/elflint.c:771 src/elflint.c:813
+#: src/elflint.c:775 src/elflint.c:817
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section "
"[%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:798
+#: src/elflint.c:802
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"
msgstr ""
-#: src/elflint.c:806
+#: src/elflint.c:810
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] '%"
"s'\n"
msgstr ""
-#: src/elflint.c:833
+#: src/elflint.c:837
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: local symbol outside range described in "
"sh_info\n"
msgstr ""
-#: src/elflint.c:840
+#: src/elflint.c:844
#, c-format
msgid ""
"section [%2d] '%s': symbol %zu: non-local symbol outside range described in "
"sh_info\n"
msgstr ""
-#: src/elflint.c:847
+#: src/elflint.c:851
#, c-format
msgid "section [%2d] '%s': symbol %zu: non-local section symbol\n"
msgstr ""
-#: src/elflint.c:894
+#: src/elflint.c:901
#, c-format
msgid ""
-"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section\n"
+"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section [%"
+"2d]\n"
msgstr ""
-#: src/elflint.c:899
+#: src/elflint.c:908
#, c-format
msgid ""
-"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to '%s' section\n"
+"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to section [%2d] '%"
+"s'\n"
msgstr ""
-#: src/elflint.c:913
+#: src/elflint.c:924
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#<PRIx64> does not "
"match %s section address %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:920
+#: src/elflint.c:931
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %<PRIu64> does not "
"match %s section size %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:928
+#: src/elflint.c:939
#, c-format
msgid ""
"section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got "
"section\n"
msgstr ""
-#: src/elflint.c:944
+#: src/elflint.c:955
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC_ symbol value %#<PRIx64> does not match dynamic "
"segment address %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:951
+#: src/elflint.c:962
#, c-format
msgid ""
"section [%2d] '%s': _DYNAMIC symbol size %<PRIu64> does not match dynamic "
"segment size %<PRIu64>\n"
msgstr ""
-#: src/elflint.c:1002
+#: src/elflint.c:1013
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"
msgstr ""
-#: src/elflint.c:1011 src/elflint.c:1063
+#: src/elflint.c:1022 src/elflint.c:1074
#, c-format
msgid "section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"
msgstr ""
-#: src/elflint.c:1036 src/elflint.c:1088
+#: src/elflint.c:1047 src/elflint.c:1099
#, c-format
msgid ""
"section [%2d] '%s': relative relocations after index %d as specified by "
"DT_RELCOUNT\n"
msgstr ""
-#: src/elflint.c:1042 src/elflint.c:1094
+#: src/elflint.c:1053 src/elflint.c:1105
#, c-format
msgid ""
"section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT "
"specified %d relative relocations\n"
msgstr ""
-#: src/elflint.c:1054
+#: src/elflint.c:1065
#, c-format
msgid "section [%2d] '%s': DT_RELACOUNT used for this REL section\n"
msgstr ""
-#: src/elflint.c:1136
+#: src/elflint.c:1147
#, c-format
msgid "section [%2d] '%s': invalid destination section index\n"
msgstr ""
-#: src/elflint.c:1149
+#: src/elflint.c:1160
#, c-format
msgid "section [%2d] '%s': invalid destination section type\n"
msgstr ""
-#: src/elflint.c:1157
+#: src/elflint.c:1168
#, c-format
msgid "section [%2d] '%s': sh_info should be zero\n"
msgstr ""
-#: src/elflint.c:1164
+#: src/elflint.c:1175
#, c-format
msgid "section [%2d] '%s': no relocations for merge-able sections possible\n"
msgstr ""
-#: src/elflint.c:1171
+#: src/elflint.c:1182
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Rela\n"
msgstr ""
-#: src/elflint.c:1172
-#, c-format
-msgid "section [%2d] '%s': section entry size does not match ElfXX_Rel\n"
-msgstr ""
-
-#: src/elflint.c:1231
+#: src/elflint.c:1242
#, c-format
msgid "text relocation flag set but there is no read-only segment\n"
msgstr ""
-#: src/elflint.c:1258
+#: src/elflint.c:1269
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid type\n"
msgstr ""
-#: src/elflint.c:1266
+#: src/elflint.c:1277
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: relocation type invalid for the file "
"type\n"
msgstr ""
-#: src/elflint.c:1274
+#: src/elflint.c:1285
#, c-format
msgid "section [%2d] '%s': relocation %zu: invalid symbol index\n"
msgstr ""
-#: src/elflint.c:1292
+#: src/elflint.c:1303
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can "
"be used with %s\n"
msgstr ""
-#: src/elflint.c:1308
+#: src/elflint.c:1320
#, c-format
msgid "section [%2d] '%s': relocation %zu: offset out of bounds\n"
msgstr ""
-#: src/elflint.c:1323
+#: src/elflint.c:1335
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: copy relocation against symbol of type %"
"s\n"
msgstr ""
-#: src/elflint.c:1344
+#: src/elflint.c:1356
#, c-format
msgid ""
"section [%2d] '%s': relocation %zu: read-only section modified but text "
"relocation flag not set\n"
msgstr ""
-#: src/elflint.c:1359
+#: src/elflint.c:1371
#, c-format
msgid "section [%2d] '%s': relocations are against loaded and unloaded data\n"
msgstr ""
-#: src/elflint.c:1398 src/elflint.c:1448
+#: src/elflint.c:1410 src/elflint.c:1460
#, c-format
msgid "section [%2d] '%s': cannot get relocation %zu: %s\n"
msgstr ""
-#: src/elflint.c:1529
+#: src/elflint.c:1541
#, c-format
msgid "more than one dynamic section present\n"
msgstr ""
-#: src/elflint.c:1547
+#: src/elflint.c:1559
#, c-format
msgid "section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"
msgstr ""
-#: src/elflint.c:1552 src/elflint.c:1844
+#: src/elflint.c:1564 src/elflint.c:1856
#, c-format
msgid "section [%2d] '%s': sh_info not zero\n"
msgstr ""
-#: src/elflint.c:1562
+#: src/elflint.c:1574
#, c-format
msgid "section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"
msgstr ""
-#: src/elflint.c:1570
+#: src/elflint.c:1582
#, c-format
msgid "section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"
msgstr ""
-#: src/elflint.c:1577
+#: src/elflint.c:1589
#, c-format
msgid "section [%2d] '%s': entry %zu: unknown tag\n"
msgstr ""
-#: src/elflint.c:1588
+#: src/elflint.c:1600
#, c-format
msgid "section [%2d] '%s': entry %zu: more than one entry with tag %s\n"
msgstr ""
-#: src/elflint.c:1598
+#: src/elflint.c:1610
#, c-format
msgid "section [%2d] '%s': entry %zu: level 2 tag %s used\n"
msgstr ""
-#: src/elflint.c:1616
+#: src/elflint.c:1628
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"
msgstr ""
-#: src/elflint.c:1638
+#: src/elflint.c:1650
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: pointer does not match address of section [%"
"2d] '%s' referenced by sh_link\n"
msgstr ""
-#: src/elflint.c:1681
+#: src/elflint.c:1693
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"
msgstr ""
-#: src/elflint.c:1696
+#: src/elflint.c:1708
#, c-format
msgid ""
"section [%2d] '%s': entry %zu: %s value must be valid offset in section [%"
"2d] '%s'\n"
msgstr ""
-#: src/elflint.c:1716 src/elflint.c:1744
+#: src/elflint.c:1728 src/elflint.c:1756
#, c-format
msgid "section [%2d] '%s': contains %s entry but not %s\n"
msgstr ""
-#: src/elflint.c:1728
+#: src/elflint.c:1740
#, c-format
msgid "section [%2d] '%s': mandatory tag %s not present\n"
msgstr ""
-#: src/elflint.c:1737
+#: src/elflint.c:1749
#, c-format
msgid "section [%2d] '%s': no hash section present\n"
msgstr ""
-#: src/elflint.c:1752 src/elflint.c:1759
+#: src/elflint.c:1764 src/elflint.c:1771
#, c-format
msgid "section [%2d] '%s': not all of %s, %s, and %s are present\n"
msgstr ""
-#: src/elflint.c:1769 src/elflint.c:1773
+#: src/elflint.c:1781 src/elflint.c:1785
#, c-format
msgid "section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"
msgstr ""
-#: src/elflint.c:1779
+#: src/elflint.c:1791
#, c-format
msgid "section [%2d] '%s': non-DSO file marked as dependency during prelink\n"
msgstr ""
-#: src/elflint.c:1790 src/elflint.c:1794 src/elflint.c:1798 src/elflint.c:1802
+#: src/elflint.c:1802 src/elflint.c:1806 src/elflint.c:1810 src/elflint.c:1814
#, c-format
msgid "section [%2d] '%s': %s tag missing in prelinked executable\n"
msgstr ""
-#: src/elflint.c:1814
+#: src/elflint.c:1826
#, c-format
msgid ""
"section [%2d] '%s': only relocatable files can have extended section index\n"
msgstr ""
-#: src/elflint.c:1824
+#: src/elflint.c:1836
#, c-format
msgid ""
"section [%2d] '%s': extended section index section not for symbol table\n"
msgstr ""
-#: src/elflint.c:1829
+#: src/elflint.c:1841
#, c-format
msgid "cannot get data for symbol section\n"
msgstr ""
-#: src/elflint.c:1832
+#: src/elflint.c:1844
#, c-format
msgid "section [%2d] '%s': entry size does not match Elf32_Word\n"
msgstr ""
-#: src/elflint.c:1839
+#: src/elflint.c:1851
#, c-format
msgid "section [%2d] '%s': extended index table too small for symbol table\n"
msgstr ""
-#: src/elflint.c:1854
+#: src/elflint.c:1866
#, c-format
msgid ""
"section [%2d] '%s': extended section index in section [%2zu] '%s' refers to "
"same symbol table\n"
msgstr ""
-#: src/elflint.c:1865
+#: src/elflint.c:1877
#, c-format
msgid "symbol 0 should have zero extended section index\n"
msgstr ""
-#: src/elflint.c:1877
+#: src/elflint.c:1889
#, c-format
msgid "cannot get data for symbol %zu\n"
msgstr ""
-#: src/elflint.c:1882
+#: src/elflint.c:1894
#, c-format
msgid "extended section index is %<PRIu32> but symbol index is not XINDEX\n"
msgstr ""
-#: src/elflint.c:1898 src/elflint.c:1939
+#: src/elflint.c:1910 src/elflint.c:1951
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"
msgstr ""
-#: src/elflint.c:1910 src/elflint.c:1951
+#: src/elflint.c:1922 src/elflint.c:1963
#, c-format
msgid "section [%2d] '%s': chain array too large\n"
msgstr ""
-#: src/elflint.c:1919 src/elflint.c:1960
+#: src/elflint.c:1931 src/elflint.c:1972
#, c-format
msgid "section [%2d] '%s': hash bucket reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:1925
+#: src/elflint.c:1937
#, c-format
msgid "section [%2d] '%s': hash chain reference %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:1966
+#: src/elflint.c:1978
#, c-format
msgid "section [%2d] '%s': hash chain reference %<PRIu64> out of bounds\n"
msgstr ""
-#: src/elflint.c:1981
+#: src/elflint.c:1993
#, c-format
msgid "section [%2d] '%s': bitmask size not power of 2: %u\n"
msgstr ""
-#: src/elflint.c:1992
+#: src/elflint.c:2004
#, c-format
msgid ""
"section [%2d] '%s': hash table section is too small (is %ld, expected at "
"least%ld)\n"
msgstr ""
-#: src/elflint.c:2000
+#: src/elflint.c:2012
#, c-format
msgid "section [%2d] '%s': 2nd hash function shift too big: %u\n"
msgstr ""
-#: src/elflint.c:2032
+#: src/elflint.c:2044
#, c-format
msgid ""
"section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"
msgstr ""
-#: src/elflint.c:2053
+#: src/elflint.c:2065
#, c-format
msgid ""
"section [%2d] '%s': symbol %u referenced in chain for bucket %zu is "
"undefined\n"
msgstr ""
-#: src/elflint.c:2063
+#: src/elflint.c:2075
#, c-format
msgid ""
"section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"
msgstr ""
-#: src/elflint.c:2093
+#: src/elflint.c:2105
#, c-format
msgid "section [%2d] '%s': hash chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2098
+#: src/elflint.c:2110
#, c-format
msgid ""
"section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"
msgstr ""
-#: src/elflint.c:2104
+#: src/elflint.c:2116
#, c-format
msgid "section [%2d] '%s': bitmask does not match names in the hash table\n"
msgstr ""
-#: src/elflint.c:2117
+#: src/elflint.c:2129
#, c-format
msgid "section [%2d] '%s': relocatable files cannot have hash tables\n"
msgstr ""
-#: src/elflint.c:2135
+#: src/elflint.c:2147
#, c-format
msgid "section [%2d] '%s': hash table not for dynamic symbol table\n"
msgstr ""
-#: src/elflint.c:2143
+#: src/elflint.c:2155
#, c-format
msgid "section [%2d] '%s': hash table entry size incorrect\n"
msgstr ""
-#: src/elflint.c:2148
+#: src/elflint.c:2160
#, c-format
msgid "section [%2d] '%s': not marked to be allocated\n"
msgstr ""
-#: src/elflint.c:2153
+#: src/elflint.c:2165
#, c-format
msgid ""
"section [%2d] '%s': hash table has not even room for initial administrative "
"entries\n"
msgstr ""
-#: src/elflint.c:2201
+#: src/elflint.c:2213
#, c-format
msgid "sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"
msgstr ""
-#: src/elflint.c:2279 src/elflint.c:2283
+#: src/elflint.c:2291 src/elflint.c:2295
#, c-format
msgid "section [%2zu] '%s': reference to symbol index 0\n"
msgstr ""
-#: src/elflint.c:2290
+#: src/elflint.c:2302
#, c-format
msgid ""
"symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2302
+#: src/elflint.c:2314
#, c-format
msgid ""
"symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash "
"table in [%2zu] '%s'\n"
msgstr ""
-#: src/elflint.c:2318
+#: src/elflint.c:2330
#, c-format
msgid "section [%2d] '%s': nonzero sh_%s for NULL section\n"
msgstr ""
-#: src/elflint.c:2338
+#: src/elflint.c:2350
#, c-format
msgid ""
"section [%2d] '%s': section groups only allowed in relocatable object files\n"
msgstr ""
-#: src/elflint.c:2349
+#: src/elflint.c:2361
#, c-format
msgid "section [%2d] '%s': cannot get symbol table: %s\n"
msgstr ""
-#: src/elflint.c:2354
+#: src/elflint.c:2366
#, c-format
msgid "section [%2d] '%s': section reference in sh_link is no symbol table\n"
msgstr ""
-#: src/elflint.c:2360
+#: src/elflint.c:2372
#, c-format
msgid "section [%2d] '%s': invalid symbol index in sh_info\n"
msgstr ""
-#: src/elflint.c:2365
+#: src/elflint.c:2377
#, c-format
msgid "section [%2d] '%s': sh_flags not zero\n"
msgstr ""
-#: src/elflint.c:2370
+#: src/elflint.c:2382
#, c-format
msgid "section [%2d] '%s': sh_flags not set correctly\n"
msgstr ""
-#: src/elflint.c:2376
+#: src/elflint.c:2388
#, c-format
msgid "section [%2d] '%s': cannot get data: %s\n"
msgstr ""
-#: src/elflint.c:2385
+#: src/elflint.c:2397
#, c-format
msgid "section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"
msgstr ""
-#: src/elflint.c:2390
+#: src/elflint.c:2402
#, c-format
msgid "section [%2d] '%s': section group without flags word\n"
msgstr ""
-#: src/elflint.c:2396
+#: src/elflint.c:2408
#, c-format
msgid "section [%2d] '%s': section group without member\n"
msgstr ""
-#: src/elflint.c:2400
+#: src/elflint.c:2412
#, c-format
msgid "section [%2d] '%s': section group with only one member\n"
msgstr ""
-#: src/elflint.c:2411
+#: src/elflint.c:2423
#, c-format
msgid "section [%2d] '%s': unknown section group flags\n"
msgstr ""
-#: src/elflint.c:2423
+#: src/elflint.c:2435
#, c-format
msgid "section [%2d] '%s': section index %Zu out of range\n"
msgstr ""
-#: src/elflint.c:2432
+#: src/elflint.c:2444
#, c-format
msgid "section [%2d] '%s': cannot get section header for element %zu: %s\n"
msgstr ""
-#: src/elflint.c:2439
+#: src/elflint.c:2451
#, c-format
msgid "section [%2d] '%s': section group contains another group [%2d] '%s'\n"
msgstr ""
-#: src/elflint.c:2445
+#: src/elflint.c:2457
#, c-format
msgid ""
"section [%2d] '%s': element %Zu references section [%2d] '%s' without "
"SHF_GROUP flag set\n"
msgstr ""
-#: src/elflint.c:2452
+#: src/elflint.c:2464
#, c-format
msgid "section [%2d] '%s' is contained in more than one section group\n"
msgstr ""
-#: src/elflint.c:2638
+#: src/elflint.c:2653
#, 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:2649
+#: src/elflint.c:2664
#, c-format
msgid ""
"section [%2d] '%s' has different number of entries than symbol table [%2d] '%"
"s'\n"
msgstr ""
-#: src/elflint.c:2665
+#: src/elflint.c:2680
#, c-format
msgid "section [%2d] '%s': symbol %d: cannot read version data\n"
msgstr ""
-#: src/elflint.c:2681
+#: src/elflint.c:2696
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with global scope\n"
msgstr ""
-#: src/elflint.c:2689
+#: src/elflint.c:2704
#, c-format
msgid "section [%2d] '%s': symbol %d: local symbol with version\n"
msgstr ""
-#: src/elflint.c:2703
+#: src/elflint.c:2718
#, c-format
msgid "section [%2d] '%s': symbol %d: invalid version index %d\n"
msgstr ""
-#: src/elflint.c:2708
+#: src/elflint.c:2723
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for defined version\n"
msgstr ""
-#: src/elflint.c:2718
+#: src/elflint.c:2733
#, c-format
msgid ""
"section [%2d] '%s': symbol %d: version index %d is for requested version\n"
msgstr ""
-#: src/elflint.c:2770
+#: src/elflint.c:2785
#, c-format
msgid "more than one version reference section present\n"
msgstr ""
-#: src/elflint.c:2778 src/elflint.c:2907
+#: src/elflint.c:2793 src/elflint.c:2922
#, c-format
msgid "section [%2d] '%s': sh_link does not link to string table\n"
msgstr ""
-#: src/elflint.c:2801 src/elflint.c:2959
+#: src/elflint.c:2816 src/elflint.c:2974
#, c-format
msgid "section [%2d] '%s': entry %d has wrong version %d\n"
msgstr ""
-#: src/elflint.c:2807 src/elflint.c:2965
+#: src/elflint.c:2822 src/elflint.c:2980
#, c-format
msgid "section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"
msgstr ""
-#: src/elflint.c:2815
+#: src/elflint.c:2830
#, c-format
msgid "section [%2d] '%s': entry %d has invalid file reference\n"
msgstr ""
-#: src/elflint.c:2823
+#: src/elflint.c:2838
#, c-format
msgid "section [%2d] '%s': entry %d references unknown dependency\n"
msgstr ""
-#: src/elflint.c:2835
+#: src/elflint.c:2850
#, c-format
msgid "section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:2842
+#: src/elflint.c:2857
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has invalid name "
"reference\n"
msgstr ""
-#: src/elflint.c:2849
+#: src/elflint.c:2864
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: %"
"#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:2859
+#: src/elflint.c:2874
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version "
"name '%s'\n"
msgstr ""
-#: src/elflint.c:2870
+#: src/elflint.c:2885
#, c-format
msgid ""
"section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"
msgstr ""
-#: src/elflint.c:2886 src/elflint.c:3044
+#: src/elflint.c:2901 src/elflint.c:3059
#, c-format
msgid "section [%2d] '%s': entry %d has invalid offset to next entry\n"
msgstr ""
-#: src/elflint.c:2899
+#: src/elflint.c:2914
#, c-format
msgid "more than one version definition section present\n"
msgstr ""
-#: src/elflint.c:2944
+#: src/elflint.c:2959
#, c-format
msgid "section [%2d] '%s': more than one BASE definition\n"
msgstr ""
-#: src/elflint.c:2948
+#: src/elflint.c:2963
#, c-format
msgid "section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"
msgstr ""
-#: src/elflint.c:2954
+#: src/elflint.c:2969
#, c-format
msgid "section [%2d] '%s': entry %d has unknown flag\n"
msgstr ""
-#: src/elflint.c:2978
+#: src/elflint.c:2993
#, c-format
msgid "section [%2d] '%s': entry %d has invalid name reference\n"
msgstr ""
-#: src/elflint.c:2985
+#: src/elflint.c:3000
#, c-format
msgid "section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"
msgstr ""
-#: src/elflint.c:2994
+#: src/elflint.c:3009
#, c-format
msgid "section [%2d] '%s': entry %d has duplicate version name '%s'\n"
msgstr ""
-#: src/elflint.c:3013
+#: src/elflint.c:3028
#, c-format
msgid ""
"section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3028
+#: src/elflint.c:3043
#, c-format
msgid "section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"
msgstr ""
-#: src/elflint.c:3050
+#: src/elflint.c:3065
#, c-format
msgid "section [%2d] '%s': no BASE definition\n"
msgstr ""
-#: src/elflint.c:3066
+#: src/elflint.c:3081
#, c-format
msgid "section [%2d] '%s': unknown parent version '%s'\n"
msgstr ""
-#: src/elflint.c:3146
+#: src/elflint.c:3166
#, c-format
msgid "cannot get section header of zeroth section\n"
msgstr ""
-#: src/elflint.c:3150
+#: src/elflint.c:3170
#, c-format
msgid "zeroth section has nonzero name\n"
msgstr ""
-#: src/elflint.c:3152
+#: src/elflint.c:3172
#, c-format
msgid "zeroth section has nonzero type\n"
msgstr ""
-#: src/elflint.c:3154
+#: src/elflint.c:3174
#, c-format
msgid "zeroth section has nonzero flags\n"
msgstr ""
-#: src/elflint.c:3156
+#: src/elflint.c:3176
#, c-format
msgid "zeroth section has nonzero address\n"
msgstr ""
-#: src/elflint.c:3158
+#: src/elflint.c:3178
#, c-format
msgid "zeroth section has nonzero offset\n"
msgstr ""
-#: src/elflint.c:3160
+#: src/elflint.c:3180
#, c-format
msgid "zeroth section has nonzero info field\n"
msgstr ""
-#: src/elflint.c:3162
+#: src/elflint.c:3182
#, c-format
msgid "zeroth section has nonzero align value\n"
msgstr ""
-#: src/elflint.c:3164
+#: src/elflint.c:3184
#, c-format
msgid "zeroth section has nonzero entry size value\n"
msgstr ""
-#: src/elflint.c:3167
+#: src/elflint.c:3187
#, c-format
msgid ""
"zeroth section has nonzero size value while ELF header has nonzero shnum "
"value\n"
msgstr ""
-#: src/elflint.c:3171
+#: src/elflint.c:3191
#, c-format
msgid ""
"zeroth section has nonzero link value while ELF header does not signal "
"overflow in shstrndx\n"
msgstr ""
-#: src/elflint.c:3186
+#: src/elflint.c:3206
#, c-format
msgid "cannot get section header for section [%2zu] '%s': %s\n"
msgstr ""
-#: src/elflint.c:3195
+#: src/elflint.c:3215
#, c-format
msgid "section [%2zu]: invalid name\n"
msgstr ""
-#: src/elflint.c:3217
+#: src/elflint.c:3242
#, c-format
msgid "section [%2d] '%s' has wrong type: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3231
+#: src/elflint.c:3258
#, c-format
msgid "section [%2zu] '%s' has wrong flags: expected %s, is %s\n"
msgstr ""
-#: src/elflint.c:3248
+#: src/elflint.c:3275
#, c-format
msgid ""
"section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"
msgstr ""
-#: src/elflint.c:3266
+#: src/elflint.c:3293
#, c-format
msgid "section [%2zu] '%s' present in object file\n"
msgstr ""
-#: src/elflint.c:3272 src/elflint.c:3304
+#: src/elflint.c:3299 src/elflint.c:3331
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"
msgstr ""
-#: src/elflint.c:3277 src/elflint.c:3309
+#: src/elflint.c:3304 src/elflint.c:3336
#, c-format
msgid ""
"section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable "
"segments\n"
msgstr ""
-#: src/elflint.c:3285
+#: src/elflint.c:3312
#, c-format
msgid ""
"section [%2zu] '%s' is extension section index table in non-object file\n"
msgstr ""
-#: src/elflint.c:3320
+#: src/elflint.c:3347
#, c-format
msgid "section [%2zu] '%s': size not multiple of entry size\n"
msgstr ""
-#: src/elflint.c:3325
+#: src/elflint.c:3352
#, c-format
msgid "cannot get section header\n"
msgstr ""
-#: src/elflint.c:3334
+#: src/elflint.c:3361
#, c-format
msgid "section [%2zu] '%s' has unsupported type %d\n"
msgstr ""
-#: src/elflint.c:3348
+#: src/elflint.c:3375
#, c-format
msgid ""
"section [%2zu] '%s' contains invalid processor-specific flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3355
+#: src/elflint.c:3382
#, c-format
msgid "section [%2zu] '%s' contains unknown flag(s) %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3363
+#: src/elflint.c:3390
#, c-format
msgid "section [%2zu] '%s': thread-local data sections address not zero\n"
msgstr ""
-#: src/elflint.c:3371
+#: src/elflint.c:3398
#, c-format
msgid "section [%2zu] '%s': invalid section reference in link value\n"
msgstr ""
-#: src/elflint.c:3376
+#: src/elflint.c:3403
#, c-format
msgid "section [%2zu] '%s': invalid section reference in info value\n"
msgstr ""
-#: src/elflint.c:3383
+#: src/elflint.c:3410
#, c-format
msgid "section [%2zu] '%s': strings flag set without merge flag\n"
msgstr ""
-#: src/elflint.c:3388
+#: src/elflint.c:3415
#, c-format
msgid "section [%2zu] '%s': merge flag set but entry size is zero\n"
msgstr ""
-#: src/elflint.c:3415
+#: src/elflint.c:3444
#, c-format
msgid ""
"section [%2zu] '%s' not fully contained in segment of program header entry %"
"d\n"
msgstr ""
-#: src/elflint.c:3423
+#: src/elflint.c:3452
#, 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:3432
+#: src/elflint.c:3461
#, 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:3441
+#: src/elflint.c:3470
#, c-format
msgid ""
"section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"
msgstr ""
-#: src/elflint.c:3447
+#: src/elflint.c:3476
#, 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:3455
+#: src/elflint.c:3484
#, c-format
msgid ""
"section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"
msgstr ""
-#: src/elflint.c:3502
+#: src/elflint.c:3535
#, c-format
msgid "more than one version symbol table present\n"
msgstr ""
-#: src/elflint.c:3521
+#: src/elflint.c:3554
#, c-format
msgid "INTERP program header entry but no .interp section\n"
msgstr ""
-#: src/elflint.c:3526
+#: src/elflint.c:3559
#, c-format
msgid ""
"no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section "
"exist\n"
msgstr ""
-#: src/elflint.c:3539
+#: src/elflint.c:3572
#, c-format
msgid "duplicate version index %d\n"
msgstr ""
-#: src/elflint.c:3553
+#: src/elflint.c:3586
#, c-format
msgid ".gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"
msgstr ""
-#: src/elflint.c:3568
+#: src/elflint.c:3635
+#, c-format
+msgid "phdr[%d]: unknown core file note type %<PRIu32> at offset %<PRIu64>\n"
+msgstr ""
+
+#: src/elflint.c:3639
+#, c-format
+msgid ""
+"section [%2d] '%s': unknown core file note type %<PRIu32> at offset %Zu\n"
+msgstr ""
+
+#: src/elflint.c:3661
+#, c-format
+msgid "phdr[%d]: unknown object file note type %<PRIu32> at offset %Zu\n"
+msgstr ""
+
+#: src/elflint.c:3665
+#, c-format
+msgid ""
+"section [%2d] '%s': unknown object file note type %<PRIu32> at offset %Zu\n"
+msgstr ""
+
+#: src/elflint.c:3681
#, c-format
msgid "phdr[%d]: no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:3655
+#: src/elflint.c:3700
+#, c-format
+msgid "phdr[%d]: cannot get content of note section: %s\n"
+msgstr ""
+
+#: src/elflint.c:3703
#, c-format
-msgid "phdr[%d]: note entries probably in form of a 32-bit ELF file\n"
+msgid "phdr[%d]: extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:3658
+#: src/elflint.c:3723
#, c-format
-msgid "phdr[%d]: extra %zu bytes after last note\n"
+msgid "section [%2d] '%s': no note entries defined for the type of file\n"
msgstr ""
-#: src/elflint.c:3687
+#: src/elflint.c:3730
#, c-format
-msgid "phdr[%d]: unknown core file note type %<PRIu64> at offset %<PRIu64>\n"
+msgid "section [%2d] '%s': cannot get content of note section\n"
msgstr ""
-#: src/elflint.c:3695
+#: src/elflint.c:3733
#, c-format
-msgid "phdr[%d]: unknown object file note type %<PRIu64> at offset %<PRIu64>\n"
+msgid "section [%2d] '%s': extra %<PRIu64> bytes after last note\n"
msgstr ""
-#: src/elflint.c:3717
+#: src/elflint.c:3746
#, c-format
msgid ""
"only executables, shared objects, and core files can have program headers\n"
msgstr ""
-#: src/elflint.c:3732
+#: src/elflint.c:3761
#, c-format
msgid "cannot get program header entry %d: %s\n"
msgstr ""
-#: src/elflint.c:3741
+#: src/elflint.c:3770
#, c-format
msgid "program header entry %d: unknown program header entry type %#<PRIx64>\n"
msgstr ""
-#: src/elflint.c:3752
+#: src/elflint.c:3781
#, c-format
msgid "more than one INTERP entry in program header\n"
msgstr ""
-#: src/elflint.c:3760
+#: src/elflint.c:3789
#, c-format
msgid "more than one TLS entry in program header\n"
msgstr ""
-#: src/elflint.c:3767
+#: src/elflint.c:3796
#, c-format
msgid "static executable cannot have dynamic sections\n"
msgstr ""
-#: src/elflint.c:3781
+#: src/elflint.c:3810
#, c-format
msgid "dynamic section reference in program header has wrong offset\n"
msgstr ""
-#: src/elflint.c:3784
+#: src/elflint.c:3813
#, c-format
msgid "dynamic section size mismatch in program and section header\n"
msgstr ""
-#: src/elflint.c:3794
+#: src/elflint.c:3823
#, c-format
msgid "more than one GNU_RELRO entry in program header\n"
msgstr ""
-#: src/elflint.c:3815
+#: src/elflint.c:3844
#, c-format
msgid "loadable segment GNU_RELRO applies to is not writable\n"
msgstr ""
-#: src/elflint.c:3818
+#: src/elflint.c:3847
#, c-format
msgid "loadable segment GNU_RELRO applies to is executable\n"
msgstr ""
-#: src/elflint.c:3825 src/elflint.c:3848
+#: src/elflint.c:3854 src/elflint.c:3877
#, c-format
msgid "%s segment not contained in a loaded segment\n"
msgstr ""
-#: src/elflint.c:3854
+#: src/elflint.c:3883
#, c-format
msgid "program header offset in ELF header and PHDR entry do not match"
msgstr ""
-#: src/elflint.c:3860
+#: src/elflint.c:3889
#, c-format
msgid "program header entry %d: file size greater than memory size\n"
msgstr ""
-#: src/elflint.c:3867
+#: src/elflint.c:3896
#, c-format
msgid "program header entry %d: alignment not a power of 2\n"
msgstr ""
-#: src/elflint.c:3870
+#: src/elflint.c:3899
#, c-format
msgid ""
"program header entry %d: file offset and virtual address not module of "
"alignment\n"
msgstr ""
-#: src/elflint.c:3906
+#: src/elflint.c:3935
#, c-format
msgid "cannot read ELF header: %s\n"
msgstr ""
-#: src/elflint.c:3927
+#: src/elflint.c:3956
#, c-format
msgid "text relocation flag set but not needed\n"
msgstr ""
-#: src/addr2line.c:64 src/strings.c:70
-msgid "Output Selection:"
+#: src/addr2line.c:64
+msgid "Output selection options:"
msgstr ""
#: src/addr2line.c:65
@@ -3649,12 +4026,16 @@ msgstr ""
msgid "Also show function names"
msgstr ""
-#: src/addr2line.c:79
+#: src/addr2line.c:69
+msgid "Also show symbol or section names"
+msgstr ""
+
+#: src/addr2line.c:80
msgid ""
"Locate source files and line information for ADDRs (in a.out by default)."
msgstr ""
-#: src/addr2line.c:83
+#: src/addr2line.c:84
msgid "[ADDR...]"
msgstr ""
@@ -3674,7 +4055,7 @@ msgstr ""
msgid "Locate source of text relocations in FILEs (a.out by default)."
msgstr ""
-#: src/findtextrel.c:234 src/elfcmp.c:558 src/ranlib.c:186
+#: src/findtextrel.c:234 src/elfcmp.c:575 src/ranlib.c:186
#, c-format
msgid "cannot create ELF descriptor for '%s': %s"
msgstr ""
@@ -3760,123 +4141,127 @@ msgid ""
"a relocation modifies memory at offset %llu in a write-protected segment\n"
msgstr ""
-#: src/elfcmp.c:67
+#: src/elfcmp.c:68
msgid "Control options:"
msgstr ""
-#: src/elfcmp.c:68
+#: src/elfcmp.c:69
msgid ""
"Control treatment of gaps in loadable segments [ignore|match] (default: "
"ignore)"
msgstr ""
-#: src/elfcmp.c:69
+#: src/elfcmp.c:71
+msgid "Ignore permutation of buckets in SHT_HASH section"
+msgstr ""
+
+#: src/elfcmp.c:72
msgid "Output nothing; yield exit status only"
msgstr ""
-#: src/elfcmp.c:76
+#: src/elfcmp.c:79
msgid "Compare relevant parts of two ELF files for equality."
msgstr ""
-#: src/elfcmp.c:80
+#: src/elfcmp.c:83
msgid "FILE1 FILE2"
msgstr ""
-#: src/elfcmp.c:131
+#: src/elfcmp.c:139
msgid "Invalid number of parameters.\n"
msgstr ""
-#: src/elfcmp.c:159 src/elfcmp.c:164
+#: src/elfcmp.c:167 src/elfcmp.c:172
#, c-format
msgid "cannot get ELF header of '%s': %s"
msgstr ""
-#: src/elfcmp.c:181
+#: src/elfcmp.c:189
#, c-format
msgid "%s %s diff: ELF header"
msgstr ""
-#: src/elfcmp.c:239
+#: src/elfcmp.c:247
#, c-format
msgid "%s %s differ: section header"
msgstr ""
-#: src/elfcmp.c:265 src/elfcmp.c:271
+#: src/elfcmp.c:273 src/elfcmp.c:279
#, c-format
msgid "cannot get content of section %zu in '%s': %s"
msgstr ""
-#: src/elfcmp.c:287 src/elfcmp.c:293
+#: src/elfcmp.c:295 src/elfcmp.c:301
#, c-format
msgid "cannot get symbol in '%s': %s"
msgstr ""
-#: src/elfcmp.c:314
+#: src/elfcmp.c:322
#, c-format
msgid "%s %s differ: symbol table [%zu]"
msgstr ""
-#: src/elfcmp.c:317
+#: src/elfcmp.c:325
#, c-format
msgid "%s %s differ: symbol table [%zu,%zu]"
msgstr ""
-#: src/elfcmp.c:359
+#: src/elfcmp.c:373
#, c-format
msgid "%s %s differ: section [%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:364
+#: src/elfcmp.c:377
#, c-format
msgid "%s %s differ: section [%zu,%zu] '%s' content"
msgstr ""
-#: src/elfcmp.c:380
+#: src/elfcmp.c:393
#, c-format
msgid "%s %s differ: unequal amount of important sections"
msgstr ""
-#: src/elfcmp.c:414 src/elfcmp.c:419
+#: src/elfcmp.c:427 src/elfcmp.c:432
#, c-format
msgid "cannot load data of '%s': %s"
msgstr ""
-#: src/elfcmp.c:438 src/elfcmp.c:444
+#: src/elfcmp.c:451 src/elfcmp.c:457
#, c-format
msgid "cannot get program header entry %d of '%s': %s"
msgstr ""
-#: src/elfcmp.c:450
+#: src/elfcmp.c:463
#, c-format
msgid "%s %s differ: program header %d"
msgstr ""
-#: src/elfcmp.c:475
+#: src/elfcmp.c:488
#, c-format
msgid "%s %s differ: gap"
msgstr ""
-#: src/elfcmp.c:534
+#: src/elfcmp.c:547
#, c-format
msgid "Invalid value '%s' for --gaps parameter."
msgstr ""
-#: src/elfcmp.c:563
+#: src/elfcmp.c:580
#, c-format
msgid "cannot create EBL descriptor for '%s'"
msgstr ""
-#: src/elfcmp.c:581
+#: src/elfcmp.c:598
#, c-format
msgid "cannot get section header of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:591
+#: src/elfcmp.c:608
#, c-format
msgid "cannot get content of section %zu: %s"
msgstr ""
-#: src/elfcmp.c:601 src/elfcmp.c:615
+#: src/elfcmp.c:618 src/elfcmp.c:632
#, c-format
msgid "cannot get relocation: %s"
msgstr ""
@@ -3914,6 +4299,10 @@ msgstr ""
msgid "cannot create new file"
msgstr ""
+#: src/strings.c:70
+msgid "Output Selection:"
+msgstr ""
+
#: src/strings.c:71
msgid "Scan entire file, not only loaded sections"
msgstr ""
diff --git a/elfutils/po/remove-potcdate.sin b/elfutils/po/remove-potcdate.sin
new file mode 100644
index 00000000..2436c49e
--- /dev/null
+++ b/elfutils/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/elfutils/po/stamp-po b/elfutils/po/stamp-po
new file mode 100644
index 00000000..9788f702
--- /dev/null
+++ b/elfutils/po/stamp-po
@@ -0,0 +1 @@
+timestamp
diff --git a/elfutils/src/ChangeLog b/elfutils/src/ChangeLog
index ce2c2ea7..20436a1a 100644
--- a/elfutils/src/ChangeLog
+++ b/elfutils/src/ChangeLog
@@ -1,3 +1,397 @@
+2007-11-09 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (attr_callback): Handle DW_AT_data_location.
+
+2007-10-20 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (options): Update -R description.
+ (struct symbol): Put symbol details a union with a size_t pointer
+ `duplicate'.
+ (compare_symbols_output): Use null ->name as marker for discard
+ symbols, not zero *->map.
+ (copy_elided_sections): Record forwarding pointers for discarded
+ duplicates and fill SYMNDX_MAP elements through them.
+
+ * readelf.c (process_file): Set offline_next_address to 0 at start.
+ (struct process_dwflmod_args): New type.
+ (process_dwflmod): Take args in it, pass fd to process_elf_file.
+ (process_file): Update caller; dup FD for passing to libdwfl.
+ (process_elf_file): Take new arg FD. For ET_REL file when
+ displaying data affected by libdwfl relocation, open a new Elf handle.
+
+2007-10-17 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_debug_line_section): For invalid data inside a
+ unit with plausible length, keep printing at the next unit boundary.
+
+ * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
+
+2007-10-16 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+
+2007-10-15 Roland McGrath <roland@redhat.com>
+
+ * make-debug-archive.in: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+ (make-debug-archive): New target.
+ (bin_SCRIPTS, CLEANFILES): Add it.
+
+2007-10-10 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
+ Use it to check MERGE|STRINGS for .debug_str.
+ (check_sections): Handle exact_or_gnuld.
+
+2007-10-08 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
+ 64-bit struct timeval with 32-bit tv_usec.
+
+2007-10-07 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (check_archive_index): New function.
+ (process_file): Call it. Change signature to take only fd and name.
+ Use libdwfl to open the file, then iterate on its modules (multiple
+ for an archive) to print file name and call process_elf_file.
+ (main): Update caller. Let process_file do elf_begin.
+ (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
+ (process_elf_file): Take only Dwfl_Module * argument.
+ Don't print the file name here.
+ (print_debug_*_section): Take Dwfl_Module * argument.
+ (print_debug): Likewise. Update caller.
+ (format_dwarf_addr): New function.
+ (print_debug_ranges_section): Use it.
+ (attr_callback): Likewise.
+ (print_debug_line_section, print_debug_loc_section): Likewise.
+
+ * readelf.c (print_debug_ranges_section): Translate all strings.
+ (print_debug_loc_section): Likewise.
+
+ * unstrip.c (copy_elided_sections): Initialize SEC.
+
+ * ar.c (do_oper_insert): Put trailing / on short names.
+
+ * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
+
+ * arlib2.c (arlib_add_long_name): Adjust for header size.
+
+ * arlib.c (arlib_finalize): Pad long name table to keep size even.
+
+ * ar.c (do_oper_insert): Use write_retry for padding write.
+
+ * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
+ Unconditionally set FOUND[CNT]->elf when setting ->mem.
+ (remember_long_name): New function.
+ (do_oper_insert): Call it. Correctly use length of basename,
+ not original name. Don't store long name twice for new member.
+
+2007-10-06 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_note): Skip empty segment.
+ (check_note_section): Skip empty section.
+
+ * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
+ (handle_output_dir_module, handle_implicit_modules): Pass it down.
+ (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
+ (compare_alloc_sections): Take new arg REL, ignore address if true.
+ (compare_sections): Likewise, pass it down.
+ (compare_sections_rel, compare_sections_nonrel): New functions.
+ (find_alloc_sections_prelink, copy_elided_sections): Use them
+ instead of compare_sections.
+ (sections_match): New function, broken out of ...
+ (find_alloc_section): ... here.
+ (copy_elided_sections): Reorganize section match-up logic.
+ Use sections_match for SHF_ALLOC in ET_REL.
+ For ET_REL, let the nonzero sh_addr from the debug file dominate.
+
+ * unstrip.c (add_new_section_symbols): Take new arg REL.
+ When true, do not update section symbol values.
+ (collect_symbols): Likewise. Update section symbols with address
+ of chosen output section, not original section.
+ (check_symtab_section_symbols, copy_elided_sections): Update callers.
+
+ * unstrip.c (compare_alloc_sections): At the same address, preserve
+ original section order.
+
+ * elflint.c (special_sections): Don't require MERGE|STRINGS for
+ .debug_str, it didn't always have them with older tools.
+
+ * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
+
+2007-10-05 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
+ ET_REL file.
+
+ * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
+ SHN_UNDEF as "bad section". Use shndx value in messages.
+
+ * elflint.c (special_sections): Add ".debug_str". Decrement namelen
+ for ".debug" so it matches as a prefix.
+ (IS_KNOWN_SPECIAL): New macro.
+ (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
+ type even under -d, for a .debug* or .shstrtab section.
+
+ * readelf.c (print_ops): Use hex for address operand.
+
+2007-10-04 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
+ .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
+ sections mapped to SHN_UNDEF.
+
+2007-10-04 Ulrich Drepper <drepper@redhat.com>
+
+ * readelf.c (dump_archive_index): Avoid warning about uninitialized
+ variable with older glibc versions.
+ Add some branch prediction.
+
+2007-10-04 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_archive_index): New variable.
+ (options, parse_opt): Accept -c/--archive-index to set it.
+ (dump_archive_index): New function.
+ (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
+ Call dump_archive_index on archives if set.
+ (main): Update caller.
+ (any_control_option): Give it file scope, moved out of ...
+ (parse_opt): ... here.
+
+2007-10-03 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (struct arg_info): Add `list' flag.
+ (options, parse_opt): Grok -n/--list to set it.
+ (list_module): New function.
+ (handle_implicit_modules): Call it under -n.
+
+ * elflint.c (check_note_section): New function.
+ (check_sections): Call it for SHT_NOTE.
+
+ * readelf.c (handle_notes): Use sections when available.
+
+ * elflint.c (check_note_data): New function, broken out of ...
+ (check_note): ... here. Call it and elf_getdata_rawchunk.
+
+ * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
+ Use elf_getdata_rawchunk and gelf_getauxv.
+ (handle_notes_data): New function, broken out of ...
+ (handle_notes): ... here. Call it and elf_getdata_rawchunk.
+
+2007-10-01 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
+
+ * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
+
+2007-09-10 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (options): Give -p optional argument, alias --string-dump.
+ (string_sections, string_sections_tail): New static variables.
+ (parse_opt): Set them when -p has an argument.
+ (print_string_section): New function, broken out of ...
+ (print_strings): ... here. Call it.
+ (dump_data_section): New function, broken out of ...
+ (dump_data): ... here. Call it.
+ (for_each_section_argument): New function, broken out of ...
+ (dump_data): ... here. Call it.
+ (dump_strings): New function.
+
+2007-08-31 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_strings): Typo fix.
+
+2007-08-23 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (printf_with_wrap): Function removed.
+ (REGISTER_WRAP_COLUMN): New macro.
+ (handle_core_register): Use print_core_item instead.
+ (struct register_info): New type.
+ (compare_registers, compare_register_sets): New functions.
+ (register_bitpos, compare_sets_by_info): New functions.
+ (handle_core_registers): Use those to segregate and sort registers
+ for display.
+
+ * readelf.c (ITEM_WRAP_COLUMN): New macro.
+ (print_core_item): New function.
+ (handle_core_item): Use it instead of printf_with_wrap.
+ (compare_core_items, compare_core_item_groups): New functions.
+ (handle_core_items): Use them. Sort by group and force line breaks
+ between groups.
+
+ * readelf.c (handle_core_registers, handle_core_items): New functions,
+ broken out of ...
+ (handle_core_note): ... here. Call them.
+
+2007-08-22 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (new_shstrtab): New function, broken out of ...
+ (copy_elided_sections): ... here.
+
+2007-08-20 Roland McGrath <roland@redhat.com>
+
+ Avoid local function trampolines in nm binary.
+ * nm.c (sort_by_address): Move to a static function instead of local
+ inside show_symbols.
+ (sort_by_name_strtab): New static variable.
+ (sort_by_name): Use it. Move to a static function instead of local
+ inside show_symbols.
+ (show_symbols): Set sort_by_name_strtab.
+
+2007-08-19 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (handle_auxv_note): New function.
+ (handle_notes): Call it.
+
+ * readelf.c (printf_with_wrap, convert): New functions.
+ (handle_core_item, (handle_core_register): New functions.
+ (handle_notes): Call those with details from ebl_core_note.
+
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_note): Accept type 0 with name "Linux".
+
+ * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
+
+ * elflint.c (section_flags_string): Return "none" for 0, not "".
+
+2007-08-11 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
+
+2007-08-04 Ulrich Drepper <drepper@redhat.com>
+
+ * readelf.c (hex_dump): Use isprint to determine whether to print
+ character itself or full stop character.
+ (dump_data): No need to check endp for NULL after strtol call.
+
+2007-08-03 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_string_sections): New variable.
+ (options, parse_opt): Handle --strings/-p to set it.
+ (print_strings): New function.
+ (process_elf_file): Call it under -p.
+
+ * readelf.c (options): Add hidden aliases --segments, --sections,
+ as taken by binutils readelf.
+
+2007-08-01 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (dump_data_sections, dump_data_sections_tail):
+ New variables.
+ (options, parse_opt): Handle --hex-dump/-x, set them.
+ (hex_dump): New function.
+ (dump_data): New function, call it.
+ (process_elf_file): Call it.
+
+2007-07-25 Roland McGrath <roland@redhat.com>
+
+ * addr2line.c (show_symbols): New variable.
+ (print_addrsym): New function.
+ (handle_address): Call it.
+ (options, parse_opt): Handle -S/--symbols.
+
+2007-06-05 Ulrich Drepper <drepper@redhat.com>
+
+ * addr2line.c: Update for latest autoconf header.
+ * ar.c: Likewise.
+ * elfcmp.c: Likewise.
+ * elflint.c: Likewise.
+ * findtextrel.c: Likewise.
+ * ld.c: Likewise.
+ * ldgeneric.c: Likewise.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
+2007-05-18 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
+ stripped file, so as not to duplicate a section copied in both.
+
+ * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
+
+2007-05-17 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
+
+ * unstrip.c (handle_file): Tweak BIAS != 0 warning.
+
+ * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
+ call make_directories here.
+ (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
+ (handle_dwfl_module): Likewise.
+ (handle_implicit_modules): Update callers.
+ (handle_output_dir_module): Likewise. Don't do make_directories here.
+
+ * unstrip.c (get_section_name): New function, broken out of ...
+ (copy_elided_sections): here. Update callers.
+ (find_alloc_section): Broken out of ...
+ (copy_elided_sections): ... here. Update caller.
+ (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
+ update STT_SECTION symbols' st_value fields as a side effect.
+ (check_symtab_section_symbols): Update caller.
+ (add_new_section_symbols): Set st_value in symbols added.
+ (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
+ Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
+ from .bss to .dynbss.
+ (find_alloc_sections_prelink): New function. Associate debug file
+ allocated SHT_NOBITS shdrs with stripped moved by prelink via
+ .gnu.prelink_undo information.
+ (copy_elided_sections): Call it when we couldn't find every allocated
+ section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
+ Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
+ (handle_file): Update callers.
+
+ * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
+ named ".comment".
+
+ * elflint.c (check_sections): Fix association of segments with
+ sections when p_memsz > p_filesz.
+
+2007-04-29 Roland McGrath <roland@redhat.com>
+
+ * addr2line.c (options, main): Tweak argp group settings to fix
+ usage output.
+
+2007-04-28 Roland McGrath <roland@redhat.com>
+
+ * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
+ sizes to match sections adjusted in the stripped file.
+
+2007-04-24 Roland McGrath <roland@redhat.com>
+
+ * elfcmp.c (OPT_HASH_INEXACT): New macro.
+ (hash_inexact): New variable.
+ (options, parse_opt): Add --hash-inexact option to set it.
+ (hash_content_equivalent): New function.
+ (main): Call it for differing SHT_HASH sections under --hash-inexact.
+
+2007-04-23 Roland McGrath <roland@redhat.com>
+
+ * unstrip.c: New file.
+ * Makefile.am (bin_PROGRAMS): Add it.
+ (unstrip_LDADD): New variable.
+
+ * strip.c (options): Allow --output for -o.
+
+2007-02-15 Ulrich Drepper <drepper@redhat.com>
+
+ * readelf.c: Remove unused code. Add a few consts.
+
+2007-02-15 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_debug): Fix brainos in SHDR test.
+
+2007-02-05 Roland McGrath <roland@redhat.com>
+
+ * ar.c: Include <limits.h>, since we use LONG_MAX.
+
2007-02-05 Ulrich Drepper <drepper@redhat.com>
* ar.c: Add ugly hack to work around gcc complaining that we
diff --git a/elfutils/src/Makefile.am b/elfutils/src/Makefile.am
index 230a8178..138be5a3 100644
--- a/elfutils/src/Makefile.am
+++ b/elfutils/src/Makefile.am
@@ -52,7 +52,7 @@ native_ld = @native_ld@
base_cpu = @base_cpu@
bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
- elfcmp objdump ranlib strings ar
+ elfcmp objdump ranlib strings ar unstrip
ld_dsos = libld_elf_i386_pic.a
@@ -84,6 +84,10 @@ noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules) arlib.h
ld_modules = i386_ld.c
+bin_SCRIPTS = make-debug-archive
+EXTRA_DIST += make-debug-archive.in
+CLEANFILES = make-debug-archive
+
if MUDFLAP
libmudflap = -lmudflap
endif
@@ -123,6 +127,7 @@ ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
strings_LDADD = $(libelf) $(libeu) $(libmudflap)
ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
CFLAGS_ar = -DAR=\"$(shell echo ar|sed '$(transform)')\"
+unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl
ldlex.o: ldscript.c
ldlex_no_Werror = yes
@@ -175,6 +180,17 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
done; \
done; rm -f c$${pid}_.???; exit $$bad
-CLEANFILES = none_ld.os $(ld_modules:.c=.os) *.gcno *.gcda *.gconv
+CLEANFILES += none_ld.os $(ld_modules:.c=.os) *.gcno *.gcda *.gconv
MAINTAINERCLEANFILES = ldlex.c ldscript.c ldscript.h
+
+
+make-debug-archive: $(srcdir)/make-debug-archive.in
+ UNSTRIP=$(bindir)/`echo unstrip | sed '$(transform)'`; \
+ AR=$(bindir)/`echo ar | sed '$(transform)'`; \
+ sed -e "s,@UNSTRIP@,$$UNSTRIP,g" -e "s,@AR@,$$AR,g" \
+ -e "s%[@]PACKAGE_NAME[@]%$(PACKAGE_NAME)%g" \
+ -e "s%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g" \
+ $(srcdir)/make-debug-archive.in > $@.new
+ chmod +x $@.new
+ mv -f $@.new $@
diff --git a/elfutils/src/Makefile.in b/elfutils/src/Makefile.in
index 8963dad4..84c8d80f 100644
--- a/elfutils/src/Makefile.in
+++ b/elfutils/src/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +16,12 @@
-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
@@ -41,7 +38,8 @@ host_triplet = @host@
bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \
strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \
findtextrel$(EXEEXT) addr2line$(EXEEXT) elfcmp$(EXEEXT) \
- objdump$(EXEEXT) ranlib$(EXEEXT) strings$(EXEEXT) ar$(EXEEXT)
+ objdump$(EXEEXT) ranlib$(EXEEXT) strings$(EXEEXT) ar$(EXEEXT) \
+ unstrip$(EXEEXT)
@NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
# We never build this library but we need to get the dependency files
# of all the linker backends that might be used in a non-generic linker.
@@ -53,11 +51,11 @@ subdir = src
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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -80,112 +78,106 @@ libld_elf_a_OBJECTS = $(am_libld_elf_a_OBJECTS)
libld_elf_i386_pic_a_AR = $(AR) $(ARFLAGS)
libld_elf_i386_pic_a_LIBADD =
libld_elf_i386_pic_a_OBJECTS = $(am_libld_elf_i386_pic_a_OBJECTS)
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
am__EXEEXT_1 = libld_elf_i386.so$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
addr2line_SOURCES = addr2line.c
addr2line_OBJECTS = addr2line.$(OBJEXT)
-@BUILD_STATIC_FALSE@am__DEPENDENCIES_1 = ../libelf/libelf.so
-@BUILD_STATIC_TRUE@am__DEPENDENCIES_1 = ../libelf/libelf.a
-am__DEPENDENCIES_2 = ../libebl/libebl.a
-@BUILD_STATIC_FALSE@am__DEPENDENCIES_3 = ../libdw/libdw.so
-@BUILD_STATIC_TRUE@am__DEPENDENCIES_3 = ../libdw/libdw.a \
-@BUILD_STATIC_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
-am__DEPENDENCIES_4 =
-addr2line_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4)
+@BUILD_STATIC_FALSE@am__DEPENDENCIES_1 = ../libdw/libdw.so
+@BUILD_STATIC_TRUE@am__DEPENDENCIES_1 = ../libdw/libdw.a $(libelf) \
+@BUILD_STATIC_TRUE@ $(libebl)
+am__DEPENDENCIES_2 =
+addr2line_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
ar_SOURCES = ar.c
ar_OBJECTS = ar.$(OBJEXT)
-am__DEPENDENCIES_5 = ../lib/libeu.a
-ar_DEPENDENCIES = libar.a $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) \
- $(am__DEPENDENCIES_4)
+ar_DEPENDENCIES = libar.a $(libelf) $(libeu) $(am__DEPENDENCIES_2)
elfcmp_SOURCES = elfcmp.c
elfcmp_OBJECTS = elfcmp.$(OBJEXT)
-elfcmp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_4)
+elfcmp_DEPENDENCIES = $(libebl) $(libelf) $(am__DEPENDENCIES_2)
elflint_SOURCES = elflint.c
elflint_OBJECTS = elflint.$(OBJEXT)
-elflint_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_4)
+elflint_DEPENDENCIES = $(libebl) $(libelf) $(libeu) \
+ $(am__DEPENDENCIES_2)
findtextrel_SOURCES = findtextrel.c
findtextrel_OBJECTS = findtextrel.$(OBJEXT)
-findtextrel_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_4)
+findtextrel_DEPENDENCIES = $(am__DEPENDENCIES_1) $(libelf) \
+ $(am__DEPENDENCIES_2)
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_6 = libld_elf.a
-ld_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_4) \
- $(am__DEPENDENCIES_6)
+ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__DEPENDENCIES_2) \
+ $(am__append_2)
+ld_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ld_LDFLAGS) $(LDFLAGS) -o \
+ $@
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)
-nm_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) \
- $(am__DEPENDENCIES_4)
+nm_DEPENDENCIES = $(am__DEPENDENCIES_1) $(libebl) $(libelf) $(libeu) \
+ $(am__DEPENDENCIES_2)
objdump_SOURCES = objdump.c
objdump_OBJECTS = objdump.$(OBJEXT)
-objdump_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_4)
+objdump_DEPENDENCIES = $(libebl) $(libelf) $(libeu) \
+ $(am__DEPENDENCIES_2)
ranlib_SOURCES = ranlib.c
ranlib_OBJECTS = ranlib.$(OBJEXT)
-ranlib_DEPENDENCIES = libar.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_4)
+ranlib_DEPENDENCIES = libar.a $(libelf) $(libeu) $(am__DEPENDENCIES_2)
readelf_SOURCES = readelf.c
readelf_OBJECTS = readelf.$(OBJEXT)
-readelf_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) \
- $(am__DEPENDENCIES_4)
+readelf_DEPENDENCIES = $(am__DEPENDENCIES_1) $(libebl) $(libelf) \
+ $(libeu) $(am__DEPENDENCIES_2)
size_SOURCES = size.c
size_OBJECTS = size.$(OBJEXT)
-size_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) \
- $(am__DEPENDENCIES_4)
+size_DEPENDENCIES = $(libelf) $(libeu) $(am__DEPENDENCIES_2)
strings_SOURCES = strings.c
strings_OBJECTS = strings.$(OBJEXT)
-strings_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) \
- $(am__DEPENDENCIES_4)
+strings_DEPENDENCIES = $(libelf) $(libeu) $(am__DEPENDENCIES_2)
strip_SOURCES = strip.c
strip_OBJECTS = strip.$(OBJEXT)
-strip_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_4)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+strip_DEPENDENCIES = $(libebl) $(libelf) $(libeu) \
+ $(am__DEPENDENCIES_2)
+unstrip_SOURCES = unstrip.c
+unstrip_OBJECTS = unstrip.$(OBJEXT)
+unstrip_DEPENDENCIES = $(libebl) $(libelf) $(am__DEPENDENCIES_1) \
+ $(libeu) $(am__DEPENDENCIES_2)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||
LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
+YLWRAP = $(top_srcdir)/config/ylwrap
+@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
SOURCES = $(libar_a_SOURCES) $(libdummy_a_SOURCES) \
$(libld_elf_a_SOURCES) $(libld_elf_i386_pic_a_SOURCES) \
addr2line.c ar.c elfcmp.c elflint.c findtextrel.c \
$(ld_SOURCES) $(libld_elf_i386_so_SOURCES) nm.c objdump.c \
- ranlib.c readelf.c size.c strings.c strip.c
+ ranlib.c readelf.c size.c strings.c strip.c unstrip.c
DIST_SOURCES = $(libar_a_SOURCES) $(am__libdummy_a_SOURCES_DIST) \
$(am__libld_elf_a_SOURCES_DIST) \
$(libld_elf_i386_pic_a_SOURCES) addr2line.c ar.c elfcmp.c \
elflint.c findtextrel.c $(ld_SOURCES) \
$(libld_elf_i386_so_SOURCES) nm.c objdump.c ranlib.c readelf.c \
- size.c strings.c strip.c
+ size.c strings.c strip.c unstrip.c
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -200,13 +192,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -221,19 +209,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -245,20 +226,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@ -d
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -271,28 +250,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \
@MUDFLAP_FALSE@ $(native_ld_cflags) $(if \
@MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) $(if \
@@ -326,8 +316,12 @@ libar_a_SOURCES = arlib.c arlib2.c
noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
ldscript.h xelf.h unaligned.h
-EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules) arlib.h
+EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules) \
+ arlib.h make-debug-archive.in
ld_modules = i386_ld.c
+bin_SCRIPTS = make-debug-archive
+CLEANFILES = make-debug-archive none_ld.os $(ld_modules:.c=.os) *.gcno \
+ *.gcda *.gconv
@MUDFLAP_TRUE@libmudflap = -lmudflap
@BUILD_STATIC_FALSE@libdw = ../libdw/libdw.so
@BUILD_STATIC_TRUE@libdw = ../libdw/libdw.a $(libelf) $(libebl) -ldl
@@ -356,6 +350,7 @@ ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
strings_LDADD = $(libelf) $(libeu) $(libmudflap)
ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
CFLAGS_ar = -DAR=\"$(shell echo ar|sed '$(transform)')\"
+unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl
ldlex_no_Werror = yes
# Machine-specific linker code.
@@ -363,7 +358,6 @@ ldlex_no_Werror = yes
@NATIVE_LD_FALSE@libld_elf_i386_pic_a_SOURCES =
@NATIVE_LD_FALSE@am_libld_elf_i386_pic_a_OBJECTS = i386_ld.os
@NATIVE_LD_FALSE@libld_elf_i386_so_SOURCES =
-CLEANFILES = none_ld.os $(ld_modules:.c=.os) *.gcno *.gcda *.gconv
MAINTAINERCLEANFILES = ldlex.c ldscript.c ldscript.h
all: all-am
@@ -419,7 +413,7 @@ libld_elf_i386_pic.a: $(libld_elf_i386_pic_a_OBJECTS) $(libld_elf_i386_pic_a_DEP
$(RANLIB) libld_elf_i386_pic.a
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
@@ -445,46 +439,83 @@ 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)
+ $(LINK) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS)
ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES)
@rm -f ar$(EXEEXT)
- $(LINK) $(ar_LDFLAGS) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
+ $(LINK) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
elfcmp$(EXEEXT): $(elfcmp_OBJECTS) $(elfcmp_DEPENDENCIES)
@rm -f elfcmp$(EXEEXT)
- $(LINK) $(elfcmp_LDFLAGS) $(elfcmp_OBJECTS) $(elfcmp_LDADD) $(LIBS)
+ $(LINK) $(elfcmp_OBJECTS) $(elfcmp_LDADD) $(LIBS)
elflint$(EXEEXT): $(elflint_OBJECTS) $(elflint_DEPENDENCIES)
@rm -f elflint$(EXEEXT)
- $(LINK) $(elflint_LDFLAGS) $(elflint_OBJECTS) $(elflint_LDADD) $(LIBS)
+ $(LINK) $(elflint_OBJECTS) $(elflint_LDADD) $(LIBS)
findtextrel$(EXEEXT): $(findtextrel_OBJECTS) $(findtextrel_DEPENDENCIES)
@rm -f findtextrel$(EXEEXT)
- $(LINK) $(findtextrel_LDFLAGS) $(findtextrel_OBJECTS) $(findtextrel_LDADD) $(LIBS)
+ $(LINK) $(findtextrel_OBJECTS) $(findtextrel_LDADD) $(LIBS)
ld$(EXEEXT): $(ld_OBJECTS) $(ld_DEPENDENCIES)
@rm -f ld$(EXEEXT)
- $(LINK) $(ld_LDFLAGS) $(ld_OBJECTS) $(ld_LDADD) $(LIBS)
+ $(ld_LINK) $(ld_OBJECTS) $(ld_LDADD) $(LIBS)
@NATIVE_LD_TRUE@libld_elf_i386.so$(EXEEXT): $(libld_elf_i386_so_OBJECTS) $(libld_elf_i386_so_DEPENDENCIES)
@NATIVE_LD_TRUE@ @rm -f libld_elf_i386.so$(EXEEXT)
-@NATIVE_LD_TRUE@ $(LINK) $(libld_elf_i386_so_LDFLAGS) $(libld_elf_i386_so_OBJECTS) $(libld_elf_i386_so_LDADD) $(LIBS)
+@NATIVE_LD_TRUE@ $(LINK) $(libld_elf_i386_so_OBJECTS) $(libld_elf_i386_so_LDADD) $(LIBS)
nm$(EXEEXT): $(nm_OBJECTS) $(nm_DEPENDENCIES)
@rm -f nm$(EXEEXT)
- $(LINK) $(nm_LDFLAGS) $(nm_OBJECTS) $(nm_LDADD) $(LIBS)
+ $(LINK) $(nm_OBJECTS) $(nm_LDADD) $(LIBS)
objdump$(EXEEXT): $(objdump_OBJECTS) $(objdump_DEPENDENCIES)
@rm -f objdump$(EXEEXT)
- $(LINK) $(objdump_LDFLAGS) $(objdump_OBJECTS) $(objdump_LDADD) $(LIBS)
+ $(LINK) $(objdump_OBJECTS) $(objdump_LDADD) $(LIBS)
ranlib$(EXEEXT): $(ranlib_OBJECTS) $(ranlib_DEPENDENCIES)
@rm -f ranlib$(EXEEXT)
- $(LINK) $(ranlib_LDFLAGS) $(ranlib_OBJECTS) $(ranlib_LDADD) $(LIBS)
+ $(LINK) $(ranlib_OBJECTS) $(ranlib_LDADD) $(LIBS)
readelf$(EXEEXT): $(readelf_OBJECTS) $(readelf_DEPENDENCIES)
@rm -f readelf$(EXEEXT)
- $(LINK) $(readelf_LDFLAGS) $(readelf_OBJECTS) $(readelf_LDADD) $(LIBS)
+ $(LINK) $(readelf_OBJECTS) $(readelf_LDADD) $(LIBS)
size$(EXEEXT): $(size_OBJECTS) $(size_DEPENDENCIES)
@rm -f size$(EXEEXT)
- $(LINK) $(size_LDFLAGS) $(size_OBJECTS) $(size_LDADD) $(LIBS)
+ $(LINK) $(size_OBJECTS) $(size_LDADD) $(LIBS)
strings$(EXEEXT): $(strings_OBJECTS) $(strings_DEPENDENCIES)
@rm -f strings$(EXEEXT)
- $(LINK) $(strings_LDFLAGS) $(strings_OBJECTS) $(strings_LDADD) $(LIBS)
+ $(LINK) $(strings_OBJECTS) $(strings_LDADD) $(LIBS)
strip$(EXEEXT): $(strip_OBJECTS) $(strip_DEPENDENCIES)
@rm -f strip$(EXEEXT)
- $(LINK) $(strip_LDFLAGS) $(strip_OBJECTS) $(strip_LDADD) $(LIBS)
+ $(LINK) $(strip_OBJECTS) $(strip_LDADD) $(LIBS)
+unstrip$(EXEEXT): $(unstrip_OBJECTS) $(unstrip_DEPENDENCIES)
+ @rm -f unstrip$(EXEEXT)
+ $(LINK) $(unstrip_OBJECTS) $(unstrip_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+installcheck-binSCRIPTS: $(bin_SCRIPTS)
+ bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
+ esac; \
+ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
+ for opt in --help --version; do \
+ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
+ 2>c$${pid}_.err </dev/null \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -514,48 +545,28 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbolhash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unstrip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versionhash.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.l.c:
- $(LEXCOMPILE) $<
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
- rm -f $(LEX_OUTPUT_ROOT).c
+ $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
.y.c:
- $(YACCCOMPILE) $<
- if test -f y.tab.h; then \
- to=`echo "$*_H" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
- sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
- y.tab.h >$*.ht; \
- rm -f y.tab.h; \
- if cmp -s $*.ht $*.h; then \
- rm -f $*.ht ;\
- else \
- mv $*.ht $*.h; \
- fi; \
- fi
- if test -f y.output; then \
- mv y.output $*.output; \
- fi
- sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
- rm -f y.tab.c
-uninstall-info-am:
+ $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -606,22 +617,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -634,10 +644,10 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -690,13 +700,21 @@ info-am:
install-data-am:
-install-exec-am: install-binPROGRAMS
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
+
+install-html: install-html-am
install-info: install-info-am
install-man:
-installcheck-am: installcheck-binPROGRAMS
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am: installcheck-binPROGRAMS installcheck-binSCRIPTS
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
@@ -715,19 +733,24 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS ctags \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
- install-am install-binPROGRAMS install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installcheck-binPROGRAMS installdirs maintainer-clean \
+ install-am install-binPROGRAMS install-binSCRIPTS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installcheck-binPROGRAMS \
+ installcheck-binSCRIPTS installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-info-am
+ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS
ldlex.o: ldscript.c
@@ -767,6 +790,16 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
+
+make-debug-archive: $(srcdir)/make-debug-archive.in
+ UNSTRIP=$(bindir)/`echo unstrip | sed '$(transform)'`; \
+ AR=$(bindir)/`echo ar | sed '$(transform)'`; \
+ sed -e "s,@UNSTRIP@,$$UNSTRIP,g" -e "s,@AR@,$$AR,g" \
+ -e "s%[@]PACKAGE_NAME[@]%$(PACKAGE_NAME)%g" \
+ -e "s%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g" \
+ $(srcdir)/make-debug-archive.in > $@.new
+ chmod +x $@.new
+ mv -f $@.new $@
# 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/src/addr2line.c b/elfutils/src/addr2line.c
index e133e7af..394d0655 100644
--- a/elfutils/src/addr2line.c
+++ b/elfutils/src/addr2line.c
@@ -61,11 +61,12 @@ 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:"), 0 },
+ { NULL, 0, NULL, 0, N_("Output selection options:"), 2 },
{ "basenames", 's', NULL, 0, N_("Show only base names of source files"), 0 },
{ "absolute", 'A', NULL, 0,
N_("Show absolute file names using compilation directory"), 0 },
{ "functions", 'f', NULL, 0, N_("Also show function names"), 0 },
+ { "symbols", 'S', NULL, 0, N_("Also show symbol or section names"), 0 },
{ NULL, 0, NULL, 0, N_("Miscellaneous:"), 0 },
/* Unsupported options. */
@@ -107,6 +108,9 @@ static bool use_comp_dir;
/* True if function names should be shown. */
static bool show_functions;
+/* True if ELF symbol or section info should be shown. */
+static bool show_symbols;
+
int
main (int argc, char *argv[])
@@ -124,13 +128,14 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. This includes opening the modules. */
argp_children[0].argp = dwfl_standard_argp ();
+ argp_children[0].group = 1;
Dwfl *dwfl = NULL;
(void) argp_parse (&argp, argc, argv, 0, &remaining, &dwfl);
assert (dwfl != NULL);
@@ -181,7 +186,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "addr2line (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "addr2line (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -220,6 +225,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
show_functions = true;
break;
+ case 'S':
+ show_symbols = true;
+ break;
+
default:
return ARGP_ERR_UNKNOWN;
}
@@ -297,6 +306,29 @@ print_dwarf_function (Dwfl_Module *mod, Dwarf_Addr addr)
}
static void
+print_addrsym (Dwfl_Module *mod, GElf_Addr addr)
+{
+ GElf_Sym s;
+ GElf_Word shndx;
+ const char *name = dwfl_module_addrsym (mod, addr, &s, &shndx);
+ if (name == NULL)
+ {
+ /* No symbol name. Get a section name instead. */
+ int i = dwfl_module_relocate_address (mod, &addr);
+ if (i >= 0)
+ name = dwfl_module_relocation_info (mod, i, NULL);
+ if (name == NULL)
+ puts ("??");
+ else
+ printf ("(%s)+%#" PRIx64 "\n", name, addr);
+ }
+ else if (addr == s.st_value)
+ puts (name);
+ else
+ printf ("%s+%#" PRIx64 "\n", name, addr - s.st_value);
+}
+
+static void
handle_address (GElf_Addr addr, Dwfl *dwfl)
{
Dwfl_Module *mod = dwfl_addrmodule (dwfl, addr);
@@ -305,10 +337,13 @@ handle_address (GElf_Addr addr, Dwfl *dwfl)
{
/* First determine the function name. Use the DWARF information if
possible. */
- if (! print_dwarf_function (mod, addr))
+ if (! print_dwarf_function (mod, addr) && !show_symbols)
puts (dwfl_module_addrname (mod, addr) ?: "??");
}
+ if (show_symbols)
+ print_addrsym (mod, addr);
+
Dwfl_Line *line = dwfl_module_getsrc (mod, addr);
const char *src;
diff --git a/elfutils/src/ar.c b/elfutils/src/ar.c
index 37fa3e03..a9102a55 100644
--- a/elfutils/src/ar.c
+++ b/elfutils/src/ar.c
@@ -33,6 +33,7 @@
#include <fcntl.h>
#include <gelf.h>
#include <libintl.h>
+#include <limits.h>
#include <locale.h>
#include <mcheck.h>
#include <search.h>
@@ -158,10 +159,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* For historical reasons the options in the first parameter need
not be preceded by a dash. Add it now if necessary. */
@@ -280,7 +281,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "ar (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "ar (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -883,6 +884,15 @@ write_member (struct armem *memb, off_t *startp, off_t *lenp, Elf *elf,
return 0;
}
+/* Store the name in the long name table if necessary.
+ Record its offset or -1 if we did not need to use the table. */
+static void
+remember_long_name (struct armem *mem, const char *name, size_t namelen)
+{
+ mem->long_name_off = (namelen > MAX_AR_NAME_LEN
+ ? arlib_add_long_name (name, namelen)
+ : -1l);
+}
static int
do_oper_delete (const char *arfname, char **argv, int argc,
@@ -962,12 +972,7 @@ do_oper_delete (const char *arfname, char **argv, int argc,
arlib_add_symbols (subelf, arfname, arhdr->ar_name, newp->off);
/* Remember long file names. */
- size_t ar_namelen = strlen (arhdr->ar_name);
- if (ar_namelen > MAX_AR_NAME_LEN)
- newp->long_name_off = arlib_add_long_name (arhdr->ar_name,
- ar_namelen);
- else
- newp->long_name_off = -1l;
+ remember_long_name (newp, arhdr->ar_name, strlen (arhdr->ar_name));
}
next:
@@ -1086,6 +1091,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
arlib_init ();
+ /* Initialize early for no_old case. */
+ off_t cur_off = SARMAG;
+
if (fd == -1)
{
if (!suppress_create_msg)
@@ -1117,7 +1125,6 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
/* While iterating over the current content of the archive we must
determine a number of things: which archive members to keep,
which are replaced, and where to insert the new members. */
- off_t cur_off = SARMAG;
Elf_Cmd cmd = ELF_C_READ_MMAP;
Elf *subelf;
while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
@@ -1136,11 +1143,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
newp->mem = NULL;
/* Remember long file names. */
- size_t ar_namelen = strlen (arhdr->ar_name);
- if (ar_namelen > MAX_AR_NAME_LEN)
- newp->long_name_off = arlib_add_long_name (arhdr->ar_name, ar_namelen);
- else
- newp->long_name_off = -1l;
+ remember_long_name (newp, arhdr->ar_name, strlen (arhdr->ar_name));
/* Check whether this is a file we are looking for. */
if (oper != oper_qappend)
@@ -1222,17 +1225,13 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
for (int cnt = 0; cnt < argc; ++cnt)
{
const char *bname = basename (argv[cnt]);
+ size_t bnamelen = strlen (bname);
if (found[cnt] == NULL)
{
found[cnt] = alloca (sizeof (struct armem));
found[cnt]->old_off = -1;
- size_t ar_namelen = strlen (argv[cnt]);
- if (ar_namelen > MAX_AR_NAME_LEN)
- found[cnt]->long_name_off = arlib_add_long_name (bname,
- ar_namelen);
- else
- found[cnt]->long_name_off = -1l;
+ remember_long_name (found[cnt], bname, bnamelen);
}
struct stat newst;
@@ -1274,14 +1273,12 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
printf ("%c - %s\n",
found[cnt]->old_off == -1l ? 'a' : 'r', argv[cnt]);
-#ifdef DEBUG
found[cnt]->elf = newelf;
-#endif
found[cnt]->sec = newst.st_mtime;
found[cnt]->uid = newst.st_uid;
found[cnt]->gid = newst.st_gid;
found[cnt]->mode = newst.st_mode;
- found[cnt]->name = basename (argv[cnt]);
+ found[cnt]->name = bname;
found[cnt]->mem = elf_rawfile (newelf, &found[cnt]->size);
if (found[cnt] == NULL || elf_cntl (newelf, ELF_C_FDDONE) != 0)
@@ -1290,13 +1287,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
close (newfd);
- /* Remember long file names. */
- size_t bnamelen = strlen (bname);
- if (bnamelen > MAX_AR_NAME_LEN)
- found[cnt]->long_name_off = arlib_add_long_name (bname,
- bnamelen);
- else
- found[cnt]->long_name_off = -1l;
+ if (found[cnt]->old_off != -1l)
+ /* Remember long file names. */
+ remember_long_name (found[cnt], bname, bnamelen);
}
}
}
@@ -1448,8 +1441,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
if (all->long_name_off == -1)
{
size_t namelen = strlen (all->name);
- memset (mempcpy (arhdr.ar_name, all->name, namelen),
- ' ', sizeof (arhdr.ar_name) - namelen);
+ char *p = mempcpy (arhdr.ar_name, all->name, namelen);
+ *p++ = '/';
+ memset (p, ' ', sizeof (arhdr.ar_name) - namelen - 1);
}
else
{
@@ -1479,7 +1473,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
/* Pad the file if its size is odd. */
if ((all->size & 1) != 0)
- if (write (newfd, "\n", 1) != 1)
+ if (unlikely (write_retry (newfd, "\n", 1) != 1))
goto nonew_unlink;
}
else
diff --git a/elfutils/src/arlib.c b/elfutils/src/arlib.c
index 1b8785e4..af98454c 100644
--- a/elfutils/src/arlib.c
+++ b/elfutils/src/arlib.c
@@ -118,6 +118,13 @@ arlib_finalize (void)
symtab.longnameslen = obstack_object_size (&symtab.longnamesob);
if (symtab.longnameslen != sizeof (struct ar_hdr))
{
+ if ((symtab.longnameslen & 1) != 0)
+ {
+ /* Add one more byte to make length even. */
+ obstack_grow (&symtab.longnamesob, "\n", 1);
+ ++symtab.longnameslen;
+ }
+
symtab.longnames = obstack_finish (&symtab.longnamesob);
memcpy (&((struct ar_hdr *) symtab.longnames)->ar_size, tmpbuf,
diff --git a/elfutils/src/arlib.h b/elfutils/src/arlib.h
index af8e8e42..fd26d248 100644
--- a/elfutils/src/arlib.h
+++ b/elfutils/src/arlib.h
@@ -35,8 +35,9 @@
#include <sys/types.h>
-/* Maximum length of a file name that fits directly into the ar header. */
-#define MAX_AR_NAME_LEN (sizeof (((struct ar_hdr *) NULL)->ar_name))
+/* Maximum length of a file name that fits directly into the ar header.
+ We cannot use the final byte since a / goes there. */
+#define MAX_AR_NAME_LEN (sizeof (((struct ar_hdr *) NULL)->ar_name) - 1)
/* Words matching in size to archive header. */
diff --git a/elfutils/src/arlib2.c b/elfutils/src/arlib2.c
index 47edb356..7098fec1 100644
--- a/elfutils/src/arlib2.c
+++ b/elfutils/src/arlib2.c
@@ -41,10 +41,10 @@
long int
arlib_add_long_name (const char *filename, size_t filenamelen)
{
- int retval = obstack_object_size (&symtab.longnamesob);
+ size_t size = obstack_object_size (&symtab.longnamesob);
obstack_grow (&symtab.longnamesob, filename, filenamelen);
obstack_grow (&symtab.longnamesob, "/\n", 2);
- return retval;
+ return size - sizeof (struct ar_hdr);
}
diff --git a/elfutils/src/elfcmp.c b/elfutils/src/elfcmp.c
index c5023b9e..bcc2d4bf 100644
--- a/elfutils/src/elfcmp.c
+++ b/elfutils/src/elfcmp.c
@@ -59,13 +59,16 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
const char *argp_program_bug_address = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
-#define OPT_GAPS 0x100
+#define OPT_GAPS 0x100
+#define OPT_HASH_INEXACT 0x101
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
{ NULL, 0, NULL, 0, N_("Control options:"), 0 },
{ "gaps", OPT_GAPS, "ACTION", 0, N_("Control treatment of gaps in loadable segments [ignore|match] (default: ignore)"), 0 },
+ { "hash-inexact", OPT_HASH_INEXACT, NULL, 0,
+ N_("Ignore permutation of buckets in SHT_HASH section"), 0 },
{ "quiet", 'q', NULL, 0, N_("Output nothing; yield exit status only"), 0 },
{ NULL, 0, NULL, 0, N_("Miscellaneous:"), 0 },
@@ -108,6 +111,11 @@ struct region
/* Nonzero if only exit status is wanted. */
static bool quiet;
+/* True iff SHT_HASH treatment should be generous. */
+static bool hash_inexact;
+
+static bool hash_content_equivalent (size_t entsize, Elf_Data *, Elf_Data *);
+
int
main (int argc, char *argv[])
@@ -116,10 +124,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -353,6 +361,12 @@ main (int argc, char *argv[])
&& memcmp (data1->d_buf, data2->d_buf,
data1->d_size) != 0)))
{
+ if (hash_inexact
+ && shdr1->sh_type == SHT_HASH
+ && data1->d_size == data2->d_size
+ && hash_content_equivalent (shdr1->sh_entsize, data1, data2))
+ break;
+
if (! quiet)
{
if (elf_ndxscn (scn1) == elf_ndxscn (scn2))
@@ -360,7 +374,6 @@ main (int argc, char *argv[])
%s %s differ: section [%zu] '%s' content"),
fname1, fname2, elf_ndxscn (scn1), sname1);
else
- if (elf_ndxscn (scn1) == elf_ndxscn (scn2))
error (0, 0, gettext ("\
%s %s differ: section [%zu,%zu] '%s' content"),
fname1, fname2, elf_ndxscn (scn1),
@@ -502,7 +515,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "elfcmp (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "elfcmp (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -539,6 +552,10 @@ parse_opt (int key, char *arg,
}
break;
+ case OPT_HASH_INEXACT:
+ hash_inexact = true;
+ break;
+
default:
return ARGP_ERR_UNKNOWN;
}
@@ -625,7 +642,7 @@ search_for_copy_reloc (Ebl *ebl, size_t scnndx, int symndx)
}
-static int
+static int
regioncompare (const void *p1, const void *p2)
{
const struct region *r1 = (const struct region *) p1;
@@ -635,3 +652,95 @@ regioncompare (const void *p1, const void *p2)
return -1;
return 1;
}
+
+
+static int
+compare_Elf32_Word (const void *p1, const void *p2)
+{
+ const Elf32_Word *w1 = p1;
+ const Elf32_Word *w2 = p2;
+ assert (sizeof (int) >= sizeof (*w1));
+ return (int) *w1 - (int) *w2;
+}
+
+static int
+compare_Elf64_Xword (const void *p1, const void *p2)
+{
+ const Elf64_Xword *w1 = p1;
+ const Elf64_Xword *w2 = p2;
+ return *w1 < *w2 ? -1 : *w1 > *w2 ? 1 : 0;
+}
+
+static bool
+hash_content_equivalent (size_t entsize, Elf_Data *data1, Elf_Data *data2)
+{
+#define CHECK_HASH(Hash_Word) \
+ { \
+ const Hash_Word *const hash1 = data1->d_buf; \
+ const Hash_Word *const hash2 = data2->d_buf; \
+ const size_t nbucket = hash1[0]; \
+ const size_t nchain = hash1[1]; \
+ if (data1->d_size != (2 + nbucket + nchain) * sizeof hash1[0] \
+ || hash2[0] != nbucket || hash2[1] != nchain) \
+ return false; \
+ \
+ const Hash_Word *const bucket1 = &hash1[2]; \
+ const Hash_Word *const chain1 = &bucket1[nbucket]; \
+ const Hash_Word *const bucket2 = &hash2[2]; \
+ const Hash_Word *const chain2 = &bucket2[nbucket]; \
+ \
+ bool chain_ok[nchain]; \
+ Hash_Word temp1[nchain - 1]; \
+ Hash_Word temp2[nchain - 1]; \
+ memset (chain_ok, 0, sizeof chain_ok); \
+ for (size_t i = 0; i < nbucket; ++i) \
+ { \
+ if (bucket1[i] >= nchain || bucket2[i] >= nchain) \
+ return false; \
+ \
+ size_t b1 = 0; \
+ for (size_t p = bucket1[i]; p != STN_UNDEF; p = chain1[p]) \
+ if (p >= nchain || b1 >= nchain - 1) \
+ return false; \
+ else \
+ temp1[b1++] = p; \
+ \
+ size_t b2 = 0; \
+ for (size_t p = bucket2[i]; p != STN_UNDEF; p = chain2[p]) \
+ if (p >= nchain || b2 >= nchain - 1) \
+ return false; \
+ else \
+ temp2[b2++] = p; \
+ \
+ if (b1 != b2) \
+ return false; \
+ \
+ qsort (temp1, b1, sizeof temp1[0], compare_##Hash_Word); \
+ qsort (temp2, b2, sizeof temp2[0], compare_##Hash_Word); \
+ \
+ for (b1 = 0; b1 < b2; ++b1) \
+ if (temp1[b1] != temp2[b1]) \
+ return false; \
+ else \
+ chain_ok[temp1[b1]] = true; \
+ } \
+ \
+ for (size_t i = 0; i < nchain; ++i) \
+ if (!chain_ok[i] && chain1[i] != chain2[i]) \
+ return false; \
+ \
+ return true; \
+ }
+
+ switch (entsize)
+ {
+ case 4:
+ CHECK_HASH (Elf32_Word);
+ break;
+ case 8:
+ CHECK_HASH (Elf64_Xword);
+ break;
+ }
+
+ return false;
+}
diff --git a/elfutils/src/elflint.c b/elfutils/src/elflint.c
index 09c7fbd2..3ddf670f 100644
--- a/elfutils/src/elflint.c
+++ b/elfutils/src/elflint.c
@@ -96,6 +96,9 @@ static void process_file (int fd, Elf *elf, const char *prefix,
bool only_one);
static void process_elf_file (Elf *elf, const char *prefix, const char *suffix,
const char *fname, size_t size, bool only_one);
+static void check_note_section (Ebl *ebl, GElf_Ehdr *ehdr,
+ GElf_Shdr *shdr, int idx);
+
/* Report an error. */
#define ERROR(str, args...) \
@@ -131,7 +134,7 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
/* Initialize the message catalog. */
- textdomain (PACKAGE);
+ textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -228,7 +231,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "elflint (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "elflint (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -724,13 +727,14 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
destshdr = gelf_getshdr (elf_getscn (ebl->elf, xndx), &destshdr_mem);
if (destshdr != NULL)
{
+ GElf_Addr sh_addr = (ehdr->e_type == ET_REL ? 0
+ : destshdr->sh_addr);
if (GELF_ST_TYPE (sym->st_info) != STT_TLS)
{
if (! ebl_check_special_symbol (ebl, ehdr, sym, name,
destshdr))
{
- if ((sym->st_value - destshdr->sh_addr)
- > destshdr->sh_size)
+ if (sym->st_value - sh_addr > destshdr->sh_size)
{
/* GNU ld has severe bugs. When it decides to remove
empty sections it leaves symbols referencing them
@@ -747,7 +751,7 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
section [%2d] '%s': symbol %zu: st_value out of bounds\n"),
idx, section_name (ebl, idx), cnt);
}
- else if ((sym->st_value - destshdr->sh_addr
+ else if ((sym->st_value - 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"),
@@ -887,18 +891,24 @@ section [%2d] '%s': symbol %zu: non-local section symbol\n"),
destshdr = gelf_getshdr (gotscn, &destshdr_mem);
}
- const char *sname = (destshdr == NULL ? NULL
+ const char *sname = ((destshdr == NULL || xndx == SHN_UNDEF)
+ ? NULL
: elf_strptr (ebl->elf, ehdr->e_shstrndx,
destshdr->sh_name));
if (sname == NULL)
- ERROR (gettext ("\
-section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to bad section\n"),
- idx, section_name (ebl, idx));
+ {
+ if (xndx != SHN_UNDEF || ehdr->e_type != ET_REL)
+ ERROR (gettext ("\
+section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to \
+bad section [%2d]\n"),
+ idx, section_name (ebl, idx), xndx);
+ }
else if (strcmp (sname, ".got.plt") != 0
&& strcmp (sname, ".got") != 0)
ERROR (gettext ("\
-section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to '%s' section\n"),
- idx, section_name (ebl, idx), sname);
+section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to \
+section [%2d] '%s'\n"),
+ idx, section_name (ebl, idx), xndx, sname);
if (destshdr != NULL)
{
@@ -906,7 +916,8 @@ section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to '%s' section\n"),
if (!ebl_check_special_symbol (ebl, ehdr, sym, name,
destshdr))
{
- if (sym->st_value != destshdr->sh_addr)
+ if (ehdr->e_type != ET_REL
+ && sym->st_value != destshdr->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. */
@@ -1304,7 +1315,8 @@ section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be u
{
if (destshdr != NULL
&& GELF_R_TYPE (r_info) != 0
- && (r_offset - destshdr->sh_addr) >= destshdr->sh_size)
+ && (r_offset - (ehdr->e_type == ET_REL ? 0
+ : destshdr->sh_addr)) >= destshdr->sh_size)
ERROR (gettext ("\
section [%2d] '%s': relocation %zu: offset out of bounds\n"),
idx, section_name (ebl, idx), cnt);
@@ -2461,6 +2473,9 @@ section [%2d] '%s' is contained in more than one section group\n"),
static const char *
section_flags_string (GElf_Word flags, char *buf, size_t len)
{
+ if (flags == 0)
+ return "none";
+
static const struct
{
GElf_Word flag;
@@ -3080,7 +3095,7 @@ static const struct
const char *name;
size_t namelen;
GElf_Word type;
- enum { unused, exact, atleast } attrflag;
+ enum { unused, exact, atleast, exact_or_gnuld } attrflag;
GElf_Word attr;
GElf_Word attr2;
} special_sections[] =
@@ -3090,7 +3105,8 @@ static const struct
{ ".comment", 8, SHT_PROGBITS, exact, 0, 0 },
{ ".data", 6, SHT_PROGBITS, exact, SHF_ALLOC | SHF_WRITE, 0 },
{ ".data1", 7, SHT_PROGBITS, exact, SHF_ALLOC | SHF_WRITE, 0 },
- { ".debug", 7, SHT_PROGBITS, exact, 0, 0 },
+ { ".debug_str", 11, SHT_PROGBITS, exact_or_gnuld, SHF_MERGE | SHF_STRINGS, 0 },
+ { ".debug", 6, SHT_PROGBITS, exact, 0, 0 },
{ ".dynamic", 9, SHT_DYNAMIC, atleast, SHF_ALLOC, SHF_WRITE },
{ ".dynstr", 8, SHT_STRTAB, exact, SHF_ALLOC, 0 },
{ ".dynsym", 8, SHT_DYNSYM, exact, SHF_ALLOC, 0 },
@@ -3102,7 +3118,7 @@ static const struct
{ ".init_array", 12, SHT_INIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 },
{ ".interp", 8, SHT_PROGBITS, atleast, 0, SHF_ALLOC }, // XXX more tests?
{ ".line", 6, SHT_PROGBITS, exact, 0, 0 },
- { ".note", 6, SHT_NOTE, exact, 0, 0 },
+ { ".note", 6, SHT_NOTE, atleast, 0, SHF_ALLOC },
{ ".plt", 5, SHT_PROGBITS, unused, 0, 0 }, // XXX more tests
{ ".preinit_array", 15, SHT_PREINIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 },
{ ".rela", 5, SHT_RELA, atleast, 0, SHF_ALLOC }, // XXX more tests
@@ -3126,6 +3142,10 @@ static const struct
#define nspecial_sections \
(sizeof (special_sections) / sizeof (special_sections[0]))
+#define IS_KNOWN_SPECIAL(idx, string, prefix) \
+ (special_sections[idx].namelen == sizeof string - (prefix ? 1 : 0) \
+ && !memcmp (special_sections[idx].name, string, \
+ sizeof string - (prefix ? 1 : 0)))
static void
check_sections (Ebl *ebl, GElf_Ehdr *ehdr)
@@ -3207,13 +3227,18 @@ cannot get section header for section [%2zu] '%s': %s\n"),
char stbuf3[100];
GElf_Word good_type = special_sections[s].type;
- if (special_sections[s].namelen == sizeof ".plt" &&
- !memcmp (special_sections[s].name, ".plt", sizeof ".plt")
+ if (IS_KNOWN_SPECIAL (s, ".plt", false)
&& ebl_bss_plt_p (ebl, ehdr))
good_type = SHT_NOBITS;
+ /* In a debuginfo file, any normal section can be SHT_NOBITS.
+ This is only invalid for DWARF sections and .shstrtab. */
if (shdr->sh_type != good_type
- && !(is_debuginfo && shdr->sh_type == SHT_NOBITS))
+ && (shdr->sh_type != SHT_NOBITS
+ || !is_debuginfo
+ || IS_KNOWN_SPECIAL (s, ".debug_str", false)
+ || IS_KNOWN_SPECIAL (s, ".debug", true)
+ || IS_KNOWN_SPECIAL (s, ".shstrtab", false)))
ERROR (gettext ("\
section [%2d] '%s' has wrong type: expected %s, is %s\n"),
(int) cnt, scnname,
@@ -3222,12 +3247,14 @@ section [%2d] '%s' has wrong type: expected %s, is %s\n"),
ebl_section_type_name (ebl, shdr->sh_type,
stbuf2, sizeof (stbuf2)));
- if (special_sections[s].attrflag == exact)
+ if (special_sections[s].attrflag == exact
+ || special_sections[s].attrflag == exact_or_gnuld)
{
/* Except for the link order and group bit all the
other bits should match exactly. */
if ((shdr->sh_flags & ~(SHF_LINK_ORDER | SHF_GROUP))
- != special_sections[s].attr)
+ != special_sections[s].attr
+ && (special_sections[s].attrflag == exact || !gnuld))
ERROR (gettext ("\
section [%2zu] '%s' has wrong flags: expected %s, is %s\n"),
cnt, scnname,
@@ -3407,7 +3434,9 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"),
|| (phdr->p_type == PT_TLS
&& (shdr->sh_flags & SHF_TLS) != 0))
&& phdr->p_offset <= shdr->sh_offset
- && phdr->p_offset + phdr->p_memsz > shdr->sh_offset)
+ && (phdr->p_offset + phdr->p_filesz > shdr->sh_offset
+ || (phdr->p_offset + phdr->p_memsz > shdr->sh_offset
+ && shdr->sh_type == SHT_NOBITS)))
{
/* Found the segment. */
if (phdr->p_offset + phdr->p_memsz
@@ -3494,6 +3523,10 @@ section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"),
check_group (ebl, ehdr, shdr, cnt);
break;
+ case SHT_NOTE:
+ check_note_section (ebl, ehdr, shdr, cnt);
+ break;
+
case SHT_GNU_versym:
/* We cannot process this section now since we have no guarantee
that the verneed and verdef sections have already been read.
@@ -3560,6 +3593,86 @@ no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section exist\
}
+static GElf_Off
+check_note_data (Ebl *ebl, const GElf_Ehdr *ehdr,
+ Elf_Data *data, int shndx, int phndx, GElf_Off start)
+{
+ size_t offset = 0;
+ size_t last_offset = 0;
+ GElf_Nhdr nhdr;
+ size_t name_offset;
+ size_t desc_offset;
+ while (offset < data->d_size
+ && (offset = gelf_getnote (data, offset,
+ &nhdr, &name_offset, &desc_offset)) > 0)
+ {
+ last_offset = offset;
+
+ /* Make sure it is one of the note types we know about. */
+ if (ehdr->e_type == ET_CORE)
+ switch (nhdr.n_type)
+ {
+ case NT_PRSTATUS:
+ case NT_FPREGSET:
+ case NT_PRPSINFO:
+ case NT_TASKSTRUCT: /* NT_PRXREG on Solaris. */
+ case NT_PLATFORM:
+ case NT_AUXV:
+ case NT_GWINDOWS:
+ case NT_ASRS:
+ case NT_PSTATUS:
+ case NT_PSINFO:
+ case NT_PRCRED:
+ case NT_UTSNAME:
+ case NT_LWPSTATUS:
+ case NT_LWPSINFO:
+ case NT_PRFPXREG:
+ /* Known type. */
+ break;
+
+ default:
+ if (shndx == 0)
+ ERROR (gettext ("\
+phdr[%d]: unknown core file note type %" PRIu32 " at offset %" PRIu64 "\n"),
+ phndx, (uint32_t) nhdr.n_type, start + offset);
+ else
+ ERROR (gettext ("\
+section [%2d] '%s': unknown core file note type %" PRIu32
+ " at offset %Zu\n"),
+ shndx, section_name (ebl, shndx),
+ (uint32_t) nhdr.n_type, offset);
+ }
+ else
+ switch (nhdr.n_type)
+ {
+ case NT_GNU_ABI_TAG:
+ case NT_GNU_HWCAP:
+ case NT_GNU_BUILD_ID:
+ break;
+
+ case 0:
+ /* Linux vDSOs use a type 0 note for the kernel version word. */
+ if (nhdr.n_namesz == sizeof "Linux"
+ && !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
+ break;
+
+ default:
+ if (shndx == 0)
+ ERROR (gettext ("\
+phdr[%d]: unknown object file note type %" PRIu32 " at offset %Zu\n"),
+ phndx, (uint32_t) nhdr.n_type, offset);
+ else
+ ERROR (gettext ("\
+section [%2d] '%s': unknown object file note type %" PRIu32
+ " at offset %Zu\n"),
+ shndx, section_name (ebl, shndx),
+ (uint32_t) nhdr.n_type, offset);
+ }
+ }
+
+ return last_offset;
+}
+
static void
check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt)
{
@@ -3573,139 +3686,55 @@ phdr[%d]: no note entries defined for the type of file\n"),
/* 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.
- The p_align field is set to 8 in case the 64-bit format is used.
- In case the p_align value is 0 or 4 the 32-bit format is
- used. */
- GElf_Xword align = phdr->p_align == 0 || phdr->p_align == 4 ? 4 : 8;
-#define ALIGNED_LEN(len) (((len) + align - 1) & ~(align - 1))
-
- GElf_Xword idx = 0;
- while (idx < phdr->p_filesz)
- {
- uint64_t namesz;
- uint64_t descsz;
- uint64_t type;
- uint32_t namesz32;
- uint32_t descsz32;
-
- if (align == 4)
- {
- uint32_t *ptr = (uint32_t *) (notemem + idx);
-
- if ((__BYTE_ORDER == __LITTLE_ENDIAN
- && ehdr->e_ident[EI_DATA] == ELFDATA2MSB)
- || (__BYTE_ORDER == __BIG_ENDIAN
- && ehdr->e_ident[EI_DATA] == ELFDATA2LSB))
- {
- namesz32 = namesz = bswap_32 (*ptr);
- ++ptr;
- descsz32 = descsz = bswap_32 (*ptr);
- ++ptr;
- type = bswap_32 (*ptr);
- }
- else
- {
- namesz32 = namesz = *ptr++;
- descsz32 = descsz = *ptr++;
- type = *ptr;
- }
- }
- else
- {
- uint64_t *ptr = (uint64_t *) (notemem + idx);
- uint32_t *ptr32 = (uint32_t *) (notemem + idx);
-
- if ((__BYTE_ORDER == __LITTLE_ENDIAN
- && ehdr->e_ident[EI_DATA] == ELFDATA2MSB)
- || (__BYTE_ORDER == __BIG_ENDIAN
- && ehdr->e_ident[EI_DATA] == ELFDATA2LSB))
- {
- namesz = bswap_64 (*ptr);
- ++ptr;
- descsz = bswap_64 (*ptr);
- ++ptr;
- type = bswap_64 (*ptr);
-
- namesz32 = bswap_32 (*ptr32);
- ++ptr32;
- descsz32 = bswap_32 (*ptr32);
- }
- else
- {
- namesz = *ptr++;
- descsz = *ptr++;
- type = *ptr;
-
- namesz32 = *ptr32++;
- descsz32 = *ptr32;
- }
- }
+ if (phdr->p_filesz == 0)
+ return;
- if (idx + 3 * align > phdr->p_filesz
- || (idx + 3 * align + ALIGNED_LEN (namesz) + ALIGNED_LEN (descsz)
- > phdr->p_filesz))
- {
- if (ehdr->e_ident[EI_CLASS] == ELFCLASS64
- && idx + 3 * 4 <= phdr->p_filesz
- && (idx + 3 * 4 + ALIGNED_LEN (namesz32) + ALIGNED_LEN (descsz32)
- <= phdr->p_filesz))
- ERROR (gettext ("\
-phdr[%d]: note entries probably in form of a 32-bit ELF file\n"), cnt);
- else
- ERROR (gettext ("phdr[%d]: extra %zu bytes after last note\n"),
- cnt, (size_t) (phdr->p_filesz - idx));
- break;
- }
+ GElf_Off notes_size = 0;
+ Elf_Data *data = elf_getdata_rawchunk (ebl->elf,
+ phdr->p_offset, phdr->p_filesz,
+ ELF_T_NHDR);
+ if (data != NULL)
+ notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset);
+
+ if (notes_size == 0)
+ ERROR (gettext ("phdr[%d]: cannot get content of note section: %s\n"),
+ cnt, elf_errmsg (-1));
+ else if (notes_size != phdr->p_filesz)
+ ERROR (gettext ("phdr[%d]: extra %" PRIu64 " bytes after last note\n"),
+ cnt, phdr->p_filesz - notes_size);
+}
- /* Make sure it is one of the note types we know about. */
- if (ehdr->e_type == ET_CORE)
- {
- switch (type)
- {
- case NT_PRSTATUS:
- case NT_FPREGSET:
- case NT_PRPSINFO:
- case NT_TASKSTRUCT: /* NT_PRXREG on Solaris. */
- case NT_PLATFORM:
- case NT_AUXV:
- case NT_GWINDOWS:
- case NT_ASRS:
- case NT_PSTATUS:
- case NT_PSINFO:
- case NT_PRCRED:
- case NT_UTSNAME:
- case NT_LWPSTATUS:
- case NT_LWPSINFO:
- case NT_PRFPXREG:
- /* Known type. */
- break;
+static void
+check_note_section (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
+{
+ if (shdr->sh_size == 0)
+ return;
- default:
- ERROR (gettext ("\
-phdr[%d]: unknown core file note type %" PRIu64 " at offset %" PRIu64 "\n"),
- cnt, type, idx);
- }
- }
- else
- {
- if (type != NT_VERSION)
- ERROR (gettext ("\
-phdr[%d]: unknown object file note type %" PRIu64 " at offset %" PRIu64 "\n"),
- cnt, type, idx);
- }
+ Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
+ if (data == NULL)
+ {
+ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ idx, section_name (ebl, idx));
+ return;
+ }
- /* Move to the next entry. */
- idx += 3 * align + ALIGNED_LEN (namesz) + ALIGNED_LEN (descsz);
+ if (ehdr->e_type != ET_CORE && ehdr->e_type != ET_REL
+ && ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
+ ERROR (gettext ("\
+section [%2d] '%s': no note entries defined for the type of file\n"),
+ idx, section_name (ebl, idx));
- }
+ GElf_Off notes_size = check_note_data (ebl, ehdr, data, idx, 0, 0);
- gelf_freechunk (ebl->elf, notemem);
+ if (notes_size == 0)
+ ERROR (gettext ("section [%2d] '%s': cannot get content of note section\n"),
+ idx, section_name (ebl, idx));
+ else if (notes_size != shdr->sh_size)
+ ERROR (gettext ("section [%2d] '%s': extra %" PRIu64
+ " bytes after last note\n"),
+ idx, section_name (ebl, idx), shdr->sh_size - notes_size);
}
-
static void
check_program_header (Ebl *ebl, GElf_Ehdr *ehdr)
{
diff --git a/elfutils/src/findtextrel.c b/elfutils/src/findtextrel.c
index 189da8d5..d055f34e 100644
--- a/elfutils/src/findtextrel.c
+++ b/elfutils/src/findtextrel.c
@@ -120,10 +120,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
(void) argp_parse (&argp, argc, argv, 0, &remaining, NULL);
@@ -164,7 +164,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "findtextrel (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "findtextrel (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/ld.c b/elfutils/src/ld.c
index b1020a53..24fb2f96 100644
--- a/elfutils/src/ld.c
+++ b/elfutils/src/ld.c
@@ -296,10 +296,10 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- bindtextdomain (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- textdomain (PACKAGE);
+ textdomain (PACKAGE_TARNAME);
/* Before we start tell the ELF library which version we are using. */
elf_version (EV_CURRENT);
@@ -865,7 +865,7 @@ load_needed (void)
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "ld (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "ld (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/ldgeneric.c b/elfutils/src/ldgeneric.c
index d282a1d8..cb184abf 100644
--- a/elfutils/src/ldgeneric.c
+++ b/elfutils/src/ldgeneric.c
@@ -4535,7 +4535,7 @@ ld_generic_create_outfile (struct ld_state *statep)
gettext ("cannot create section for output file: %s"),
elf_errmsg (-1));
- outdata->d_buf = (void *) "\0ld (Red Hat " PACKAGE ") " VERSION;
+ outdata->d_buf = (void *) "\0ld (" PACKAGE_NAME ") " PACKAGE_VERSION;
outdata->d_size = strlen ((char *) outdata->d_buf + 1) + 2;
outdata->d_off = offset;
outdata->d_type = ELF_T_BYTE;
diff --git a/elfutils/src/ldlex.c b/elfutils/src/ldlex.c
index 3059fd70..604d9d60 100644
--- a/elfutils/src/ldlex.c
+++ b/elfutils/src/ldlex.c
@@ -1,8 +1,13 @@
+#line 2 "ldlex.c"
+
+#line 4 "ldlex.c"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
#define yy_create_buffer ld_create_buffer
#define yy_delete_buffer ld_delete_buffer
-#define yy_scan_buffer ld_scan_buffer
-#define yy_scan_string ld_scan_string
-#define yy_scan_bytes ld_scan_bytes
#define yy_flex_debug ld_flex_debug
#define yy_init_buffer ld_init_buffer
#define yy_flush_buffer ld_flush_buffer
@@ -11,40 +16,97 @@
#define yyin ldin
#define yyleng ldleng
#define yylex ldlex
+#define yylineno ldlineno
#define yyout ldout
#define yyrestart ldrestart
#define yytext ldtext
-#define yylineno ldlineno
-
-#line 20 "ldlex.c"
-/* A lexical scanner generated by flex*/
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#define yywrap ldwrap
+#define yyalloc ldalloc
+#define yyrealloc ldrealloc
+#define yyfree ldfree
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
#include <stdio.h>
-#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+/* end standard C headers. */
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
#endif
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
-#ifdef __cplusplus
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
-#include <stdlib.h>
+#endif /* ! FLEXINT_H */
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
+#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
@@ -53,34 +115,17 @@
#if __STDC__
-#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
/* Returned upon end-of-file. */
#define YY_NULL 0
@@ -95,80 +140,88 @@
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE ldrestart(ldin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
+#endif
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
-extern int yyleng;
-extern FILE *yyin, *yyout;
+extern int ldleng;
+
+extern FILE *ldin, *ldout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+ * access to the local variable yy_act. Since yyless() is a macro, it would break
+ * existing scanners that call yyless() from OUTSIDE ldlex.
+ * One obvious solution it to make yy_act a global. I tried that, and saw
+ * a 5% performance hit in a non-ldlineno scanner, because yy_act is
+ * normally declared as a register variable-- so it is not worth it.
+ */
+ #define YY_LESS_LINENO(n) \
+ do { \
+ int yyl;\
+ for ( yyl = n; yyl < ldleng; ++yyl )\
+ if ( ldtext[yyl] == '\n' )\
+ --ldlineno;\
+ }while(0)
+
+/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
+ /* Undo effects of setting up ldtext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up ldtext again */ \
} \
while ( 0 )
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* Some routines like yy_flex_realloc() are emitted as static but are
- not called by all lexers. This generates warnings in some compilers,
- notably GCC. Arrange to suppress these. */
-#ifdef __GNUC__
-#define YY_MAY_BE_UNUSED __attribute__((unused))
-#else
-#define YY_MAY_BE_UNUSED
-#endif
+#define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
-typedef unsigned int yy_size_t;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
@@ -205,12 +258,16 @@ struct yy_buffer_state
*/
int yy_at_bol;
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
+
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
@@ -220,180 +277,166 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
+ * (via ldrestart()), so that the user can continue scanning by
+ * just pointing ldin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
+
};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
*/
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when yytext is formed. */
+/* yy_hold_char holds the character lost when ldtext is formed. */
static char yy_hold_char;
-
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+int ldleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
+static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
+/* Flag which is used to allow ldwrap()'s to do buffer switches
+ * instead of setting up a fresh ldin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart YY_PROTO(( FILE *input_file ));
+void ldrestart (FILE *input_file );
+void ld_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE ld_create_buffer (FILE *file,int size );
+void ld_delete_buffer (YY_BUFFER_STATE b );
+void ld_flush_buffer (YY_BUFFER_STATE b );
+void ldpush_buffer_state (YY_BUFFER_STATE new_buffer );
+void ldpop_buffer_state (void );
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+static void ldensure_buffer_stack (void );
+static void ld_load_buffer_state (void );
+static void ld_init_buffer (YY_BUFFER_STATE b,FILE *file );
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+#define YY_FLUSH_BUFFER ld_flush_buffer(YY_CURRENT_BUFFER )
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
-static void yy_flex_free YY_PROTO(( void * ));
+YY_BUFFER_STATE ld_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE ld_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE ld_scan_bytes (yyconst char *bytes,int len );
-#define yy_new_buffer yy_create_buffer
+void *ldalloc (yy_size_t );
+void *ldrealloc (void *,yy_size_t );
+void ldfree (void * );
+
+#define yy_new_buffer ld_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ ldensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ ld_create_buffer(ldin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
+ if ( ! YY_CURRENT_BUFFER ){\
+ ldensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ ld_create_buffer(ldin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-#define YY_USES_REJECT
+/* Begin user sect3 */
-#define yywrap() 1
+#define ldwrap(n) 1
#define YY_SKIP_YYWRAP
+
typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+FILE *ldin = (FILE *) 0, *ldout = (FILE *) 0;
+
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
-extern char *yytext;
-#define yytext_ptr yytext
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+extern int ldlineno;
+
+int ldlineno = 1;
+
+extern char *ldtext;
+#define yytext_ptr ldtext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up ldtext.
*/
#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
+ (yytext_ptr) = yy_bp; \
+ ldleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 50
#define YY_END_OF_BUFFER 51
-static yyconst short int yy_acclist[390] =
- { 0,
- 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[220] =
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[219] =
{ 0,
- 1, 1, 1, 1, 1, 2, 4, 7, 9, 12,
- 15, 18, 21, 25, 28, 31, 34, 37, 40, 44,
- 48, 51, 54, 57, 60, 63, 66, 69, 72, 75,
- 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, 161, 161, 162,
- 164, 166, 166, 166, 166, 166, 169, 171, 173, 175,
- 177, 179, 181, 183, 185, 187, 189, 191, 193, 195,
- 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
+ 0, 0, 0, 0, 51, 49, 48, 48, 41, 42,
+ 32, 33, 39, 37, 44, 38, 46, 40, 45, 45,
+ 34, 35, 36, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 49, 49, 46, 46, 30, 43, 31,
+ 49, 9, 9, 48, 46, 47, 46, 10, 45, 45,
+ 45, 46, 45, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 0, 29, 46,
+ 46, 0, 0, 0, 0, 45, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 0, 46, 46, 0, 0, 0, 0, 0,
+
+ 0, 45, 46, 46, 46, 46, 46, 46, 46, 19,
+ 46, 46, 46, 46, 46, 46, 27, 46, 0, 46,
+ 46, 0, 0, 0, 0, 0, 0, 0, 0, 11,
+ 46, 13, 46, 16, 17, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 0, 0, 0, 0, 0,
+ 0, 0, 0, 46, 46, 18, 46, 46, 46, 46,
+ 46, 46, 46, 46, 20, 0, 2, 0, 0, 0,
+ 6, 0, 0, 46, 46, 46, 46, 23, 46, 25,
+ 46, 28, 15, 0, 4, 1, 0, 8, 5, 46,
+ 46, 46, 22, 46, 46, 0, 0, 12, 46, 46,
+
+ 46, 46, 3, 7, 46, 46, 24, 46, 46, 46,
+ 46, 14, 46, 46, 21, 46, 26, 0
} ;
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -425,7 +468,7 @@ static yyconst int yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst int yy_meta[67] =
+static yyconst flex_int32_t yy_meta[67] =
{ 0,
1, 2, 2, 1, 1, 1, 2, 2, 3, 1,
1, 1, 3, 1, 3, 3, 3, 2, 2, 1,
@@ -436,7 +479,7 @@ static yyconst int yy_meta[67] =
3, 3, 3, 2, 1, 2
} ;
-static yyconst short int yy_base[223] =
+static yyconst flex_int16_t yy_base[223] =
{ 0,
0, 224, 0, 219, 221, 2250, 65, 67, 2250, 2250,
2250, 2250, 0, 2250, 2250, 2250, 70, 211, 135, 62,
@@ -465,7 +508,7 @@ static yyconst short int yy_base[223] =
2243, 2246
} ;
-static yyconst short int yy_def[223] =
+static yyconst flex_int16_t yy_def[223] =
{ 0,
218, 1, 219, 219, 218, 218, 218, 218, 218, 218,
218, 218, 220, 218, 218, 218, 221, 222, 221, 19,
@@ -494,7 +537,7 @@ static yyconst short int yy_def[223] =
218, 218
} ;
-static yyconst short int yy_nxt[2317] =
+static yyconst flex_int16_t yy_nxt[2317] =
{ 0,
6, 7, 8, 6, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 20, 21, 22, 23,
@@ -753,7 +796,7 @@ static yyconst short int yy_nxt[2317] =
218, 218, 218, 218, 218, 218
} ;
-static yyconst short int yy_chk[2317] =
+static yyconst flex_int16_t yy_chk[2317] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -1012,23 +1055,29 @@ static yyconst short int yy_chk[2317] =
218, 218, 218, 218, 218, 218
} ;
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
-static char *yy_full_match;
-static int yy_lp;
-#define REJECT \
-{ \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-++yy_lp; \
-goto find_rule; \
-}
+/* Table of booleans, true if rule could match eol. */
+static yyconst flex_int32_t yy_rule_can_match_eol[51] =
+ { 0,
+1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int ld_flex_debug;
+int ld_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "/home/drepper/devel/elfutils/src/ldlex.l"
-#define INITIAL 0
-#line 2 "/home/drepper/devel/elfutils/src/ldlex.l"
+char *ldtext;
+#line 1 "ldlex.l"
+#line 2 "ldlex.l"
/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -1086,7 +1135,7 @@ char *yytext;
/* 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)
+ = fwrite (ldtext, ldleng, 1, ldout); } while (0)
/* Defined in ld.c. */
extern int ld_scan_version_script;
@@ -1107,10 +1156,25 @@ static void push_state (enum prepstate);
static int pop_state (void);
static int handle_ifdef (void);
static void invalid_char (int ch);
-#define YY_NEVER_INTERACTIVE 1
+
+#line 1161 "ldlex.c"
+
+#define INITIAL 0
#define IGNORE 1
-#line 1114 "ldlex.c"
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1118,65 +1182,30 @@ static void invalid_char (int ch);
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int ldwrap (void );
#else
-extern int yywrap YY_PROTO(( void ));
+extern int ldwrap (void );
#endif
#endif
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
+ static void yyunput (int c,char *buf_ptr );
+
#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
+#ifdef __cplusplus
+static int yyinput (void );
#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
+static int input (void );
#endif
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
#endif
/* Amount of stuff to slurp up with each read. */
@@ -1185,12 +1214,11 @@ YY_MALLOC_DECL
#endif
/* Copy whatever the last rule matched to the standard output. */
-
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( ldtext, ldleng, 1, ldout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1198,21 +1226,35 @@ YY_MALLOC_DECL
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
- int c = '*', n; \
+ int c = '*'; \
+ size_t n; \
for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( ldin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
+ if ( c == EOF && ferror( ldin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, ldin))==0 && ferror(ldin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(ldin); \
+ } \
+ }\
+\
+
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -1233,14 +1275,20 @@ YY_MALLOC_DECL
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
+/* end tables serialization structures and prototypes */
+
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int ldlex (void);
-/* Code executed at the beginning of each rule, after yytext and yyleng
+#define YY_DECL int ldlex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after ldtext and ldleng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -1253,18 +1301,20 @@ YY_MALLOC_DECL
#endif
#define YY_RULE_SETUP \
- if ( yyleng > 0 ) \
- yy_current_buffer->yy_at_bol = \
- (yytext[yyleng - 1] == '\n'); \
+ if ( ldleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (ldtext[ldleng - 1] == '\n'); \
YY_USER_ACTION
+/** The main scanner function which does all the work.
+ */
YY_DECL
- {
+{
register yy_state_type yy_current_state;
- register char *yy_cp = NULL, *yy_bp = NULL;
+ register char *yy_cp, *yy_bp;
register int yy_act;
-
-#line 96 "/home/drepper/devel/elfutils/src/ldlex.l"
+
+#line 96 "ldlex.l"
if (unlikely (ld_scan_version_script))
{
@@ -1272,52 +1322,57 @@ YY_DECL
return kVERSION_SCRIPT;
}
-#line 1276 "ldlex.c"
+#line 1326 "ldlex.c"
- if ( yy_init )
+ if ( !(yy_init) )
{
- yy_init = 0;
+ (yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
- if ( ! yy_start )
- yy_start = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! ldin )
+ ldin = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! ldout )
+ ldout = stdout;
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ if ( ! YY_CURRENT_BUFFER ) {
+ ldensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ ld_create_buffer(ldin,YY_BUF_SIZE );
+ }
- yy_load_buffer_state();
+ ld_load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_c_buf_p);
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
+ /* Support of ldtext. */
+ *yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
- yy_current_state = yy_start;
+ yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
@@ -1325,96 +1380,95 @@ yy_match:
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] != 2250 );
+ while ( yy_current_state != 218 );
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
yy_find_action:
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[yy_lp];
- {
- yy_full_match = yy_cp;
- break;
- }
- }
- --yy_cp;
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- }
+ yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
- if ( yy_act != YY_END_OF_BUFFER )
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
int yyl;
- for ( yyl = 0; yyl < yyleng; ++yyl )
- if ( yytext[yyl] == '\n' )
- ++yylineno;
+ for ( yyl = 0; yyl < ldleng; ++yyl )
+ if ( ldtext[yyl] == '\n' )
+
+ ldlineno++;
+;
}
do_action: /* This label is used only to access EOF actions. */
-
switch ( yy_act )
{ /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
case 1:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 6;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 1 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 6;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 103 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 103 "ldlex.l"
{ BEGIN (handle_ifdef ()); }
YY_BREAK
case 2:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 5;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 2 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 5;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 104 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 104 "ldlex.l"
{ eat_to_eol (true);
push_state (skip_to_endif);
BEGIN (IGNORE); }
YY_BREAK
case 3:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 8;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 3 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 8;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 107 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 107 "ldlex.l"
{ eat_to_eol (false);
push_state (skip_to_endif);
BEGIN (IGNORE); }
YY_BREAK
case 4:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 6;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 4 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 6;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 110 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 110 "ldlex.l"
{ eat_to_eol (true) ; }
YY_BREAK
case 5:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 6;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 5 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 6;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 112 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 112 "ldlex.l"
{ eat_to_eol (false);
push_state (skip_to_endif); }
YY_BREAK
case 6:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 5;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 6 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 5;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 114 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 114 "ldlex.l"
{ eat_to_eol (true);
assert (prepdepth > 0);
if (prepstate[prepdepth - 1] == skip_if)
@@ -1426,11 +1480,12 @@ YY_RULE_SETUP
}
YY_BREAK
case 7:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 8;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 7 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 8;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 123 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 123 "ldlex.l"
{ assert (prepdepth > 0);
if (prepstate[prepdepth - 1] == skip_if)
{
@@ -1441,203 +1496,205 @@ YY_RULE_SETUP
}
YY_BREAK
case 8:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 6;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
+/* rule 8 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up ldtext */
+(yy_c_buf_p) = yy_cp = yy_bp + 6;
+YY_DO_BEFORE_ACTION; /* set up ldtext again */
YY_RULE_SETUP
-#line 131 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 131 "ldlex.l"
{ eat_to_eol (true);
BEGIN (pop_state ()); }
YY_BREAK
case 9:
+/* rule 9 can match eol */
YY_RULE_SETUP
-#line 133 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 133 "ldlex.l"
{ /* nothing */ }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 136 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 136 "ldlex.l"
{ eat_comment (); }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 138 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 138 "ldlex.l"
{ return kALIGN; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 139 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 139 "ldlex.l"
{ return kAS_NEEDED; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 140 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 140 "ldlex.l"
{ return kENTRY; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 141 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 141 "ldlex.l"
{ return kEXCLUDE_FILE; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 142 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 142 "ldlex.l"
{ return kGLOBAL; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 143 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 143 "ldlex.l"
{ return kGROUP; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 144 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 144 "ldlex.l"
{ return kINPUT; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 145 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 145 "ldlex.l"
{ return kINTERP; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 146 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 146 "ldlex.l"
{ return kKEEP; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 147 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 147 "ldlex.l"
{ return kLOCAL; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 148 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 148 "ldlex.l"
{ return kOUTPUT_FORMAT; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 149 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 149 "ldlex.l"
{ return kPAGESIZE; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 150 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 150 "ldlex.l"
{ return kPROVIDE; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 151 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 151 "ldlex.l"
{ return kSEARCH_DIR; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 152 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 152 "ldlex.l"
{ return kSEGMENT; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 153 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 153 "ldlex.l"
{ return kSIZEOF_HEADERS; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 154 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 154 "ldlex.l"
{ return kSORT; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 155 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 155 "ldlex.l"
{ return kVERSION; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 157 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 157 "ldlex.l"
{ int cnt = 1 ;
ldlval.num = 0;
- while (cnt < yyleng - 1)
- ldlval.num |= attrib_convert (yytext[cnt++]);
+ while (cnt < ldleng - 1)
+ ldlval.num |= attrib_convert (ldtext[cnt++]);
return kMODE; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 163 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 163 "ldlex.l"
{ return '{'; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 164 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 164 "ldlex.l"
{ return '}'; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 165 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 165 "ldlex.l"
{ return '('; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 166 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 166 "ldlex.l"
{ return ')'; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 167 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 167 "ldlex.l"
{ return ':'; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 168 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 168 "ldlex.l"
{ return ';'; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 169 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 169 "ldlex.l"
{ return '='; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 170 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 170 "ldlex.l"
{ ldlval.op = exp_plus; return kADD_OP; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 171 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 171 "ldlex.l"
{ ldlval.op = exp_minus; return kADD_OP; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 172 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 172 "ldlex.l"
{ return '*'; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 173 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 173 "ldlex.l"
{ ldlval.op = exp_div; return kMUL_OP; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 174 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 174 "ldlex.l"
{ ldlval.op = exp_mod; return kMUL_OP; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 175 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 175 "ldlex.l"
{ return '&'; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 176 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 176 "ldlex.l"
{ return '|'; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 178 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 178 "ldlex.l"
{ return ','; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 180 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 180 "ldlex.l"
{ char *endp;
- ldlval.num = strtoumax (yytext, &endp, 0);
+ ldlval.num = strtoumax (ldtext, &endp, 0);
if (*endp != '\0')
{
if (tolower (*endp) == 'k')
@@ -1652,61 +1709,62 @@ YY_RULE_SETUP
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 194 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 194 "ldlex.l"
{ ldlval.str = obstack_strndup (&ld_state.smem,
- yytext, yyleng);
+ ldtext, ldleng);
return kID; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 198 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 198 "ldlex.l"
{ ldlval.str = obstack_strndup (&ld_state.smem,
- yytext, yyleng);
+ ldtext, ldleng);
return kFILENAME; }
YY_BREAK
case 48:
+/* rule 48 can match eol */
YY_RULE_SETUP
-#line 202 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 202 "ldlex.l"
{ /* IGNORE */ }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 204 "/home/drepper/devel/elfutils/src/ldlex.l"
-{ invalid_char (*yytext); }
+#line 204 "ldlex.l"
+{ invalid_char (*ldtext); }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 206 "/home/drepper/devel/elfutils/src/ldlex.l"
+#line 206 "ldlex.l"
ECHO;
YY_BREAK
-#line 1683 "ldlex.c"
- case YY_STATE_EOF(INITIAL):
- case YY_STATE_EOF(IGNORE):
- yyterminate();
+#line 1741 "ldlex.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(IGNORE):
+ yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
+ *yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
+ * just pointed ldin at a new source and called
+ * ldlex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = ldin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
@@ -1716,13 +1774,13 @@ ECHO;
* end-of-buffer state). Contrast this with the test
* in input().
*/
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
@@ -1735,41 +1793,42 @@ ECHO;
yy_next_state = yy_try_NUL_trans( yy_current_state );
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
+ yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
- yy_cp = yy_c_buf_p;
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
}
}
- else switch ( yy_get_next_buffer() )
+ else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
- yy_did_buffer_switch_on_eof = 0;
+ (yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap() )
+ if ( ldwrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * yytext, we can now set up
+ * ldtext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
@@ -1777,30 +1836,30 @@ ECHO;
else
{
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( );
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
@@ -1811,8 +1870,7 @@ ECHO;
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
- } /* end of yylex */
-
+} /* end of ldlex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1821,21 +1879,20 @@ ECHO;
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
- if ( yy_current_buffer->yy_fill_buffer == 0 )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
@@ -1855,34 +1912,30 @@ static int yy_get_next_buffer()
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
@@ -1895,8 +1948,7 @@ static int yy_get_next_buffer()
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
+ ldrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
@@ -1906,35 +1958,35 @@ static int yy_get_next_buffer()
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = yy_current_buffer->yy_buf_size -
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
-#endif
+
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- if ( yy_n_chars == 0 )
+ if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ ldrestart(ldin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
@@ -1942,31 +1994,33 @@ static int yy_get_next_buffer()
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
- }
-
+}
/* yy_get_previous_state - get the state just before the EOB char was reached */
-static yy_state_type yy_get_previous_state()
- {
+ static yy_state_type yy_get_previous_state (void)
+{
register yy_state_type yy_current_state;
register char *yy_cp;
-
- yy_current_state = yy_start;
+
+ yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
@@ -1974,29 +2028,27 @@ static yy_state_type yy_get_previous_state()
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;
}
return yy_current_state;
- }
-
+}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
@@ -2005,87 +2057,79 @@ yy_state_type yy_current_state;
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 218);
- if ( ! yy_is_jam )
- *yy_state_ptr++ = yy_current_state;
return yy_is_jam ? 0 : yy_current_state;
- }
-
+}
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
+ /* undo effects of setting up ldtext */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > yy_current_buffer->yy_ch_buf )
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
- if ( c == '\n' )
- --yylineno;
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
+ if ( c == '\n' ){
+ --ldlineno;
+ }
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
#ifndef YY_NO_INPUT
#ifdef __cplusplus
-static int yyinput()
+ static int yyinput (void)
#else
-static int input()
+ static int input (void)
#endif
- {
- int c;
- *yy_c_buf_p = yy_hold_char;
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
- *yy_c_buf_p = '\0';
+ *(yy_c_buf_p) = '\0';
else
{ /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
- switch ( yy_get_next_buffer() )
+ switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
@@ -2099,16 +2143,16 @@ static int input()
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ ldrestart(ldin );
- /* fall through */
+ /*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap() )
+ if ( ldwrap( ) )
return EOF;
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
@@ -2118,170 +2162,171 @@ static int input()
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
+ (yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve ldtext */
+ (yy_hold_char) = *++(yy_c_buf_p);
- yy_current_buffer->yy_at_bol = (c == '\n');
- if ( yy_current_buffer->yy_at_bol )
- ++yylineno;
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
+
+ ldlineno++;
+;
return c;
- }
-#endif /* YY_NO_INPUT */
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void ldrestart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ ldensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ ld_create_buffer(ldin,YY_BUF_SIZE );
}
+ ld_init_buffer(YY_CURRENT_BUFFER,input_file );
+ ld_load_buffer_state( );
+}
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void ld_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * ldpop_buffer_state();
+ * ldpush_buffer_state(new_buffer);
+ */
+ ldensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
return;
- if ( yy_current_buffer )
+ if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ ld_load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
+ * EOF (ldwrap()) processing, but the only time this flag
+ * is looked at is after ldwrap() is called, so it's safe
* to go ahead and always set it.
*/
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+static void ld_load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ ldin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE ld_create_buffer (FILE * file, int size )
+{
YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+
+ b = (YY_BUFFER_STATE) ldalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ld_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) ldalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ld_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ ld_init_buffer(b,file );
return b;
- }
-
+}
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
+/** Destroy the buffer.
+ * @param b a buffer created with ld_create_buffer()
+ *
+ */
+ void ld_delete_buffer (YY_BUFFER_STATE b )
+{
+
if ( ! b )
return;
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
+ ldfree((void *) b->yy_ch_buf );
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
+ ldfree((void *) b );
+}
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a ldrestart() or at EOF.
+ */
+ static void ld_init_buffer (YY_BUFFER_STATE b, FILE * file )
- {
- yy_flush_buffer( b );
+{
+ int oerrno = errno;
+
+ ld_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
+ /* If b is the current buffer, then ld_init_buffer was _probably_
+ * called from ldrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
- {
- if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void ld_flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
return;
b->yy_n_chars = 0;
@@ -2298,31 +2343,123 @@ YY_BUFFER_STATE b;
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
+ if ( b == YY_CURRENT_BUFFER )
+ ld_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void ldpush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ ldensure_buffer_stack();
+
+ /* This block is copied from ld_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from ld_switch_to_buffer. */
+ ld_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void ldpop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ ld_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ ld_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
+}
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void ldensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)ldalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)ldrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE ld_scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) ldalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ld_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
@@ -2334,58 +2471,53 @@ yy_size_t size;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
+ ld_switch_to_buffer(b );
return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
+}
+/** Setup the input buffer state to scan a string. The next call to ldlex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * ld_scan_bytes() instead.
+ */
+YY_BUFFER_STATE ld_scan_string (yyconst char * yystr )
+{
+
+ return ld_scan_bytes(yystr,strlen(yystr) );
+}
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
+/** Setup the input buffer state to scan the given bytes. The next call to ldlex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE ld_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
+ n = _yybytes_len + 2;
+ buf = (char *) ldalloc(n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ld_scan_bytes()" );
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = ld_scan_buffer(buf,n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in ld_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2393,148 +2525,199 @@ int len;
b->yy_is_our_buffer = 1;
return b;
- }
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
#endif
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
+/* Redefine yyless() so it works in section 3 code. */
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up ldtext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ ldtext[ldleng] = (yy_hold_char); \
+ (yy_c_buf_p) = ldtext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ ldleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Accessor methods (get/set functions) to struct members. */
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
+/** Get the current line number.
+ *
+ */
+int ldget_lineno (void)
+{
+
+ return ldlineno;
+}
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
+/** Get the input stream.
+ *
+ */
+FILE *ldget_in (void)
+{
+ return ldin;
+}
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the output stream.
+ *
+ */
+FILE *ldget_out (void)
+{
+ return ldout;
+}
- BEGIN(new_state);
- }
-#endif
+/** Get the length of the current token.
+ *
+ */
+int ldget_leng (void)
+{
+ return ldleng;
+}
+/** Get the current token.
+ *
+ */
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+char *ldget_text (void)
+{
+ return ldtext;
+}
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void ldset_lineno (int line_number )
+{
+
+ ldlineno = line_number;
+}
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see ld_switch_to_buffer
+ */
+void ldset_in (FILE * in_str )
+{
+ ldin = in_str ;
+}
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
+void ldset_out (FILE * out_str )
+{
+ ldout = out_str ;
+}
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+int ldget_debug (void)
+{
+ return ld_flex_debug;
+}
+
+void ldset_debug (int bdebug )
+{
+ ld_flex_debug = bdebug ;
+}
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
+static int yy_init_globals (void)
+{
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from ldlex_destroy(), so don't allocate here.
+ */
+
+ /* We do not touch ldlineno unless the option is enabled. */
+ ldlineno = 1;
+
+ (yy_buffer_stack) = 0;
+ (yy_buffer_stack_top) = 0;
+ (yy_buffer_stack_max) = 0;
+ (yy_c_buf_p) = (char *) 0;
+ (yy_init) = 0;
+ (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ ldin = stdin;
+ ldout = stdout;
#else
-static void yy_fatal_error( msg )
-char msg[];
+ ldin = (FILE *) 0;
+ ldout = (FILE *) 0;
#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
+ /* For future reference: Set errno on error, since we are called by
+ * ldlex_init()
+ */
+ return 0;
+}
+/* ldlex_destroy is for both reentrant and non-reentrant scanners. */
+int ldlex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ ld_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ ldpop_buffer_state();
+ }
-/* Redefine yyless() so it works in section 3 code. */
+ /* Destroy the stack itself. */
+ ldfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * ldlex() is called, initialization will occur. */
+ yy_init_globals( );
+ return 0;
+}
-/* Internal utility routines. */
+/*
+ * Internal utility routines.
+ */
#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
- }
+}
#endif
#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
+static int yy_flex_strlen (yyconst char * s )
+{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
- }
+}
#endif
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
+void *ldalloc (yy_size_t size )
+{
return (void *) malloc( size );
- }
+}
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
+void *ldrealloc (void * ptr, yy_size_t size )
+{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -2543,26 +2726,17 @@ yy_size_t size;
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
- }
+}
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
+void ldfree (void * ptr )
+{
+ free( (char *) ptr ); /* see ldrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 206 "ldlex.l"
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 206 "/home/drepper/devel/elfutils/src/ldlex.l"
static void
@@ -2607,13 +2781,13 @@ eat_to_eol (bool empty)
break;
if (c == '\n')
{
- ++yylineno;
+ ++ldlineno;
break;
}
if (empty && ! isspace (c) && ! warned)
{
- error (0, 0, gettext ("%d: garbage at end of line"), yylineno);
+ error (0, 0, gettext ("%d: garbage at end of line"), ldlineno);
warned = true;
}
}
@@ -2637,7 +2811,7 @@ push_state (enum prepstate state)
{
if (prepdepth >= MAX_PREPDEPTH)
error (EXIT_FAILURE, 0, gettext ("%d: conditionals nested too deep"),
- yylineno);
+ ldlineno);
prepstate[prepdepth++] = state;
}
@@ -2647,7 +2821,7 @@ static int
pop_state (void)
{
if (prepdepth == 0)
- error (0, 0, gettext ("%d: unexpected #endif"), yylineno);
+ error (0, 0, gettext ("%d: unexpected #endif"), ldlineno);
else
--prepdepth;
@@ -2712,10 +2886,11 @@ invalid_char (int ch)
error (0, 0, (isascii (ch)
? gettext ("invalid character '%c' at line %d; ignored")
: gettext ("invalid character '\\%o' at line %d; ignored")),
- ch, yylineno);
+ ch, ldlineno);
}
// Local Variables:
// mode: C
// End:
+
diff --git a/elfutils/src/ldscript.c b/elfutils/src/ldscript.c
index 84bac4cd..da72f29c 100644
--- a/elfutils/src/ldscript.c
+++ b/elfutils/src/ldscript.c
@@ -136,7 +136,7 @@
/* Copy the first part of user declarations. */
-#line 1 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 1 "ldscript.y"
/* Parser for linker scripts.
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
@@ -227,7 +227,7 @@ extern int yylex (void);
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 71 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 71 "ldscript.y"
{
uintmax_t num;
enum expression_tag op;
@@ -242,7 +242,7 @@ typedef union YYSTYPE
struct version *version;
struct id_list *id_list;
}
-/* Line 193 of yacc.c. */
+/* Line 187 of yacc.c. */
#line 247 "ldscript.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -1591,12 +1591,12 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 145 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 145 "ldscript.y"
{ add_versions ((yyvsp[(2) - (2)].version)); }
break;
case 6:
-#line 153 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 153 "ldscript.y"
{
if (likely (ld_state.entry == NULL))
ld_state.entry = (yyvsp[(3) - (5)].str);
@@ -1604,14 +1604,14 @@ yyreduce:
break;
case 7:
-#line 158 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 158 "ldscript.y"
{
ld_new_searchdir ((yyvsp[(3) - (5)].str));
}
break;
case 8:
-#line 162 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 162 "ldscript.y"
{
if (likely (ld_state.pagesize == 0))
ld_state.pagesize = (yyvsp[(3) - (5)].num);
@@ -1619,7 +1619,7 @@ yyreduce:
break;
case 9:
-#line 167 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 167 "ldscript.y"
{
if (likely (ld_state.interp == NULL)
&& ld_state.file_type != dso_file_type)
@@ -1628,14 +1628,14 @@ yyreduce:
break;
case 10:
-#line 173 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 173 "ldscript.y"
{
new_segment ((yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].output_rule));
}
break;
case 11:
-#line 177 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 177 "ldscript.y"
{
fputs_unlocked (gettext ("mode for segment invalid\n"),
stderr);
@@ -1644,7 +1644,7 @@ yyreduce:
break;
case 12:
-#line 183 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 183 "ldscript.y"
{
/* First little optimization. If there is only one
file in the group don't do anything. */
@@ -1658,27 +1658,27 @@ yyreduce:
break;
case 13:
-#line 194 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 194 "ldscript.y"
{ add_inputfiles ((yyvsp[(3) - (4)].filename_list)); }
break;
case 14:
-#line 196 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 196 "ldscript.y"
{ add_inputfiles (mark_as_needed ((yyvsp[(3) - (4)].filename_list))); }
break;
case 15:
-#line 198 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 198 "ldscript.y"
{ add_versions ((yyvsp[(3) - (4)].version)); }
break;
case 16:
-#line 200 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 200 "ldscript.y"
{ /* XXX TODO */ }
break;
case 17:
-#line 204 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 204 "ldscript.y"
{
(yyvsp[(2) - (2)].output_rule)->next = (yyvsp[(1) - (2)].output_rule)->next;
(yyval.output_rule) = (yyvsp[(1) - (2)].output_rule)->next = (yyvsp[(2) - (2)].output_rule);
@@ -1686,12 +1686,12 @@ yyreduce:
break;
case 18:
-#line 209 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 209 "ldscript.y"
{ (yyval.output_rule) = (yyvsp[(1) - (1)].output_rule); }
break;
case 19:
-#line 213 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 213 "ldscript.y"
{
(yyval.output_rule) = new_output_rule (output_assignment);
(yyval.output_rule)->val.assignment = (yyvsp[(1) - (2)].assignment);
@@ -1699,7 +1699,7 @@ yyreduce:
break;
case 20:
-#line 218 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 218 "ldscript.y"
{
(yyval.output_rule) = new_output_rule (output_section);
(yyval.output_rule)->val.section.name = (yyvsp[(1) - (4)].str);
@@ -1714,7 +1714,7 @@ yyreduce:
break;
case 21:
-#line 230 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 230 "ldscript.y"
{
/* This is a short cut for "ID { *(ID) }". */
(yyval.output_rule) = new_output_rule (output_section);
@@ -1739,17 +1739,17 @@ yyreduce:
break;
case 22:
-#line 254 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 254 "ldscript.y"
{ (yyval.assignment) = new_assignment ((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].expr), false); }
break;
case 23:
-#line 256 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 256 "ldscript.y"
{ (yyval.assignment) = new_assignment ((yyvsp[(3) - (6)].str), (yyvsp[(5) - (6)].expr), true); }
break;
case 24:
-#line 260 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 260 "ldscript.y"
{
(yyvsp[(2) - (2)].input_rule)->next = (yyvsp[(1) - (2)].input_rule)->next;
(yyval.input_rule) = (yyvsp[(1) - (2)].input_rule)->next = (yyvsp[(2) - (2)].input_rule);
@@ -1757,12 +1757,12 @@ yyreduce:
break;
case 25:
-#line 265 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 265 "ldscript.y"
{ (yyval.input_rule) = (yyvsp[(1) - (1)].input_rule); }
break;
case 26:
-#line 269 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 269 "ldscript.y"
{
(yyval.input_rule) = new_input_rule (input_section);
(yyval.input_rule)->val.section = (yyvsp[(1) - (1)].filemask_section_name);
@@ -1770,7 +1770,7 @@ yyreduce:
break;
case 27:
-#line 274 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 274 "ldscript.y"
{
(yyvsp[(3) - (4)].filemask_section_name)->keep_flag = true;
@@ -1780,7 +1780,7 @@ yyreduce:
break;
case 28:
-#line 281 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 281 "ldscript.y"
{
(yyval.input_rule) = new_input_rule (input_assignment);
(yyval.input_rule)->val.assignment = (yyvsp[(1) - (2)].assignment);
@@ -1788,7 +1788,7 @@ yyreduce:
break;
case 29:
-#line 288 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 288 "ldscript.y"
{
(yyval.filemask_section_name) = (struct filemask_section_name *)
obstack_alloc (&ld_state.smem, sizeof (*(yyval.filemask_section_name)));
@@ -1800,27 +1800,27 @@ yyreduce:
break;
case 30:
-#line 299 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 299 "ldscript.y"
{ (yyval.sectionname) = new_input_section_name ((yyvsp[(1) - (1)].str), false); }
break;
case 31:
-#line 301 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 301 "ldscript.y"
{ (yyval.sectionname) = new_input_section_name ((yyvsp[(3) - (4)].str), true); }
break;
case 32:
-#line 305 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 305 "ldscript.y"
{ (yyval.str) = (yyvsp[(3) - (4)].str); }
break;
case 33:
-#line 307 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 307 "ldscript.y"
{ (yyval.str) = NULL; }
break;
case 34:
-#line 311 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 311 "ldscript.y"
{
(yyval.expr) = new_expr (exp_align);
(yyval.expr)->val.child = (yyvsp[(3) - (4)].expr);
@@ -1828,12 +1828,12 @@ yyreduce:
break;
case 35:
-#line 316 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 316 "ldscript.y"
{ (yyval.expr) = (yyvsp[(2) - (3)].expr); }
break;
case 36:
-#line 318 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 318 "ldscript.y"
{
(yyval.expr) = new_expr (exp_mult);
(yyval.expr)->val.binary.left = (yyvsp[(1) - (3)].expr);
@@ -1842,7 +1842,7 @@ yyreduce:
break;
case 37:
-#line 324 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 324 "ldscript.y"
{
(yyval.expr) = new_expr ((yyvsp[(2) - (3)].op));
(yyval.expr)->val.binary.left = (yyvsp[(1) - (3)].expr);
@@ -1851,7 +1851,7 @@ yyreduce:
break;
case 38:
-#line 330 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 330 "ldscript.y"
{
(yyval.expr) = new_expr ((yyvsp[(2) - (3)].op));
(yyval.expr)->val.binary.left = (yyvsp[(1) - (3)].expr);
@@ -1860,7 +1860,7 @@ yyreduce:
break;
case 39:
-#line 336 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 336 "ldscript.y"
{
(yyval.expr) = new_expr (exp_and);
(yyval.expr)->val.binary.left = (yyvsp[(1) - (3)].expr);
@@ -1869,7 +1869,7 @@ yyreduce:
break;
case 40:
-#line 342 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 342 "ldscript.y"
{
(yyval.expr) = new_expr (exp_or);
(yyval.expr)->val.binary.left = (yyvsp[(1) - (3)].expr);
@@ -1878,7 +1878,7 @@ yyreduce:
break;
case 41:
-#line 348 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 348 "ldscript.y"
{
(yyval.expr) = new_expr (exp_num);
(yyval.expr)->val.num = (yyvsp[(1) - (1)].num);
@@ -1886,7 +1886,7 @@ yyreduce:
break;
case 42:
-#line 353 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 353 "ldscript.y"
{
(yyval.expr) = new_expr (exp_id);
(yyval.expr)->val.str = (yyvsp[(1) - (1)].str);
@@ -1894,17 +1894,17 @@ yyreduce:
break;
case 43:
-#line 358 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 358 "ldscript.y"
{ (yyval.expr) = new_expr (exp_sizeof_headers); }
break;
case 44:
-#line 360 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 360 "ldscript.y"
{ (yyval.expr) = new_expr (exp_pagesize); }
break;
case 45:
-#line 364 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 364 "ldscript.y"
{
(yyvsp[(3) - (3)].filename_list)->next = (yyvsp[(1) - (3)].filename_list)->next;
(yyval.filename_list) = (yyvsp[(1) - (3)].filename_list)->next = (yyvsp[(3) - (3)].filename_list);
@@ -1912,12 +1912,12 @@ yyreduce:
break;
case 46:
-#line 369 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 369 "ldscript.y"
{ (yyval.filename_list) = (yyvsp[(1) - (1)].filename_list); }
break;
case 49:
-#line 377 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 377 "ldscript.y"
{
/* First little optimization. If there is only one
file in the group don't do anything. */
@@ -1931,17 +1931,17 @@ yyreduce:
break;
case 50:
-#line 388 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 388 "ldscript.y"
{ (yyval.filename_list) = mark_as_needed ((yyvsp[(3) - (4)].filename_list)); }
break;
case 51:
-#line 390 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 390 "ldscript.y"
{ (yyval.filename_list) = new_filename_listelem ((yyvsp[(1) - (1)].str)); }
break;
case 52:
-#line 395 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 395 "ldscript.y"
{
(yyvsp[(2) - (2)].version)->next = (yyvsp[(1) - (2)].version)->next;
(yyval.version) = (yyvsp[(1) - (2)].version)->next = (yyvsp[(2) - (2)].version);
@@ -1949,12 +1949,12 @@ yyreduce:
break;
case 53:
-#line 400 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 400 "ldscript.y"
{ (yyval.version) = (yyvsp[(1) - (1)].version); }
break;
case 54:
-#line 404 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 404 "ldscript.y"
{
(yyvsp[(2) - (4)].version)->versionname = "";
(yyvsp[(2) - (4)].version)->parentname = NULL;
@@ -1963,7 +1963,7 @@ yyreduce:
break;
case 55:
-#line 410 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 410 "ldscript.y"
{
(yyvsp[(3) - (5)].version)->versionname = (yyvsp[(1) - (5)].str);
(yyvsp[(3) - (5)].version)->parentname = NULL;
@@ -1972,7 +1972,7 @@ yyreduce:
break;
case 56:
-#line 416 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 416 "ldscript.y"
{
(yyvsp[(3) - (6)].version)->versionname = (yyvsp[(1) - (6)].str);
(yyvsp[(3) - (6)].version)->parentname = (yyvsp[(5) - (6)].str);
@@ -1981,27 +1981,27 @@ yyreduce:
break;
case 57:
-#line 425 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 425 "ldscript.y"
{ (yyval.version) = merge_versions ((yyvsp[(1) - (2)].version), (yyvsp[(2) - (2)].version)); }
break;
case 58:
-#line 427 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 427 "ldscript.y"
{ (yyval.version) = (yyvsp[(1) - (1)].version); }
break;
case 59:
-#line 431 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 431 "ldscript.y"
{ (yyval.version) = new_version (NULL, (yyvsp[(2) - (2)].id_list)); }
break;
case 60:
-#line 433 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 433 "ldscript.y"
{ (yyval.version) = new_version ((yyvsp[(2) - (2)].id_list), NULL); }
break;
case 61:
-#line 438 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 438 "ldscript.y"
{
struct id_list *newp = new_id_listelem ((yyvsp[(2) - (3)].str));
newp->next = (yyvsp[(1) - (3)].id_list)->next;
@@ -2010,27 +2010,27 @@ yyreduce:
break;
case 62:
-#line 444 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 444 "ldscript.y"
{ (yyval.id_list) = new_id_listelem ((yyvsp[(1) - (2)].str)); }
break;
case 63:
-#line 448 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 448 "ldscript.y"
{ (yyval.str) = (yyvsp[(1) - (1)].str); }
break;
case 64:
-#line 450 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 450 "ldscript.y"
{ (yyval.str) = (yyvsp[(1) - (1)].str); }
break;
case 65:
-#line 454 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 454 "ldscript.y"
{ (yyval.str) = (yyvsp[(1) - (1)].str); }
break;
case 66:
-#line 456 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 456 "ldscript.y"
{ (yyval.str) = NULL; }
break;
@@ -2250,7 +2250,7 @@ yyreturn:
}
-#line 459 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 459 "ldscript.y"
static void
diff --git a/elfutils/src/ldscript.h b/elfutils/src/ldscript.h
index 3445c87d..946ef4c6 100644
--- a/elfutils/src/ldscript.h
+++ b/elfutils/src/ldscript.h
@@ -102,7 +102,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 71 "/home/drepper/devel/elfutils/src/ldscript.y"
+#line 71 "ldscript.y"
{
uintmax_t num;
enum expression_tag op;
@@ -117,7 +117,7 @@ typedef union YYSTYPE
struct version *version;
struct id_list *id_list;
}
-/* Line 1529 of yacc.c. */
+/* Line 1489 of yacc.c. */
#line 122 "ldscript.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/elfutils/src/make-debug-archive.in b/elfutils/src/make-debug-archive.in
new file mode 100644
index 00000000..c3fcbce4
--- /dev/null
+++ b/elfutils/src/make-debug-archive.in
@@ -0,0 +1,132 @@
+#!/bin/sh
+#
+# Script to make an offline archive for debugging with libdwfl-based tools.
+#
+# make-debug-archive ARCHIVE {options}
+# make-debug-archive --kernel [--force] [RELEASE]
+#
+# Valid options are those listed under 'Input selection options'
+# by running @UNSTRIP@ --help.
+#
+# The archive installed by --kernel be used automatically by -K.
+# An offline archive can be used via -e in any tool that accepts those options.
+#
+
+UNSTRIP=${UNSTRIP:-@UNSTRIP@}
+AR=${AR:-@AR@}
+SUDO=${SUDO:-/usr/bin/sudo}
+
+LS=/bin/ls
+RM=/bin/rm
+MV=/bin/mv
+MKDIR=/bin/mkdir
+XARGS=/usr/bin/xargs
+
+outdir=${TMPDIR:-/tmp}/debugar$$
+
+usage()
+{
+ echo "Usage: $0 ARCHIVE {options}"
+ echo " or: $0 --kernel [--sudo] [--force] [RELEASE]"
+ echo
+ echo "Valid options are listed under 'Input selection options'"
+ echo "when running: $UNSTRIP --help"
+ echo
+ echo "The --kernel form updates the file used by -K if the"
+ echo "kernel installation has changed, or always with --force."
+ echo "With --sudo, touches the installed file via $SUDO."
+}
+
+fatal_usage()
+{
+ usage >&2
+ exit 2
+}
+
+script_version()
+{
+ echo "`basename $0` (@PACKAGE_NAME@) @PACKAGE_VERSION@"
+ echo "Copyright (C) 2007 Red Hat, Inc."
+ echo "This is free software; see the source for copying conditions."
+ echo "There is NO warranty; not even for MERCHANTABILITY or"
+ echo "FITNESS FOR A PARTICULAR PURPOSE."
+ echo "Written by Roland McGrath."
+}
+
+sudo=
+kernel=no
+force_kernel=no
+while [ $# -gt 0 ]; do
+ case "x$1" in
+ x--help) usage; exit 0 ;;
+ x--version) script_version; exit 0 ;;
+ x--kernel) kernel=yes ;;
+ x--force) force_kernel=yes ;;
+ x--sudo) sudo=$SUDO ;;
+ *) break ;;
+ esac
+ shift
+done
+
+if [ $kernel = no ] && [ $force_kernel = yes -o -n "$sudo" ]; then
+ usage
+fi
+
+if [ $kernel = yes ]; then
+ if [ $# -eq 0 ]; then
+ release=`uname -r`
+ elif [ $# -eq 1 ]; then
+ release=$1
+ else
+ fatal_usage
+ fi
+
+ dir=/usr/lib/debug/lib/modules/$release
+ archive=$dir/debug.a
+ dep=/lib/modules/$release/modules.dep
+
+ if [ ! -d $dir ]; then
+ echo >&2 "$0: $dir not installed"
+ exit 1
+ fi
+
+ # Without --force, bail if the kernel installation is not newer.
+ # This file is normally touched by installing new kernels or modules.
+ if [ $force_kernel = no -a "$archive" -nt "$dep" ]; then
+ exit 0
+ fi
+
+ # We have to kill the old one first, because our own -K would use it.
+ [ ! -e "$archive" ] || $sudo $RM -f "$archive" || exit
+
+ set "$archive" "-K$release"
+fi
+
+if [ $# -lt 2 ]; then
+ fatal_usage
+fi
+
+archive="$1"
+shift
+
+case "$archive" in
+/*) ;;
+*) archive="`/bin/pwd`/$archive" ;;
+esac
+
+if [ -z "$sudo" ]; then
+ new_archive="$archive.new"
+else
+ new_archive="$outdir.a"
+fi
+
+$RM -f "$new_archive" || exit
+
+trap '$RM -rf "$outdir" "$new_archive"' 0 1 2 15
+
+$MKDIR "$outdir" &&
+$UNSTRIP -d "$outdir" -m -a -R "$@" &&
+(cd "$outdir" && $LS | $XARGS $AR cq "$new_archive") &&
+$sudo $MV -f "$new_archive" "$archive"
+
+exit
diff --git a/elfutils/src/nm.c b/elfutils/src/nm.c
index 8558c277..48f08aca 100644
--- a/elfutils/src/nm.c
+++ b/elfutils/src/nm.c
@@ -134,7 +134,7 @@ static int handle_elf (Elf *elf, const char *prefix, const char *fname,
#define INTERNAL_ERROR(fname) \
error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s-%s): %s"), \
- fname, __LINE__, VERSION, __DATE__, elf_errmsg (-1))
+ fname, __LINE__, PACKAGE_VERSION, __DATE__, elf_errmsg (-1))
/* Internal representation of symbols. */
@@ -217,10 +217,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
(void) argp_parse (&argp, argc, argv, 0, &remaining, NULL);
@@ -249,7 +249,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "nm (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "nm (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -938,34 +938,39 @@ show_symbols_posix (Elf *elf, GElf_Word strndx, const char *prefix,
/* Maximum size of memory we allocate on the stack. */
#define MAX_STACK_ALLOC 65536
-static void
-show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn,
- GElf_Shdr *shdr, const char *prefix, const char *fname,
- const char *fullname)
+static int
+sort_by_address (const void *p1, const void *p2)
{
- int sort_by_name (const void *p1, const void *p2)
- {
- GElf_SymX *s1 = (GElf_SymX *) p1;
- GElf_SymX *s2 = (GElf_SymX *) p2;
- int result;
+ GElf_SymX *s1 = (GElf_SymX *) p1;
+ GElf_SymX *s2 = (GElf_SymX *) p2;
- result = strcmp (elf_strptr (ebl->elf, shdr->sh_link, s1->sym.st_name),
- elf_strptr (ebl->elf, shdr->sh_link, s2->sym.st_name));
+ int result = (s1->sym.st_value < s2->sym.st_value
+ ? -1 : (s1->sym.st_value == s2->sym.st_value ? 0 : 1));
- return reverse_sort ? -result : result;
- }
+ return reverse_sort ? -result : result;
+}
- int sort_by_address (const void *p1, const void *p2)
- {
- GElf_SymX *s1 = (GElf_SymX *) p1;
- GElf_SymX *s2 = (GElf_SymX *) p2;
+static Elf_Data *sort_by_name_strtab;
+
+static int
+sort_by_name (const void *p1, const void *p2)
+{
+ GElf_SymX *s1 = (GElf_SymX *) p1;
+ GElf_SymX *s2 = (GElf_SymX *) p2;
- int result = (s1->sym.st_value < s2->sym.st_value
- ? -1 : (s1->sym.st_value == s2->sym.st_value ? 0 : 1));
+ const char *n1 = sort_by_name_strtab->d_buf + s1->sym.st_name;
+ const char *n2 = sort_by_name_strtab->d_buf + s2->sym.st_name;
- return reverse_sort ? -result : result;
- }
+ int result = strcmp (n1, n2);
+
+ return reverse_sort ? -result : result;
+}
+static void
+show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn,
+ GElf_Shdr *shdr, const char *prefix, const char *fname,
+ const char *fullname)
+{
/* Get the section header string table index. */
size_t shstrndx;
if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
@@ -1142,7 +1147,11 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn,
/* Sort the entries according to the users wishes. */
if (sort == sort_name)
- qsort (sym_mem, nentries, sizeof (GElf_SymX), sort_by_name);
+ {
+ sort_by_name_strtab = elf_getdata (elf_getscn (ebl->elf, shdr->sh_link),
+ NULL);
+ qsort (sym_mem, nentries, sizeof (GElf_SymX), sort_by_name);
+ }
else if (sort == sort_numeric)
qsort (sym_mem, nentries, sizeof (GElf_SymX), sort_by_address);
diff --git a/elfutils/src/objdump.c b/elfutils/src/objdump.c
index 373c85b3..13a36c62 100644
--- a/elfutils/src/objdump.c
+++ b/elfutils/src/objdump.c
@@ -103,7 +103,7 @@ static int handle_elf (Elf *elf, const char *prefix, const char *fname,
#define INTERNAL_ERROR(fname) \
error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s-%s): %s"), \
- fname, __LINE__, VERSION, __DATE__, elf_errmsg (-1))
+ fname, __LINE__, PACKAGE_VERSION, __DATE__, elf_errmsg (-1))
/* List of sections which should be used. */
@@ -143,10 +143,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -177,7 +177,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "objdump (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "objdump (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/ranlib.c b/elfutils/src/ranlib.c
index d86a8e39..fa01daf5 100644
--- a/elfutils/src/ranlib.c
+++ b/elfutils/src/ranlib.c
@@ -98,10 +98,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "ranlib (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "ranlib (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/readelf.c b/elfutils/src/readelf.c
index fd61b369..83949b7c 100644
--- a/elfutils/src/readelf.c
+++ b/elfutils/src/readelf.c
@@ -30,6 +30,7 @@
#include <argp.h>
#include <assert.h>
+#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
#include <error.h>
@@ -38,8 +39,10 @@
#include <inttypes.h>
#include <langinfo.h>
#include <libdw.h>
+#include <libdwfl.h>
#include <libintl.h>
#include <locale.h>
+#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -48,8 +51,10 @@
#include <sys/param.h>
#include <system.h>
+#include "../libelf/libelfP.h"
#include "../libebl/libeblP.h"
#include "../libdw/libdwP.h"
+#include "../libdwfl/libdwflP.h"
#include "../libdw/memory-access.h"
@@ -70,8 +75,10 @@ static const struct argp_option options[] =
{ "histogram", 'I', NULL, 0,
N_("Display histogram of bucket list lengths"), 0 },
{ "program-headers", 'l', NULL, 0, N_("Display the program headers"), 0 },
+ { "segments", 'l', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 },
{ "relocs", 'r', NULL, 0, N_("Display relocations"), 0 },
{ "section-headers", 'S', NULL, 0, N_("Display the sections' header"), 0 },
+ { "sections", 'S', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 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,
@@ -81,6 +88,13 @@ static const struct argp_option options[] =
{ "notes", 'n', NULL, 0, N_("Display the core notes"), 0 },
{ "arch-specific", 'A', NULL, 0,
N_("Display architecture specific information (if any)"), 0 },
+ { "hex-dump", 'x', "SECTION", 0,
+ N_("Dump the uninterpreted contents of SECTION, by number or name"), 0 },
+ { "strings", 'p', "SECTION", OPTION_ARG_OPTIONAL,
+ N_("Print string contents of sections"), 0 },
+ { "string-dump", 'p', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 },
+ { "archive-index", 'c', NULL, 0,
+ N_("Display the symbol index of an archive"), 0 },
{ NULL, 0, NULL, 0, N_("Output control:"), 0 },
@@ -139,6 +153,15 @@ static bool print_arch;
/* True if note section content should be printed. */
static bool print_notes;
+/* True if SHF_STRINGS section content should be printed. */
+static bool print_string_sections;
+
+/* True if archive index should be printed. */
+static bool print_archive_index;
+
+/* True if any of the control options except print_archive_index is set. */
+static bool any_control_option;
+
/* Select printing of debugging sections. */
static enum section_e
{
@@ -158,15 +181,27 @@ static enum section_e
| section_ranges)
} print_debug_sections;
+/* Select hex dumping of sections. */
+static struct section_argument *dump_data_sections;
+static struct section_argument **dump_data_sections_tail = &dump_data_sections;
+
+/* Select string dumping of sections. */
+static struct section_argument *string_sections;
+static struct section_argument **string_sections_tail = &string_sections;
+
+struct section_argument
+{
+ struct section_argument *next;
+ const char *arg;
+};
+
/* Number of sections in the file. */
static size_t shnum;
/* Declarations of local functions. */
-static void process_file (int fd, Elf *elf, const char *prefix,
- const char *fname, bool only_one);
-static void process_elf_file (Elf *elf, const char *prefix, const char *fname,
- bool only_one);
+static void process_file (int fd, const char *fname, bool only_one);
+static void process_elf_file (Dwfl_Module *dwflmod, int fd);
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);
@@ -182,10 +217,14 @@ 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 print_debug (Dwfl_Module *dwflmod, 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);
+static void dump_data (Ebl *ebl);
+static void dump_strings (Ebl *ebl);
+static void print_strings (Ebl *ebl);
+static void dump_archive_index (Elf *, const char *);
int
@@ -195,7 +234,7 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
/* Initialize the message catalog. */
- textdomain (PACKAGE);
+ textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -216,20 +255,7 @@ main (int argc, char *argv[])
continue;
}
- /* Create an `Elf' descriptor. */
- 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));
- else
- {
- process_file (fd, elf, NULL, argv[remaining], only_one);
-
- /* Now we can close the descriptor. */
- if (elf_end (elf) != 0)
- error (0, 0, gettext ("error while closing Elf descriptor: %s"),
- elf_errmsg (-1));
- }
+ process_file (fd, argv[remaining], only_one);
close (fd);
}
@@ -244,9 +270,6 @@ static error_t
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':
@@ -307,6 +330,9 @@ parse_opt (int key, char *arg,
print_version_info = true;
any_control_option = true;
break;
+ case 'c':
+ print_archive_index = true;
+ break;
case 'w':
if (arg == NULL)
print_debug_sections = section_all;
@@ -340,11 +366,31 @@ parse_opt (int key, char *arg,
}
any_control_option = true;
break;
+ case 'p':
+ any_control_option = true;
+ if (arg == NULL)
+ {
+ print_string_sections = true;
+ break;
+ }
+ /* Fall through. */
+ case 'x':
+ {
+ struct section_argument *a = xmalloc (sizeof *a);
+ a->arg = arg;
+ a->next = NULL;
+ struct section_argument ***tailp
+ = key == 'x' ? &dump_data_sections_tail : &string_sections_tail;
+ **tailp = a;
+ *tailp = &a->next;
+ }
+ 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)
+ if (! any_control_option && ! print_archive_index)
{
fputs (gettext ("No operation specified.\n"), stderr);
do_argp_help:
@@ -364,7 +410,7 @@ parse_opt (int key, char *arg,
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "readelf (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "readelf (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -374,96 +420,156 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
}
-/* Process one file. */
+/* Check if the file is an archive, and if so dump its index. */
static void
-process_file (int fd, Elf *elf, const char *prefix, const char *fname,
- bool only_one)
+check_archive_index (int fd, const char *fname, bool only_one)
+{
+ /* Create an `Elf' descriptor. */
+ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ error (0, 0, gettext ("cannot generate Elf descriptor: %s"),
+ elf_errmsg (-1));
+ else
+ {
+ if (elf_kind (elf) == ELF_K_AR)
+ {
+ if (!only_one)
+ printf ("\n%s:\n\n", fname);
+ dump_archive_index (elf, fname);
+ }
+ else
+ error (0, 0,
+ gettext ("'%s' is not an archive, cannot print archive index"),
+ fname);
+
+ /* Now we can close the descriptor. */
+ if (elf_end (elf) != 0)
+ error (0, 0, gettext ("error while closing Elf descriptor: %s"),
+ elf_errmsg (-1));
+ }
+}
+
+/* Trivial callback used for checking if we opened an archive. */
+static int
+count_dwflmod (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ void **userdata __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ void *arg)
+{
+ *(bool *) arg = false;
+ return DWARF_CB_ABORT;
+}
+
+struct process_dwflmod_args
+{
+ int fd;
+ bool only_one;
+};
+
+static int
+process_dwflmod (Dwfl_Module *dwflmod,
+ void **userdata __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ void *arg)
{
- /* We can handle two types of files: ELF files and archives. */
- Elf_Kind kind = elf_kind (elf);
- struct stat64 st;
+ const struct process_dwflmod_args *a = arg;
- switch (kind)
+ /* Print the file name. */
+ if (!a->only_one)
{
- case ELF_K_ELF:
- /* Yes! It's an ELF file. */
- process_elf_file (elf, prefix, fname, only_one);
- break;
+ const char *fname;
+ dwfl_module_info (dwflmod, NULL, NULL, NULL, NULL, NULL, &fname, NULL);
- case ELF_K_AR:
- {
- size_t prefix_len = prefix == NULL ? 0 : strlen (prefix);
- size_t fname_len = strlen (fname) + 1;
- char new_prefix[prefix_len + 1 + fname_len];
- char *cp = new_prefix;
+ printf ("\n%s:\n\n", fname);
+ }
- /* Create the full name of the file. */
- if (prefix != NULL)
- {
- cp = mempcpy (cp, prefix, prefix_len);
- *cp++ = ':';
- }
- memcpy (cp, fname, fname_len);
+ process_elf_file (dwflmod, a->fd);
- /* It's an archive. We process each file in it. */
- Elf *subelf;
- Elf_Cmd cmd = ELF_C_READ_MMAP;
- while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
- {
- kind = elf_kind (subelf);
+ return DWARF_CB_OK;
+}
- /* Call this function recursively. */
- if (kind == ELF_K_ELF || kind == ELF_K_AR)
- {
- Elf_Arhdr *arhdr = elf_getarhdr (subelf);
- assert (arhdr != NULL);
+/* Stub libdwfl callback, only the ELF handle already open is ever used. */
+static int
+find_no_debuginfo (Dwfl_Module *mod __attribute__ ((unused)),
+ void **userdata __attribute__ ((unused)),
+ const char *modname __attribute__ ((unused)),
+ Dwarf_Addr base __attribute__ ((unused)),
+ const char *file_name __attribute__ ((unused)),
+ const char *debuglink_file __attribute__ ((unused)),
+ GElf_Word debuglink_crc __attribute__ ((unused)),
+ char **debuginfo_file_name __attribute__ ((unused)))
+{
+ return -1;
+}
- process_file (fd, subelf, new_prefix, arhdr->ar_name, false);
- }
+/* Process one input file. */
+static void
+process_file (int fd, const char *fname, bool only_one)
+{
+ if (print_archive_index)
+ check_archive_index (fd, fname, only_one);
- /* Get next archive element. */
- cmd = elf_next (subelf);
- if (elf_end (subelf) != 0)
- error (0, 0,
- gettext (" error while freeing sub-ELF descriptor: %s\n"),
- elf_errmsg (-1));
- }
- }
- break;
+ if (!any_control_option)
+ return;
- default:
+ /* Duplicate an fd for dwfl_report_offline to swallow. */
+ int dwfl_fd = dup (fd);
+ if (unlikely (dwfl_fd < 0))
+ error (EXIT_FAILURE, errno, "dup");
+
+ /* Use libdwfl in a trivial way to open the libdw handle for us.
+ This takes care of applying relocations to DWARF data in ET_REL files. */
+ static const Dwfl_Callbacks callbacks =
+ {
+ .section_address = dwfl_offline_section_address,
+ .find_debuginfo = find_no_debuginfo
+ };
+ Dwfl *dwfl = dwfl_begin (&callbacks);
+ if (likely (dwfl != NULL))
+ /* Let 0 be the logical address of the file (or first in archive). */
+ dwfl->offline_next_address = 0;
+ if (dwfl_report_offline (dwfl, fname, fname, dwfl_fd) == NULL)
+ {
+ struct stat64 st;
if (fstat64 (fd, &st) != 0)
error (0, errno, gettext ("cannot stat input file"));
else if (st.st_size == 0)
error (0, 0, gettext ("input file is empty"));
else
- /* We cannot do anything. */
- error (0, 0, gettext ("\
-Not an ELF file - it has the wrong magic bytes at the start"));
- break;
+ error (0, 0, gettext ("failed reading '%s': %s"),
+ fname, dwfl_errmsg (-1));
+ }
+ else
+ {
+ dwfl_report_end (dwfl, NULL, NULL);
+
+ if (only_one)
+ /* Clear ONLY_ONE if we have multiple modules, from an archive. */
+ dwfl_getmodules (dwfl, &count_dwflmod, &only_one, 1);
+
+ /* Process the one or more modules gleaned from this file. */
+ struct process_dwflmod_args a = { .fd = fd, .only_one = only_one };
+ dwfl_getmodules (dwfl, &process_dwflmod, &a, 0);
}
+ dwfl_end (dwfl);
}
-/* Process one file. */
+/* Process one ELF file. */
static void
-process_elf_file (Elf *elf, const char *prefix, const char *fname,
- bool only_one)
+process_elf_file (Dwfl_Module *dwflmod, int fd)
{
+ GElf_Addr dwflbias;
+ Elf *elf = dwfl_module_getelf (dwflmod, &dwflbias);
+
GElf_Ehdr ehdr_mem;
GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
- /* Print the file name. */
- if (!only_one)
- {
- if (prefix != NULL)
- printf ("\n%s(%s):\n\n", prefix, fname);
- else
- printf ("\n%s:\n\n", fname);
- }
-
if (ehdr == NULL)
{
+ elf_error:
error (0, 0, gettext ("cannot read ELF header: %s"), elf_errmsg (-1));
return;
}
@@ -471,6 +577,7 @@ process_elf_file (Elf *elf, const char *prefix, const char *fname,
Ebl *ebl = ebl_openbackend (elf);
if (ebl == NULL)
{
+ ebl_error:
error (0, errno, gettext ("cannot create EBL handle"));
return;
}
@@ -481,10 +588,40 @@ process_elf_file (Elf *elf, const char *prefix, const char *fname,
gettext ("cannot determine number of sections: %s"),
elf_errmsg (-1));
+ /* For an ET_REL file, libdwfl has adjusted the in-core shdrs
+ and may have applied relocation to some sections.
+ So we need to get a fresh Elf handle on the file to display those. */
+ bool print_unrelocated = (print_section_header
+ || print_relocations
+ || dump_data_sections != NULL
+ || print_notes);
+
+ Elf *pure_elf = NULL;
+ Ebl *pure_ebl = ebl;
+ if (ehdr->e_type == ET_REL && print_unrelocated)
+ {
+ /* Read the file afresh. */
+ pure_elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ off64_t aroff = elf_getaroff (elf);
+ if (aroff > 0)
+ {
+ /* Archive member. */
+ (void) elf_rand (pure_elf, aroff);
+ Elf *armem = elf_begin (-1, ELF_C_READ_MMAP, pure_elf);
+ elf_end (pure_elf);
+ pure_elf = armem;
+ }
+ if (pure_elf == NULL)
+ goto elf_error;
+ pure_ebl = ebl_openbackend (pure_elf);
+ if (pure_ebl == NULL)
+ goto ebl_error;
+ }
+
if (print_file_header)
print_ehdr (ebl, ehdr);
if (print_section_header)
- print_shdr (ebl, ehdr);
+ print_shdr (pure_ebl, ehdr);
if (print_program_header)
print_phdr (ebl, ehdr);
if (print_section_groups)
@@ -492,7 +629,7 @@ process_elf_file (Elf *elf, const char *prefix, const char *fname,
if (print_dynamic_table)
print_dynamic (ebl, ehdr);
if (print_relocations)
- print_relocs (ebl);
+ print_relocs (pure_ebl);
if (print_histogram)
handle_hash (ebl);
if (print_symbol_table)
@@ -503,12 +640,24 @@ process_elf_file (Elf *elf, const char *prefix, const char *fname,
print_symtab (ebl, SHT_SYMTAB);
if (print_arch)
print_liblist (ebl);
+ if (dump_data_sections != NULL)
+ dump_data (pure_ebl);
+ if (string_sections != NULL)
+ dump_strings (ebl);
if (print_debug_sections != 0)
- print_debug (ebl, ehdr);
+ print_debug (dwflmod, ebl, ehdr);
if (print_notes)
- handle_notes (ebl, ehdr);
+ handle_notes (pure_ebl, ehdr);
+ if (print_string_sections)
+ print_strings (ebl);
ebl_closebackend (ebl);
+
+ if (pure_ebl != ebl)
+ {
+ ebl_closebackend (pure_ebl);
+ elf_end (pure_elf);
+ }
}
@@ -518,7 +667,7 @@ print_file_type (unsigned short int e_type)
{
if (e_type <= ET_CORE)
{
- static const char *knowntypes[] =
+ static const char *const knowntypes[] =
{
N_("NONE (None)"),
N_("REL (Relocatable file)"),
@@ -2645,10 +2794,83 @@ print_liblist (Ebl *ebl)
}
+static char *
+format_dwarf_addr (Dwfl_Module *dwflmod,
+ int address_size, Dwarf_Addr address)
+{
+ /* See if there is a name we can give for this address. */
+ GElf_Sym sym;
+ const char *name = dwfl_module_addrsym (dwflmod, address, &sym, NULL);
+ if (name != NULL)
+ sym.st_value = address - sym.st_value;
+
+ /* Relativize the address. */
+ int n = dwfl_module_relocations (dwflmod);
+ int i = n < 1 ? -1 : dwfl_module_relocate_address (dwflmod, &address);
+
+ /* In an ET_REL file there is a section name to refer to. */
+ const char *scn = (i < 0 ? NULL
+ : dwfl_module_relocation_info (dwflmod, i, NULL));
+
+ char *result;
+ if ((name != NULL
+ ? (sym.st_value != 0
+ ? (scn != NULL
+ ? (address_size == 0
+ ? asprintf (&result,
+ gettext ("%s+%#" PRIx64 " <%s+%#" PRIx64 ">"),
+ scn, address, name, sym.st_value)
+ : asprintf (&result,
+ gettext ("%s+%#0*" PRIx64 " <%s+%#" PRIx64 ">"),
+ scn, 2 + address_size * 2, address,
+ name, sym.st_value))
+ : (address_size == 0
+ ? asprintf (&result,
+ gettext ("%#" PRIx64 " <%s+%#" PRIx64 ">"),
+ address, name, sym.st_value)
+ : asprintf (&result,
+ gettext ("%#0*" PRIx64 " <%s+%#" PRIx64 ">"),
+ 2 + address_size * 2, address,
+ name, sym.st_value)))
+ : (scn != NULL
+ ? (address_size == 0
+ ? asprintf (&result,
+ gettext ("%s+%#" PRIx64 " <%s>"),
+ scn, address, name)
+ : asprintf (&result,
+ gettext ("%s+%#0*" PRIx64 " <%s>"),
+ scn, 2 + address_size * 2, address, name))
+ : (address_size == 0
+ ? asprintf (&result,
+ gettext ("%#" PRIx64 " <%s>"),
+ address, name)
+ : asprintf (&result,
+ gettext ("%#0*" PRIx64 " <%s>"),
+ 2 + address_size * 2, address, name))))
+ : (scn != NULL
+ ? (address_size == 0
+ ? asprintf (&result,
+ gettext ("%s+%#" PRIx64),
+ scn, address)
+ : asprintf (&result,
+ gettext ("%s+%#0*" PRIx64),
+ scn, 2 + address_size * 2, address))
+ : (address_size == 0
+ ? asprintf (&result,
+ "%#" PRIx64,
+ address)
+ : asprintf (&result,
+ "%#0*" PRIx64,
+ 2 + address_size * 2, address)))) < 0)
+ error (EXIT_FAILURE, 0, _("memory exhausted"));
+
+ return result;
+}
+
static const char *
dwarf_tag_string (unsigned int tag)
{
- static const char *known_tags[] =
+ static const char *const known_tags[] =
{
[DW_TAG_array_type] = "array_type",
[DW_TAG_class_type] = "class_type",
@@ -2753,7 +2975,7 @@ dwarf_tag_string (unsigned int tag)
static const char *
dwarf_attr_string (unsigned int attrnum)
{
- static const char *known_attrs[] =
+ static const char *const known_attrs[] =
{
[DW_AT_sibling] = "sibling",
[DW_AT_location] = "location",
@@ -2967,7 +3189,7 @@ dwarf_attr_string (unsigned int attrnum)
static const char *
dwarf_form_string (unsigned int form)
{
- static const char *known_forms[] =
+ static const char *const known_forms[] =
{
[DW_FORM_addr] = "addr",
[DW_FORM_block2] = "block2",
@@ -3010,7 +3232,7 @@ dwarf_form_string (unsigned int form)
static const char *
dwarf_lang_string (unsigned int lang)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_LANG_C89] = "ISO C89",
[DW_LANG_C] = "C",
@@ -3053,7 +3275,7 @@ dwarf_lang_string (unsigned int lang)
static const char *
dwarf_inline_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_INL_not_inlined] = "not_inlined",
[DW_INL_inlined] = "inlined",
@@ -3071,7 +3293,7 @@ dwarf_inline_string (unsigned int code)
static const char *
dwarf_encoding_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_ATE_void] = "void",
[DW_ATE_address] = "address",
@@ -3108,7 +3330,7 @@ dwarf_encoding_string (unsigned int code)
static const char *
dwarf_access_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_ACCESS_public] = "public",
[DW_ACCESS_protected] = "protected",
@@ -3125,7 +3347,7 @@ dwarf_access_string (unsigned int code)
static const char *
dwarf_visibility_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_VIS_local] = "local",
[DW_VIS_exported] = "exported",
@@ -3142,7 +3364,7 @@ dwarf_visibility_string (unsigned int code)
static const char *
dwarf_virtuality_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_VIRTUALITY_none] = "none",
[DW_VIRTUALITY_virtual] = "virtual",
@@ -3159,7 +3381,7 @@ dwarf_virtuality_string (unsigned int code)
static const char *
dwarf_identifier_case_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_ID_case_sensitive] = "sensitive",
[DW_ID_up_case] = "up_case",
@@ -3177,7 +3399,7 @@ dwarf_identifier_case_string (unsigned int code)
static const char *
dwarf_calling_convention_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_CC_normal] = "normal",
[DW_CC_program] = "program",
@@ -3201,7 +3423,7 @@ dwarf_calling_convention_string (unsigned int code)
static const char *
dwarf_ordering_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_ORD_row_major] = "row_major",
[DW_ORD_col_major] = "col_major"
@@ -3217,7 +3439,7 @@ dwarf_ordering_string (unsigned int code)
static const char *
dwarf_discr_list_string (unsigned int code)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_DSC_label] = "label",
[DW_DSC_range] = "range"
@@ -3231,10 +3453,10 @@ dwarf_discr_list_string (unsigned int code)
static void
-print_ops (Dwarf *dbg, int indent, int indentrest,
+print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
unsigned int addrsize, Dwarf_Word len, const unsigned char *data)
{
- static const char *known[] =
+ static const char *const known[] =
{
[DW_OP_addr] = "addr",
[DW_OP_deref] = "deref",
@@ -3411,9 +3633,18 @@ print_ops (Dwarf *dbg, int indent, int indentrest,
data += addrsize;
len -= addrsize;
- printf ("%*s[%4" PRIuMAX "] %s %" PRIuMAX "\n",
- indent, "", (uintmax_t) offset,
- known[op] ?: "???", (uintmax_t) addr);
+ if (op == DW_OP_addr)
+ {
+ char *a = format_dwarf_addr (dwflmod, 0, addr);
+ printf ("%*s[%4" PRIuMAX "] %s %s\n",
+ indent, "", (uintmax_t) offset,
+ known[op] ?: "???", a);
+ free (a);
+ }
+ else
+ printf ("%*s[%4" PRIuMAX "] %s %#" PRIxMAX "\n",
+ indent, "", (uintmax_t) offset,
+ known[op] ?: "???", (uintmax_t) addr);
offset += 1 + addrsize;
break;
@@ -3570,7 +3801,8 @@ print_ops (Dwarf *dbg, int indent, int indentrest,
static void
-print_debug_abbrev_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_abbrev_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr, Dwarf *dbg)
@@ -3641,7 +3873,8 @@ print_debug_abbrev_section (Ebl *ebl __attribute__ ((unused)),
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 __attribute__ ((unused)),
+print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr, Dwarf *dbg)
@@ -3697,7 +3930,8 @@ print_debug_aranges_section (Ebl *ebl __attribute__ ((unused)),
/* Print content of DWARF .debug_ranges section. */
static void
-print_debug_ranges_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_ranges_section (Dwfl_Module *dwflmod,
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg)
{
@@ -3724,7 +3958,7 @@ print_debug_ranges_section (Ebl *ebl __attribute__ ((unused)),
if (data->d_size - offset < address_size * 2)
{
- printf (" [%6tx] <INVALID DATA>\n", offset);
+ printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
break;
}
@@ -3744,21 +3978,24 @@ print_debug_ranges_section (Ebl *ebl __attribute__ ((unused)),
}
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
- printf (" [%6tx] base address %#0*" PRIxMAX "\n", offset,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ {
+ char *b = format_dwarf_addr (dwflmod, address_size, end);
+ printf (gettext (" [%6tx] base address %s\n"), offset, b);
+ free (b);
+ }
else if (begin == 0 && end == 0) /* End of list entry. */
first = true;
else
{
+ char *b = format_dwarf_addr (dwflmod, address_size, begin);
+ char *e = format_dwarf_addr (dwflmod, address_size, end);
/* We have an address range entry. */
if (first) /* First address range entry in a list. */
- printf (" [%6tx] %#0*" PRIxMAX "..%#0*" PRIxMAX "\n", offset,
- 2 + (int) (address_size * 2), (uintmax_t) begin,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ printf (gettext (" [%6tx] %s..%s\n"), offset, b, e);
else
- printf (" %#0*" PRIxMAX "..%#0*" PRIxMAX "\n",
- 2 + (int) (address_size * 2), (uintmax_t) begin,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ printf (gettext (" %s..%s\n"), b, e);
+ free (b);
+ free (e);
first = false;
}
@@ -3767,7 +4004,8 @@ print_debug_ranges_section (Ebl *ebl __attribute__ ((unused)),
static void
-print_debug_frame_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_frame_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr __attribute__ ((unused)),
@@ -3778,6 +4016,7 @@ print_debug_frame_section (Ebl *ebl __attribute__ ((unused)),
struct attrcb_args
{
+ Dwfl_Module *dwflmod;
Dwarf *dbg;
int level;
unsigned int addrsize;
@@ -3809,18 +4048,21 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
switch (form)
{
- case DW_FORM_addr:;
- Dwarf_Addr addr;
- if (unlikely (dwarf_formaddr (attrp, &addr) != 0))
- {
- attrval_out:
- error (0, 0, gettext ("cannot get attribute value: %s"),
- dwarf_errmsg (-1));
- return DWARF_CB_ABORT;
- }
- printf (" %*s%-20s %#0*" PRIxMAX "\n",
- (int) (level * 2), "", dwarf_attr_string (attr),
- 2 + (int) (cbargs->addrsize * 2), (uintmax_t) addr);
+ case DW_FORM_addr:
+ {
+ Dwarf_Addr addr;
+ if (unlikely (dwarf_formaddr (attrp, &addr) != 0))
+ {
+ attrval_out:
+ error (0, 0, gettext ("cannot get attribute value: %s"),
+ dwarf_errmsg (-1));
+ return DWARF_CB_ABORT;
+ }
+ char *a = format_dwarf_addr (cbargs->dwflmod, cbargs->addrsize, addr);
+ printf (" %*s%-20s %s\n",
+ (int) (level * 2), "", dwarf_attr_string (attr), a);
+ free (a);
+ }
break;
case DW_FORM_indirect:
@@ -3839,13 +4081,13 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_FORM_ref4:
case DW_FORM_ref2:
case DW_FORM_ref1:;
- Dwarf_Off ref;
- if (unlikely (dwarf_formref (attrp, &ref) != 0))
+ Dwarf_Die ref;
+ if (unlikely (dwarf_formref_die (attrp, &ref) == NULL))
goto attrval_out;
printf (" %*s%-20s [%6" PRIxMAX "]\n",
(int) (level * 2), "", dwarf_attr_string (attr),
- (uintmax_t) (ref + cbargs->cu_offset));
+ (uintmax_t) dwarf_dieoffset (&ref));
break;
case DW_FORM_udata:
@@ -3862,6 +4104,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
switch (attr)
{
case DW_AT_location:
+ case DW_AT_data_location:
case DW_AT_data_member_location:
case DW_AT_vtable_elem_location:
case DW_AT_string_length:
@@ -3950,6 +4193,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
switch (attr)
{
case DW_AT_location:
+ case DW_AT_data_location:
case DW_AT_data_member_location:
case DW_AT_vtable_elem_location:
case DW_AT_string_length:
@@ -3957,7 +4201,8 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_AT_frame_base:
case DW_AT_return_addr:
case DW_AT_static_link:
- print_ops (cbargs->dbg, 12 + level * 2, 12 + level * 2,
+ print_ops (cbargs->dwflmod, cbargs->dbg,
+ 12 + level * 2, 12 + level * 2,
cbargs->addrsize, block.length, block.data);
break;
}
@@ -3975,7 +4220,8 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
static void
-print_debug_info_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_info_section (Dwfl_Module *dwflmod,
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr, Dwarf *dbg)
@@ -4012,6 +4258,7 @@ print_debug_info_section (Ebl *ebl __attribute__ ((unused)),
struct attrcb_args args;
+ args.dwflmod = dwflmod;
args.dbg = dbg;
args.addrsize = addrsize;
args.cu_offset = offset;
@@ -4047,97 +4294,9 @@ print_debug_info_section (Ebl *ebl __attribute__ ((unused)),
goto do_return;
}
-#if 1
- const char *tagstr = dwarf_tag_string (tag);
-#else
- static const char *const lowtags[] =
- {
- [DW_TAG_array_type] = "array_type",
- [DW_TAG_class_type] = "class_type",
- [DW_TAG_entry_point] = "entry_point",
- [DW_TAG_enumeration_type] = "enumeration_type",
- [DW_TAG_formal_parameter] = "formal_parameter",
- [DW_TAG_imported_declaration] = "imported_declaration",
- [DW_TAG_label] = "label",
- [DW_TAG_lexical_block] = "lexical_block",
- [DW_TAG_member] = "member",
- [DW_TAG_pointer_type] = "pointer_type",
- [DW_TAG_reference_type] = "reference_type",
- [DW_TAG_compile_unit] = "compile_unit",
- [DW_TAG_string_type] = "string_type",
- [DW_TAG_structure_type] = "structure_type",
- [DW_TAG_subroutine_type] = "subroutine_type",
- [DW_TAG_typedef] = "typedef",
- [DW_TAG_union_type] = "union_type",
- [DW_TAG_unspecified_parameters] = "unspecified_parameters",
- [DW_TAG_variant] = "variant",
- [DW_TAG_common_block] = "common_block",
- [DW_TAG_common_inclusion] = "common_inclusion",
- [DW_TAG_inheritance] = "inheritance",
- [DW_TAG_inlined_subroutine] = "inlined_subroutine",
- [DW_TAG_module] = "module",
- [DW_TAG_ptr_to_member_type] = "ptr_to_member_type",
- [DW_TAG_set_type] = "set_type",
- [DW_TAG_subrange_type] = "subrange_type",
- [DW_TAG_with_stmt] = "with_stmt",
- [DW_TAG_access_declaration] = "access_declaration",
- [DW_TAG_base_type] = "base_type",
- [DW_TAG_catch_block] = "catch_block",
- [DW_TAG_const_type] = "const_type",
- [DW_TAG_constant] = "constant",
- [DW_TAG_enumerator] = "enumerator",
- [DW_TAG_file_type] = "file_type",
- [DW_TAG_friend] = "friend",
- [DW_TAG_namelist] = "namelist",
- [DW_TAG_namelist_item] = "namelist_item",
- [DW_TAG_packed_type] = "packed_type",
- [DW_TAG_subprogram] = "subprogram",
- [DW_TAG_template_type_param] = "template_type_param",
- [DW_TAG_template_value_param] = "template_value_param",
- [DW_TAG_thrown_type] = "thrown_type",
- [DW_TAG_try_block] = "try_block",
- [DW_TAG_variant_part] = "variant_part",
- [DW_TAG_variable] = "variable",
- [DW_TAG_volatile_type] = "volatile_type"
- };
-
- const char *tagstr;
- switch (tag)
- {
- case DW_TAG_lo_user:
- tagstr = "lo_user";
- break;
-
- case DW_TAG_MIPS_loop:
- tagstr = "MIPS_loop";
- break;
-
- case DW_TAG_format_label:
- tagstr = "format_label";
- break;
-
- case DW_TAG_function_template:
- tagstr = "function_template";
- break;
-
- case DW_TAG_class_template:
- tagstr = "class_template";
- break;
- case DW_TAG_hi_user:
- tagstr = "hi_user";
- break;
-
- default:
- if (tag < (int) (sizeof (lowtags) / sizeof (lowtags[0])))
- tagstr = lowtags[tag];
- else
- tagstr = "???";
- break;
- }
-#endif
-
printf (" [%6" PRIx64 "] %*s%s\n",
- (uint64_t) offset, (int) (level * 2), "", tagstr);
+ (uint64_t) offset, (int) (level * 2), "",
+ dwarf_tag_string (tag));
/* Print the attribute values. */
args.level = level;
@@ -4184,7 +4343,8 @@ print_debug_info_section (Ebl *ebl __attribute__ ((unused)),
static void
-print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
+print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl,
+ GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
printf (gettext ("\
@@ -4280,7 +4440,15 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
line_range, opcode_base);
if (unlikely (linep + opcode_base - 1 >= lineendp))
- goto invalid_data;
+ {
+ invalid_unit:
+ error (0, 0,
+ gettext ("invalid data at offset %tu in section [%zu] '%s'"),
+ linep - (const unsigned char *) data->d_buf,
+ elf_ndxscn (scn), ".debug_line");
+ linep = lineendp;
+ continue;
+ }
int opcode_base_l10 = 1;
unsigned int tmp = opcode_base;
while (tmp > 10)
@@ -4296,14 +4464,14 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
opcode_base_l10, cnt, linep[cnt - 1]);
linep += opcode_base - 1;
if (unlikely (linep >= lineendp))
- goto invalid_data;
+ goto invalid_unit;
puts (gettext ("\nDirectory table:"));
while (*linep != 0)
{
unsigned char *endp = memchr (linep, '\0', lineendp - linep);
if (endp == NULL)
- goto invalid_data;
+ goto invalid_unit;
printf (" %s\n", (char *) linep);
@@ -4313,7 +4481,7 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
++linep;
if (unlikely (linep >= lineendp))
- goto invalid_data;
+ goto invalid_unit;
puts (gettext ("\nFile name table:\n"
" Entry Dir Time Size Name"));
for (unsigned int cnt = 1; *linep != 0; ++cnt)
@@ -4322,7 +4490,7 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
char *fname = (char *) linep;
unsigned char *endp = memchr (fname, '\0', lineendp - linep);
if (endp == NULL)
- goto invalid_data;
+ goto invalid_unit;
linep = endp + 1;
/* Then the index. */
@@ -4403,22 +4571,23 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
line += line_increment;
address += address_increment;
+ char *a = format_dwarf_addr (dwflmod, 0, address);
printf (gettext ("\
- special opcode %u: address+%u = %#" PRIx64 ", line%+d = %zu\n"),
- opcode, address_increment, (uint64_t) address,
- line_increment, line);
+ special opcode %u: address+%u = %s, line%+d = %zu\n"),
+ opcode, address_increment, a, line_increment, line);
+ free (a);
}
else if (opcode == 0)
{
/* This an extended opcode. */
if (unlikely (linep + 2 > lineendp))
- goto invalid_data;
+ goto invalid_unit;
/* The length. */
unsigned int len = *linep++;
if (unlikely (linep + len > lineendp))
- goto invalid_data;
+ goto invalid_unit;
/* The sub-opcode. */
opcode = *linep++;
@@ -4441,8 +4610,11 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
address = read_4ubyte_unaligned_inc (dbg, linep);
else
address = read_8ubyte_unaligned_inc (dbg, linep);
- printf (gettext ("set address to %#" PRIx64 "\n"),
- (uint64_t) address);
+ {
+ char *a = format_dwarf_addr (dwflmod, 0, address);
+ printf (gettext ("set address to %s\n"), a);
+ free (a);
+ }
break;
case DW_LNE_define_file:
@@ -4451,7 +4623,7 @@ print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr __attribute__ ((unused)),
unsigned char *endp = memchr (linep, '\0',
lineendp - linep);
if (endp == NULL)
- goto invalid_data;
+ goto invalid_unit;
linep = endp + 1;
unsigned int diridx;
@@ -4490,9 +4662,12 @@ define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"),
address. */
get_uleb128 (u128, linep);
address += minimum_instr_len * u128;
- printf (gettext ("\
- advance address by %u to %#" PRIx64 "\n"),
- u128, (uint64_t) address);
+ {
+ char *a = format_dwarf_addr (dwflmod, 0, address);
+ printf (gettext ("advance address by %u to %s\n"),
+ u128, a);
+ free (a);
+ }
break;
case DW_LNS_advance_line:
@@ -4515,7 +4690,7 @@ define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"),
case DW_LNS_set_column:
/* Takes one uleb128 parameter which is stored in column. */
if (unlikely (standard_opcode_lengths[opcode] != 1))
- goto invalid_data;
+ goto invalid_unit;
get_uleb128 (u128, linep);
printf (gettext (" set column to %" PRIu64 "\n"),
@@ -4539,22 +4714,29 @@ define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"),
u128 = (minimum_instr_len
* ((255 - opcode_base) / line_range));
address += u128;
- printf (gettext ("\
- advance address by constant %u to %#" PRIx64 "\n"),
- u128, (uint64_t) address);
+ {
+ char *a = format_dwarf_addr (dwflmod, 0, address);
+ printf (gettext ("advance address by constant %u to %s\n"),
+ u128, a);
+ free (a);
+ }
break;
case DW_LNS_fixed_advance_pc:
/* Takes one 16 bit parameter which is added to the
address. */
if (unlikely (standard_opcode_lengths[opcode] != 1))
- goto invalid_data;
+ goto invalid_unit;
u128 = read_2ubyte_unaligned_inc (dbg, linep);
address += u128;
- printf (gettext ("\
- advance address by fixed value %u to %#" PRIx64 "\n"),
- u128, (uint64_t) address);
+ {
+ char *a = format_dwarf_addr (dwflmod, 0, address);
+ printf (gettext ("\
+advance address by fixed value %u to %s\n"),
+ u128, a);
+ free (a);
+ }
break;
case DW_LNS_set_prologue_end:
@@ -4597,7 +4779,8 @@ define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"),
static void
-print_debug_loc_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_loc_section (Dwfl_Module *dwflmod,
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr,
@@ -4626,7 +4809,7 @@ print_debug_loc_section (Ebl *ebl __attribute__ ((unused)),
if (data->d_size - offset < address_size * 2)
{
- printf (" [%6tx] <INVALID DATA>\n", offset);
+ printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
break;
}
@@ -4646,8 +4829,11 @@ print_debug_loc_section (Ebl *ebl __attribute__ ((unused)),
}
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
- printf (" [%6tx] base address %#0*" PRIxMAX "\n", offset,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ {
+ char *b = format_dwarf_addr (dwflmod, address_size, end);
+ printf (gettext (" [%6tx] base address %s\n"), offset, b);
+ free (b);
+ }
else if (begin == 0 && end == 0) /* End of list entry. */
first = true;
else
@@ -4655,17 +4841,18 @@ print_debug_loc_section (Ebl *ebl __attribute__ ((unused)),
/* We have a location expression entry. */
uint_fast16_t len = read_2ubyte_unaligned_inc (dbg, readp);
+ char *b = format_dwarf_addr (dwflmod, address_size, begin);
+ char *e = format_dwarf_addr (dwflmod, address_size, end);
+
if (first) /* First entry in a list. */
- printf (" [%6tx] %#0*" PRIxMAX "..%#0*" PRIxMAX,
- offset,
- 2 + (int) (address_size * 2), (uintmax_t) begin,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ printf (gettext (" [%6tx] %s..%s"), offset, b, e);
else
- printf (" %#0*" PRIxMAX "..%#0*" PRIxMAX,
- 2 + (int) (address_size * 2), (uintmax_t) begin,
- 2 + (int) (address_size * 2), (uintmax_t) end);
+ printf (gettext (" %s..%s"), b, e);
- print_ops (dbg, 1, 18 + (address_size * 4),
+ free (b);
+ free (e);
+
+ print_ops (dwflmod, dbg, 1, 18 + (address_size * 4),
address_size, len, readp);
first = false;
@@ -4698,7 +4885,8 @@ mac_compare (const void *p1, const void *p2)
static void
-print_debug_macinfo_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_macinfo_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
@@ -4869,7 +5057,8 @@ print_pubnames (Dwarf *dbg __attribute__ ((unused)), Dwarf_Global *global,
/* Print the known exported symbols in the DWARF section '.debug_pubnames'. */
static void
-print_debug_pubnames_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_pubnames_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr, Dwarf *dbg)
@@ -4883,7 +5072,8 @@ print_debug_pubnames_section (Ebl *ebl __attribute__ ((unused)),
/* Print the content of the DWARF string section '.debug_str'. */
static void
-print_debug_str_section (Ebl *ebl __attribute__ ((unused)),
+print_debug_str_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
+ Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn __attribute__ ((unused)),
GElf_Shdr *shdr, Dwarf *dbg)
@@ -4922,44 +5112,40 @@ print_debug_str_section (Ebl *ebl __attribute__ ((unused)),
}
}
-
static void
-print_debug (Ebl *ebl, GElf_Ehdr *ehdr)
+print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
{
- /* Find the version information sections. For this we have to
- search through the section table. */
- Dwarf *dbg;
- Elf_Scn *scn;
- size_t shstrndx;
-
/* Before we start the real work get a debug context descriptor. */
- dbg = dwarf_begin_elf (ebl->elf, DWARF_C_READ, NULL);
+ Dwarf_Addr dwbias;
+ Dwarf *dbg = dwfl_module_getdwarf (dwflmod, &dwbias);
if (dbg == NULL)
{
error (0, 0, gettext ("cannot get debug context descriptor: %s"),
- dwarf_errmsg (-1));
+ dwfl_errmsg (-1));
return;
}
/* Get the section header string table index. */
+ size_t shstrndx;
if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
- scn = NULL;
+ /* Look through all the sections for the debugging sections to print. */
+ Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
{
- /* Handle the section if it is part of the versioning handling. */
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL || shdr->sh_type != SHT_PROGBITS)
+ if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
{
static const struct
{
const char *name;
enum section_e bitmask;
- void (*fp) (Ebl *, GElf_Ehdr *, Elf_Scn *, GElf_Shdr *, Dwarf *);
+ void (*fp) (Dwfl_Module *, Ebl *,
+ GElf_Ehdr *, Elf_Scn *, GElf_Shdr *, Dwarf *);
} debug_sections[] =
{
#define NEW_SECTION(name) \
@@ -4986,26 +5172,749 @@ print_debug (Ebl *ebl, GElf_Ehdr *ehdr)
if (strcmp (name, debug_sections[n].name) == 0)
{
if (print_debug_sections & debug_sections[n].bitmask)
- debug_sections[n].fp (ebl, ehdr, scn, shdr, dbg);
+ debug_sections[n].fp (dwflmod, ebl, ehdr, scn, shdr, dbg);
break;
}
}
}
+}
+
+
+#define ITEM_INDENT 4
+#define ITEM_WRAP_COLUMN 150
+#define REGISTER_WRAP_COLUMN 75
+
+/* Print "NAME: FORMAT", wrapping when FORMAT_MAX chars of FORMAT would
+ make the line exceed ITEM_WRAP_COLUMN. Unpadded numbers look better
+ for the core items. But we do not want the line breaks to depend on
+ the particular values. */
+static unsigned int
+__attribute__ ((format (printf, 7, 8)))
+print_core_item (unsigned int colno, char sep, unsigned int wrap,
+ size_t name_width, const char *name,
+ size_t format_max, const char *format, ...)
+{
+ size_t len = strlen (name);
+ if (name_width < len)
+ name_width = len;
+
+ size_t n = name_width + sizeof ": " - 1 + format_max;
+
+ if (colno == 0)
+ {
+ printf ("%*s", ITEM_INDENT, "");
+ colno = ITEM_INDENT + n;
+ }
+ else if (colno + 2 + n < wrap)
+ {
+ printf ("%c ", sep);
+ colno += 2 + n;
+ }
+ else
+ {
+ printf ("\n%*s", ITEM_INDENT, "");
+ colno = ITEM_INDENT + n;
+ }
+
+ printf ("%s: %*s", name, (int) (name_width - len), "");
+
+ va_list ap;
+ va_start (ap, format);
+ vprintf (format, ap);
+ va_end (ap);
+
+ return colno;
+}
+
+static const void *
+convert (Elf *core, Elf_Type type, uint_fast16_t count,
+ void *value, const void *data)
+{
+ Elf_Data valuedata =
+ {
+ .d_type = type,
+ .d_buf = value,
+ .d_size = gelf_fsize (core, type, count, EV_CURRENT),
+ .d_version = EV_CURRENT,
+ };
+ Elf_Data indata =
+ {
+ .d_type = type,
+ .d_buf = (void *) data,
+ .d_size = valuedata.d_size,
+ .d_version = EV_CURRENT,
+ };
+
+ Elf_Data *d = (gelf_getclass (core) == ELFCLASS32
+ ? elf32_xlatetom : elf64_xlatetom)
+ (&valuedata, &indata, elf_getident (core, NULL)[EI_DATA]);
+ if (d == NULL)
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+
+ return data + indata.d_size;
+}
+
+typedef uint8_t GElf_Byte;
+
+static unsigned int
+handle_core_item (Elf *core, const Ebl_Core_Item *item, const void *desc,
+ unsigned int colno)
+{
+ uint_fast16_t count = item->count ?: 1;
+
+#define TYPES \
+ DO_TYPE (BYTE, Byte, "0x%.2" PRIx8, "%" PRId8, 4); \
+ DO_TYPE (HALF, Half, "0x%.4" PRIx16, "%" PRId16, 6); \
+ DO_TYPE (WORD, Word, "0x%.8" PRIx32, "%" PRId32, 11); \
+ DO_TYPE (SWORD, Sword, "%" PRId32, "%" PRId32, 11); \
+ DO_TYPE (XWORD, Xword, "0x%.16" PRIx64, "%" PRId64, 20); \
+ DO_TYPE (SXWORD, Sxword, "%" PRId64, "%" PRId64, 20)
+
+#define DO_TYPE(NAME, Name, hex, dec, max) GElf_##Name Name[count]
+ union { TYPES; } value;
+#undef DO_TYPE
+
+ desc = convert (core, item->type, count, &value, desc + item->offset);
+
+ switch (item->format)
+ {
+ case 'd':
+ assert (count == 1);
+ switch (item->type)
+ {
+#define DO_TYPE(NAME, Name, hex, dec, max) \
+ case ELF_T_##NAME: \
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, \
+ 0, item->name, max, dec, value.Name[0]); \
+ break
+ TYPES;
+#undef DO_TYPE
+ default:
+ abort ();
+ }
+ break;
+
+ case 'x':
+ assert (count == 1);
+ switch (item->type)
+ {
+#define DO_TYPE(NAME, Name, hex, dec, max) \
+ case ELF_T_##NAME: \
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, \
+ 0, item->name, max, hex, value.Name[0]); \
+ break
+ TYPES;
+#undef DO_TYPE
+ default:
+ abort ();
+ }
+ break;
+
+ case 'b':
+ assert (count == 1);
+ Dwarf_Word bits = 0;
+ Dwarf_Word bit = 0;
+ switch (item->type)
+ {
+#define DO_TYPE(NAME, Name, hex, dec, max) \
+ case ELF_T_##NAME: \
+ bits = value.Name[0]; \
+ bit = (Dwarf_Word) 1 << ((sizeof value.Name[0] * 8) - 1); \
+ break
+ TYPES;
+#undef DO_TYPE
+ default:
+ abort ();
+ }
+ char printed[sizeof (Dwarf_Word) * 8 + 1];
+ int i = 0;
+ while (bit != 0)
+ {
+ printed[i++] = (bits & bit) ? '1' : '0';
+ bit >>= 1;
+ }
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, 0, item->name,
+ sizeof printed - 1, "%.*s", i, printed);
+ break;
+
+ case 'T':
+ case (char) ('T'|0x80):
+ assert (count == 2);
+ Dwarf_Word sec;
+ Dwarf_Word usec;
+ size_t maxfmt = 7;
+ switch (item->type)
+ {
+#define DO_TYPE(NAME, Name, hex, dec, max) \
+ case ELF_T_##NAME: \
+ sec = value.Name[0]; \
+ usec = value.Name[1]; \
+ maxfmt += max; \
+ break
+ TYPES;
+#undef DO_TYPE
+ default:
+ abort ();
+ }
+ if (unlikely (item->format == (char) ('T'|0x80)))
+ {
+ /* This is a hack for an ill-considered 64-bit ABI where
+ tv_usec is actually a 32-bit field with 32 bits of padding
+ rounding out struct timeval. We've already converted it as
+ a 64-bit field. For little-endian, this just means the
+ high half is the padding; it's presumably zero, but should
+ be ignored anyway. For big-endian, it means the 32-bit
+ field went into the high half of USEC. */
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (core, &ehdr_mem);
+ if (likely (ehdr->e_ident[EI_DATA] == ELFDATA2MSB))
+ usec >>= 32;
+ else
+ usec &= UINT32_MAX;
+ }
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, 0, item->name,
+ maxfmt, "%" PRIu64 ".%.6" PRIu64, sec, usec);
+ break;
+
+ case 'c':
+ assert (count == 1);
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, 0, item->name,
+ 1, "%c", value.Byte[0]);
+ break;
+
+ case 's':
+ colno = print_core_item (colno, ',', ITEM_WRAP_COLUMN, 0, item->name,
+ count, "%.*s", (int) count, value.Byte);
+ break;
+
+ default:
+ error (0, 0, "XXX not handling format '%c' for %s",
+ item->format, item->name);
+ break;
+ }
+
+#undef TYPES
+
+ return colno;
+}
+
+
+/* Sort items by group, and by layout offset within each group. */
+static int
+compare_core_items (const void *a, const void *b)
+{
+ const Ebl_Core_Item *const *p1 = a;
+ const Ebl_Core_Item *const *p2 = b;
+ const Ebl_Core_Item *item1 = *p1;
+ const Ebl_Core_Item *item2 = *p2;
+
+ return ((item1->group == item2->group ? 0
+ : strcmp (item1->group, item2->group))
+ ?: (int) item1->offset - (int) item2->offset);
+}
+
+/* Sort item groups by layout offset of the first item in the group. */
+static int
+compare_core_item_groups (const void *a, const void *b)
+{
+ const Ebl_Core_Item *const *const *p1 = a;
+ const Ebl_Core_Item *const *const *p2 = b;
+ const Ebl_Core_Item *const *group1 = *p1;
+ const Ebl_Core_Item *const *group2 = *p2;
+ const Ebl_Core_Item *item1 = *group1;
+ const Ebl_Core_Item *item2 = *group2;
+
+ return (int) item1->offset - (int) item2->offset;
+}
+
+static unsigned int
+handle_core_items (Elf *core, const void *desc,
+ const Ebl_Core_Item *items, size_t nitems)
+{
+ if (nitems == 0)
+ return 0;
+
+ /* Sort to collect the groups together. */
+ const Ebl_Core_Item *sorted_items[nitems];
+ for (size_t i = 0; i < nitems; ++i)
+ sorted_items[i] = &items[i];
+ qsort (sorted_items, nitems, sizeof sorted_items[0], &compare_core_items);
+
+ /* Collect the unique groups and sort them. */
+ const Ebl_Core_Item **groups[nitems];
+ groups[0] = &sorted_items[0];
+ size_t ngroups = 1;
+ for (size_t i = 1; i < nitems; ++i)
+ if (sorted_items[i]->group != sorted_items[i - 1]->group
+ && strcmp (sorted_items[i]->group, sorted_items[i - 1]->group))
+ groups[ngroups++] = &sorted_items[i];
+ qsort (groups, ngroups, sizeof groups[0], &compare_core_item_groups);
+
+ /* Write out all the groups. */
+ unsigned int colno = 0;
+ for (size_t i = 0; i < ngroups; ++i)
+ {
+ for (const Ebl_Core_Item **item = groups[i];
+ (item < &sorted_items[nitems]
+ && ((*item)->group == groups[i][0]->group
+ || !strcmp ((*item)->group, groups[i][0]->group)));
+ ++item)
+ colno = handle_core_item (core, *item, desc, colno);
+
+ /* Force a line break at the end of the group. */
+ colno = ITEM_WRAP_COLUMN;
+ }
+
+ return colno;
+}
+
+static unsigned int
+handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc,
+ unsigned int colno)
+{
+ desc += regloc->offset;
+
+ abort (); /* XXX */
+ return colno;
+}
+
+
+static unsigned int
+handle_core_register (Ebl *ebl, Elf *core, int maxregname,
+ const Ebl_Register_Location *regloc, const void *desc,
+ unsigned int colno)
+{
+ if (regloc->bits % 8 != 0)
+ return handle_bit_registers (regloc, desc, colno);
+
+ desc += regloc->offset;
+
+ for (int reg = regloc->regno; reg < regloc->regno + regloc->count; ++reg)
+ {
+ const char *pfx;
+ const char *set;
+ char name[16];
+ int bits;
+ int type;
+ ssize_t n = ebl_register_info (ebl, reg, name, sizeof name,
+ &pfx, &set, &bits, &type);
+ if (n <= 0)
+ error (EXIT_FAILURE, 0,
+ gettext ("unable to handle register number %d"),
+ regloc->regno);
+
+#define TYPES \
+ BITS (8, BYTE, "%4" PRId8, "0x%.2" PRIx8, 4); \
+ BITS (16, HALF, "%6" PRId16, "0x%.4" PRIx16, 6); \
+ BITS (32, WORD, "%11" PRId32, " 0x%.8" PRIx32, 11); \
+ BITS (64, XWORD, "%20" PRId64, " 0x%.16" PRIx64, 20)
+
+#define BITS(bits, xtype, sfmt, ufmt, max) \
+ uint##bits##_t b##bits; int##bits##_t b##bits##s
+ union { TYPES; uint64_t b128[2]; } value;
+#undef BITS
+
+ switch (type)
+ {
+ case DW_ATE_unsigned:
+ case DW_ATE_signed:
+ case DW_ATE_address:
+ switch (bits)
+ {
+#define BITS(bits, xtype, sfmt, ufmt, max) \
+ case bits: \
+ desc = convert (core, ELF_T_##xtype, 1, &value, desc); \
+ if (type == DW_ATE_signed) \
+ colno = print_core_item (colno, ' ', REGISTER_WRAP_COLUMN, \
+ maxregname, name, \
+ max, sfmt, value.b##bits##s); \
+ else \
+ colno = print_core_item (colno, ' ', REGISTER_WRAP_COLUMN, \
+ maxregname, name, \
+ max, ufmt, value.b##bits); \
+ break
+
+ TYPES;
+
+ case 128:
+ assert (type == DW_ATE_unsigned);
+ desc = convert (core, ELF_T_XWORD, 2, &value, desc);
+ int be = elf_getident (core, NULL)[EI_DATA] == ELFDATA2MSB;
+ colno = print_core_item (colno, ' ', REGISTER_WRAP_COLUMN,
+ maxregname, name,
+ 34, "0x%.16" PRIx64 "%.16" PRIx64,
+ value.b128[!be], value.b128[be]);
+ break;
+
+ default:
+ abort ();
+#undef BITS
+ }
+ break;
+
+ default:
+ /* Print each byte in hex, the whole thing in native byte order. */
+ assert (bits % 8 == 0);
+ const uint8_t *bytes = desc;
+ desc += bits / 8;
+ char hex[bits / 4 + 1];
+ hex[bits / 4] = '\0';
+ int incr = 1;
+ if (elf_getident (core, NULL)[EI_DATA] == ELFDATA2LSB)
+ {
+ bytes += bits / 8 - 1;
+ incr = -1;
+ }
+ size_t idx = 0;
+ for (char *h = hex; bits > 0; bits -= 8, idx += incr)
+ {
+ *h++ = "0123456789abcdef"[bytes[idx] >> 4];
+ *h++ = "0123456789abcdef"[bytes[idx] & 0xf];
+ }
+ colno = print_core_item (colno, ' ', REGISTER_WRAP_COLUMN,
+ maxregname, name,
+ 2 + sizeof hex - 1, "0x%s", hex);
+ break;
+ }
+ desc += regloc->pad;
+
+#undef TYPES
+ }
+
+ return colno;
+}
+
+
+struct register_info
+{
+ const Ebl_Register_Location *regloc;
+ const char *set;
+ char name[16];
+ Dwarf_Half regno;
+ uint8_t bits;
+ uint8_t type;
+};
+
+static int
+register_bitpos (const struct register_info *r)
+{
+ return (r->regloc->offset * 8
+ + ((r->regno - r->regloc->regno)
+ * (r->regloc->bits + r->regloc->pad * 8)));
+}
+
+static int
+compare_sets_by_info (const struct register_info *r1,
+ const struct register_info *r2)
+{
+ return ((int) r2->bits - (int) r1->bits
+ ?: register_bitpos (r1) - register_bitpos (r2));
+}
+
+/* Sort registers by set, and by size and layout offset within each set. */
+static int
+compare_registers (const void *a, const void *b)
+{
+ const struct register_info *r1 = a;
+ const struct register_info *r2 = b;
+
+ /* Unused elements sort last. */
+ if (r1->regloc == NULL)
+ return r2->regloc == NULL ? 0 : 1;
+ if (r2->regloc == NULL)
+ return -1;
+
+ return ((r1->set == r2->set ? 0 : strcmp (r1->set, r2->set))
+ ?: compare_sets_by_info (r1, r2));
+}
- /* We are done with the DWARF handling. */
- dwarf_end (dbg);
+/* Sort register sets by layout offset of the first register in the set. */
+static int
+compare_register_sets (const void *a, const void *b)
+{
+ const struct register_info *const *p1 = a;
+ const struct register_info *const *p2 = b;
+ return compare_sets_by_info (*p1, *p2);
}
+static unsigned int
+handle_core_registers (Ebl *ebl, Elf *core, const void *desc,
+ const Ebl_Register_Location *reglocs, size_t nregloc)
+{
+ if (nregloc == 0)
+ return 0;
+
+ ssize_t maxnreg = ebl_register_info (ebl, 0, NULL, 0, NULL, NULL, NULL, NULL);
+ if (maxnreg <= 0)
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot register info: %s"), elf_errmsg (-1));
+
+ struct register_info regs[maxnreg];
+ memset (regs, 0, sizeof regs);
+
+ /* Sort to collect the sets together. */
+ int maxreg = 0;
+ for (size_t i = 0; i < nregloc; ++i)
+ for (int reg = reglocs[i].regno;
+ reg < reglocs[i].regno + reglocs[i].count;
+ ++reg)
+ {
+ assert (reg < maxnreg);
+ if (reg > maxreg)
+ maxreg = reg;
+ struct register_info *info = &regs[reg];
+
+ const char *pfx;
+ int bits;
+ int type;
+ ssize_t n = ebl_register_info (ebl, reg, info->name, sizeof info->name,
+ &pfx, &info->set, &bits, &type);
+ if (n <= 0)
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot register info: %s"), elf_errmsg (-1));
+
+ info->regloc = &reglocs[i];
+ info->regno = reg;
+ info->bits = bits;
+ info->type = type;
+ }
+ qsort (regs, maxreg + 1, sizeof regs[0], &compare_registers);
+
+ /* Collect the unique sets and sort them. */
+ inline bool same_set (const struct register_info *a,
+ const struct register_info *b)
+ {
+ return (a < &regs[maxnreg] && a->regloc != NULL
+ && b < &regs[maxnreg] && b->regloc != NULL
+ && a->bits == b->bits
+ && (a->set == b->set || !strcmp (a->set, b->set)));
+ }
+ struct register_info *sets[maxreg + 1];
+ sets[0] = &regs[0];
+ size_t nsets = 1;
+ for (int i = 1; i <= maxreg; ++i)
+ if (regs[i].regloc != NULL && !same_set (&regs[i], &regs[i - 1]))
+ sets[nsets++] = &regs[i];
+ qsort (sets, nsets, sizeof sets[0], &compare_register_sets);
+
+ /* Write out all the sets. */
+ unsigned int colno = 0;
+ for (size_t i = 0; i < nsets; ++i)
+ {
+ /* Find the longest name of a register in this set. */
+ size_t maxname = 0;
+ const struct register_info *end;
+ for (end = sets[i]; same_set (sets[i], end); ++end)
+ {
+ size_t len = strlen (end->name);
+ if (len > maxname)
+ maxname = len;
+ }
+
+ for (const struct register_info *reg = sets[i];
+ reg < end;
+ reg += reg->regloc->count ?: 1)
+ colno = handle_core_register (ebl, core, maxname,
+ reg->regloc, desc, colno);
+
+ /* Force a line break at the end of the group. */
+ colno = REGISTER_WRAP_COLUMN;
+ }
+
+ return colno;
+}
+
+static void
+handle_auxv_note (Ebl *ebl, Elf *core, GElf_Word descsz, GElf_Off desc_pos)
+{
+ Elf_Data *data = elf_getdata_rawchunk (core, desc_pos, descsz, ELF_T_AUXV);
+ if (data == NULL)
+ elf_error:
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+
+ const size_t nauxv = descsz / gelf_fsize (core, ELF_T_AUXV, 1, EV_CURRENT);
+ for (size_t i = 0; i < nauxv; ++i)
+ {
+ GElf_auxv_t av_mem;
+ GElf_auxv_t *av = gelf_getauxv (data, i, &av_mem);
+ if (av == NULL)
+ goto elf_error;
+
+ const char *name;
+ const char *fmt;
+ if (ebl_auxv_info (ebl, av->a_type, &name, &fmt) == 0)
+ {
+ /* Unknown type. */
+ if (av->a_un.a_val == 0)
+ printf (" %" PRIu64 "\n", av->a_type);
+ else
+ printf (" %" PRIu64 ": %#" PRIx64 "\n",
+ av->a_type, av->a_un.a_val);
+ }
+ else
+ switch (fmt[0])
+ {
+ case '\0': /* Normally zero. */
+ if (av->a_un.a_val == 0)
+ {
+ printf (" %s\n", name);
+ break;
+ }
+ /* Fall through */
+ case 'x': /* hex */
+ case 'p': /* address */
+ case 's': /* address of string */
+ printf (" %s: %#" PRIx64 "\n", name, av->a_un.a_val);
+ break;
+ case 'u':
+ printf (" %s: %" PRIu64 "\n", name, av->a_un.a_val);
+ break;
+ case 'd':
+ printf (" %s: %" PRId64 "\n", name, av->a_un.a_val);
+ break;
+
+ case 'b':
+ printf (" %s: %#" PRIx64 " ", name, av->a_un.a_val);
+ GElf_Xword bit = 1;
+ const char *pfx = "<";
+ for (const char *p = fmt + 1; *p != 0; p = strchr (p, '\0') + 1)
+ {
+ if (av->a_un.a_val & bit)
+ {
+ printf ("%s%s", pfx, p);
+ pfx = " ";
+ }
+ bit <<= 1;
+ }
+ printf (">\n");
+ break;
+
+ default:
+ abort ();
+ }
+ }
+}
+
+static void
+handle_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const void *desc)
+{
+ GElf_Word regs_offset;
+ size_t nregloc;
+ const Ebl_Register_Location *reglocs;
+ size_t nitems;
+ const Ebl_Core_Item *items;
+
+ if (! ebl_core_note (ebl, nhdr->n_type, nhdr->n_descsz,
+ &regs_offset, &nregloc, &reglocs, &nitems, &items))
+ return;
+
+ unsigned int colno = handle_core_items (ebl->elf, desc, items, nitems);
+ if (colno != 0)
+ putchar_unlocked ('\n');
+
+ colno = handle_core_registers (ebl, ebl->elf, desc + regs_offset,
+ reglocs, nregloc);
+ if (colno != 0)
+ putchar_unlocked ('\n');
+}
+
+static void
+handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
+ GElf_Off start, Elf_Data *data)
+{
+ fputs_unlocked (gettext (" Owner Data size Type\n"), stdout);
+
+ if (data == NULL)
+ goto bad_note;
+
+ size_t offset = 0;
+ GElf_Nhdr nhdr;
+ size_t name_offset;
+ size_t desc_offset;
+ while (offset < data->d_size
+ && (offset = gelf_getnote (data, offset,
+ &nhdr, &name_offset, &desc_offset)) > 0)
+ {
+ const char *name = data->d_buf + name_offset;
+ const char *desc = data->d_buf + desc_offset;
+
+ char buf[100];
+ char buf2[100];
+ printf (gettext (" %-13.*s %9" PRId32 " %s\n"),
+ (int) nhdr.n_namesz, name, nhdr.n_descsz,
+ ehdr->e_type == ET_CORE
+ ? ebl_core_note_type_name (ebl, nhdr.n_type,
+ buf, sizeof (buf))
+ : ebl_object_note_type_name (ebl, nhdr.n_type,
+ buf2, sizeof (buf2)));
+
+ /* Filter out invalid entries. */
+ if (memchr (name, '\0', nhdr.n_namesz) != NULL
+ /* XXX For now help broken Linux kernels. */
+ || 1)
+ {
+ if (ehdr->e_type == ET_CORE)
+ {
+ if (nhdr.n_type == NT_AUXV)
+ handle_auxv_note (ebl, ebl->elf, nhdr.n_descsz,
+ start + desc_offset);
+ else
+ handle_core_note (ebl, &nhdr, desc);
+ }
+ else
+ ebl_object_note (ebl, name, nhdr.n_type, nhdr.n_descsz, desc);
+ }
+ }
+
+ if (offset == data->d_size)
+ return;
+
+ bad_note:
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get content of note section: %s"),
+ elf_errmsg (-1));
+}
static void
handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
{
- int class = gelf_getclass (ebl->elf);
- size_t cnt;
+ /* If we have section headers, just look for SHT_NOTE sections.
+ In a debuginfo file, the program headers are not reliable. */
+ if (shnum != 0)
+ {
+ /* Get the section header string table index. */
+ size_t shstrndx;
+ if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+
+ if (shdr == NULL || shdr->sh_type != SHT_NOTE)
+ /* Not what we are looking for. */
+ continue;
+
+ printf (gettext ("\
+\nNote section [%2zu] '%s' of %" PRIu64 " bytes at offset %#0" PRIx64 ":\n"),
+ elf_ndxscn (scn),
+ elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
+ shdr->sh_size, shdr->sh_offset);
+
+ handle_notes_data (ebl, ehdr, shdr->sh_offset,
+ elf_getdata (scn, NULL));
+ }
+ return;
+ }
/* We have to look through the program header to find the note
sections. There can be more than one. */
- for (cnt = 0; cnt < ehdr->e_phnum; ++cnt)
+ for (size_t cnt = 0; cnt < ehdr->e_phnum; ++cnt)
{
GElf_Phdr mem;
GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem);
@@ -5015,84 +5924,252 @@ handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
continue;
printf (gettext ("\
-\nNote segment of %" PRId64 " bytes at offset %#0" PRIx64 ":\n"),
+\nNote segment of %" PRIu64 " bytes at offset %#0" PRIx64 ":\n"),
phdr->p_filesz, phdr->p_offset);
- char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz);
- if (notemem == NULL)
- error (EXIT_FAILURE, 0,
- gettext ("cannot get content of note section: %s"),
- elf_errmsg (-1));
+ handle_notes_data (ebl, ehdr, phdr->p_offset,
+ elf_getdata_rawchunk (ebl->elf,
+ phdr->p_offset, phdr->p_filesz,
+ ELF_T_NHDR));
+ }
+}
- fputs_unlocked (gettext (" Owner Data size Type\n"), stdout);
+static void
+hex_dump (const uint8_t *data, size_t len)
+{
+ size_t pos = 0;
+ while (pos < len)
+ {
+ printf (" 0x%08Zx ", pos);
- /* Handle the note section content. It consists of one or more
- entries each of which consists of five parts:
+ const size_t chunk = MIN (len - pos, 16);
- - a 32-bit name length
- - a 32-bit descriptor length
- - a 32-bit type field
- - the NUL-terminated name, length as specified in the first field
- - the descriptor, length as specified in the second field
+ for (size_t i = 0; i < chunk; ++i)
+ if (i % 4 == 3)
+ printf ("%02x ", data[pos + i]);
+ else
+ printf ("%02x", data[pos + i]);
- The variable sized fields are padded to 32- or 64-bits
- depending on whether the file is a 32- or 64-bit ELF file.
- */
- // XXX Which 64-bit archs need 8-byte alignment? x86-64 does not.
- size_t align = class == ELFCLASS32 ? 4 : 4; // XXX 8;
-#define ALIGNED_LEN(len) (((len) + align - 1) & ~(align - 1))
+ if (chunk < 16)
+ printf ("%*s", (int) ((16 - chunk) * 2 + (16 - chunk + 3) / 4), "");
- size_t idx = 0;
- while (idx < phdr->p_filesz)
+ for (size_t i = 0; i < chunk; ++i)
{
- /* XXX Handle 64-bit note section entries correctly. */
- struct
- {
- uint32_t namesz;
- uint32_t descsz;
- uint32_t type;
- char name[0];
- } *noteentry = (__typeof (noteentry)) (notemem + idx);
-
- if (idx + 12 > phdr->p_filesz
- || (idx + 12 + ALIGNED_LEN (noteentry->namesz)
- + ALIGNED_LEN (noteentry->descsz) > phdr->p_filesz))
- /* This entry isn't completely contained in the note
- section. Ignore it. */
- break;
+ unsigned char b = data[pos + i];
+ printf ("%c", isprint (b) ? b : '.');
+ }
+
+ putchar ('\n');
+ pos += chunk;
+ }
+}
+
+static void
+dump_data_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
+{
+ if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
+ printf (gettext ("\nSection [%Zu] '%s' has no data to dump.\n"),
+ elf_ndxscn (scn), name);
+ else
+ {
+ Elf_Data *data = elf_rawdata (scn, NULL);
+ if (data == NULL)
+ error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+ elf_ndxscn (scn), name, elf_errmsg (-1));
+ else
+ {
+ printf (gettext ("\nHex dump of section [%Zu] '%s', %" PRIu64
+ " bytes at offset %#0" PRIx64 ":\n"),
+ elf_ndxscn (scn), name,
+ shdr->sh_size, shdr->sh_offset);
+ hex_dump (data->d_buf, data->d_size);
+ }
+ }
+}
+
+static void
+print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
+{
+ if (shdr->sh_size == 0)
+ printf (gettext ("\nSection [%Zu] '%s' is empty.\n"),
+ elf_ndxscn (scn), name);
- char buf[100];
- char buf2[100];
- printf (gettext (" %-13.*s %9" PRId32 " %s\n"),
- (int) noteentry->namesz, noteentry->name,
- noteentry->descsz,
- ehdr->e_type == ET_CORE
- ? ebl_core_note_type_name (ebl, noteentry->type,
- buf, sizeof (buf))
- : ebl_object_note_type_name (ebl, noteentry->type,
- buf2, sizeof (buf2)));
-
- /* Filter out invalid entries. */
- if (memchr (noteentry->name, '\0', noteentry->namesz) != NULL
- /* XXX For now help broken Linux kernels. */
- || 1)
+ Elf_Data *data = elf_rawdata (scn, NULL);
+ if (data == NULL)
+ error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+ elf_ndxscn (scn), name, elf_errmsg (-1));
+ else
+ {
+ printf (gettext ("\nString section [%Zu] '%s' contains %" PRIu64
+ " bytes at offset %#0" PRIx64 ":\n"),
+ elf_ndxscn (scn), name,
+ shdr->sh_size, shdr->sh_offset);
+
+ const char *start = data->d_buf;
+ const char *const limit = start + data->d_size;
+ do
+ {
+ const char *end = memchr (start, '\0', limit - start);
+ const size_t pos = start - (const char *) data->d_buf;
+ if (unlikely (end == NULL))
{
- if (ehdr->e_type == ET_CORE)
- ebl_core_note (ebl, noteentry->name, noteentry->type,
- noteentry->descsz,
- &noteentry->name[ALIGNED_LEN (noteentry->namesz)]);
- else
- ebl_object_note (ebl, noteentry->name, noteentry->type,
- noteentry->descsz,
- &noteentry->name[ALIGNED_LEN (noteentry->namesz)]);
+ printf (" [%6Zx]- %.*s\n",
+ pos, (int) (limit - start), start);
+ break;
}
+ printf (" [%6Zx] %s\n", pos, start);
+ start = end + 1;
+ } while (start < limit);
+ }
+}
+
+static void
+for_each_section_argument (Elf *elf, const struct section_argument *list,
+ void (*dump) (Elf_Scn *scn, const GElf_Shdr *shdr,
+ const char *name))
+{
+ /* Get the section header string table index. */
+ size_t shstrndx;
+ if (elf_getshstrndx (elf, &shstrndx) < 0)
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
+ for (const struct section_argument *a = list; a != NULL; a = a->next)
+ {
+ Elf_Scn *scn;
+ GElf_Shdr shdr_mem;
+ const char *name;
+
+ char *endp = NULL;
+ unsigned long int shndx = strtoul (a->arg, &endp, 0);
+ if (endp != a->arg && *endp == '\0')
+ {
+ scn = elf_getscn (elf, shndx);
+ if (scn == NULL)
+ {
+ error (0, 0, gettext ("\nsection [%lu] does not exist"), shndx);
+ continue;
+ }
+
+ if (gelf_getshdr (scn, &shdr_mem) == NULL)
+ error (EXIT_FAILURE, 0, gettext ("cannot get section header: %s"),
+ elf_errmsg (-1));
+ name = elf_strptr (elf, shstrndx, shdr_mem.sh_name);
+ }
+ else
+ {
+ /* Need to look up the section by name. */
+ scn = NULL;
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
+ {
+ if (gelf_getshdr (scn, &shdr_mem) == NULL)
+ continue;
+ name = elf_strptr (elf, shstrndx, shdr_mem.sh_name);
+ if (name == NULL)
+ continue;
+ if (!strcmp (name, a->arg))
+ break;
+ }
+
+ if (scn == NULL)
+ {
+ error (0, 0, gettext ("\nsection '%s' does not exist"), a->arg);
+ continue;
+ }
+ }
+
+ (*dump) (scn, &shdr_mem, name);
+ }
+}
+
+static void
+dump_data (Ebl *ebl)
+{
+ for_each_section_argument (ebl->elf, dump_data_sections, &dump_data_section);
+}
+
+static void
+dump_strings (Ebl *ebl)
+{
+ for_each_section_argument (ebl->elf, string_sections, &print_string_section);
+}
+
+static void
+print_strings (Ebl *ebl)
+{
+ /* Get the section header string table index. */
+ size_t shstrndx;
+ if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
+ Elf_Scn *scn;
+ GElf_Shdr shdr_mem;
+ const char *name;
+ scn = NULL;
+ while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
+ {
+ if (gelf_getshdr (scn, &shdr_mem) == NULL)
+ continue;
+
+ if (shdr_mem.sh_type != SHT_PROGBITS
+ || !(shdr_mem.sh_flags & SHF_STRINGS))
+ continue;
+
+ name = elf_strptr (ebl->elf, shstrndx, shdr_mem.sh_name);
+ if (name == NULL)
+ continue;
+
+ print_string_section (scn, &shdr_mem, name);
+ }
+}
+
+static void
+dump_archive_index (Elf *elf, const char *fname)
+{
+ size_t narsym;
+ const Elf_Arsym *arsym = elf_getarsym (elf, &narsym);
+ if (arsym == NULL)
+ {
+ int result = elf_errno ();
+ if (unlikely (result != ELF_E_NO_INDEX))
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get symbol index of archive '%s': %s"),
+ fname, elf_errmsg (result));
+ else
+ printf (gettext ("\nArchive '%s' has no symbol index\n"), fname);
+ return;
+ }
+
+ printf (gettext ("\nIndex of archive '%s' has %Zu entries:\n"),
+ fname, narsym);
+
+ size_t as_off = 0;
+ for (const Elf_Arsym *s = arsym; s < &arsym[narsym - 1]; ++s)
+ {
+ if (s->as_off != as_off)
+ {
+ as_off = s->as_off;
+
+ Elf *subelf;
+ if (unlikely (elf_rand (elf, as_off) == 0)
+ || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
+ == NULL))
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
+ while (1)
+#endif
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot extract member at offset %Zu in '%s': %s"),
+ as_off, fname, elf_errmsg (-1));
+
+ const Elf_Arhdr *h = elf_getarhdr (subelf);
+
+ printf (gettext ("Archive member '%s' contains:\n"), h->ar_name);
- /* Move to the next entry. */
- idx += (12 + ALIGNED_LEN (noteentry->namesz)
- + ALIGNED_LEN (noteentry->descsz));
+ elf_end (subelf);
}
- gelf_freechunk (ebl->elf, notemem);
+ printf ("\t%s\n", s->as_name);
}
}
diff --git a/elfutils/src/size.c b/elfutils/src/size.c
index 57549e8f..da7b364c 100644
--- a/elfutils/src/size.c
+++ b/elfutils/src/size.c
@@ -115,7 +115,7 @@ static void show_bsd_totals (void);
#define INTERNAL_ERROR(fname) \
error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s-%s): %s"), \
- fname, __LINE__, VERSION, __DATE__, elf_errmsg (-1))
+ fname, __LINE__, PACKAGE_VERSION, __DATE__, elf_errmsg (-1))
/* User-selectable options. */
@@ -180,10 +180,10 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- bindtextdomain (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- textdomain (PACKAGE);
+ textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
@@ -215,7 +215,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "size (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "size (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/strings.c b/elfutils/src/strings.c
index 87e5d8ef..e5507354 100644
--- a/elfutils/src/strings.c
+++ b/elfutils/src/strings.c
@@ -149,10 +149,10 @@ main (int argc, char *argv[])
(void) setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- (void) textdomain (PACKAGE);
+ (void) textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
int remaining;
@@ -223,7 +223,7 @@ main (int argc, char *argv[])
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "strings (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "strings (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
diff --git a/elfutils/src/strip.c b/elfutils/src/strip.c
index 511321ff..e69e1a7f 100644
--- a/elfutils/src/strip.c
+++ b/elfutils/src/strip.c
@@ -70,7 +70,7 @@ const char *argp_program_bug_address = PACKAGE_BUGREPORT;
static const struct argp_option options[] =
{
{ NULL, 0, NULL, 0, N_("Output selection:"), 0 },
- { NULL, 'o', "FILE", 0, N_("Place stripped output into FILE"), 0 },
+ { "output", '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 },
@@ -118,7 +118,7 @@ static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
#define INTERNAL_ERROR(fname) \
error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s-%s): %s"), \
- fname, __LINE__, VERSION, __DATE__, elf_errmsg (-1))
+ fname, __LINE__, PACKAGE_VERSION, __DATE__, elf_errmsg (-1))
/* Name of the output file. */
@@ -161,10 +161,10 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
/* Make sure the message catalog can be found. */
- bindtextdomain (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
/* Initialize the message catalog. */
- textdomain (PACKAGE);
+ textdomain (PACKAGE_TARNAME);
/* Parse and process arguments. */
if (argp_parse (&argp, argc, argv, 0, &remaining, NULL) != 0)
@@ -199,7 +199,7 @@ Only one input file allowed together with '-o' and '-f'"));
static void
print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
{
- fprintf (stream, "strip (%s) %s\n", PACKAGE_NAME, VERSION);
+ fprintf (stream, "strip (%s) %s\n", PACKAGE_NAME, PACKAGE_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\
@@ -835,6 +835,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
elf_errmsg (-1));
bool discard_section = (shdr_info[cnt].idx > 0
+ && shdr_info[cnt].shdr.sh_type != SHT_NOTE
&& cnt != ehdr->e_shstrndx);
/* Set the section header in the new file. */
@@ -1251,6 +1252,24 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
symbol table. */
for (cnt = 1; cnt <= shdridx; ++cnt)
{
+ /* Update section headers when the data size has changed.
+ We also update the SHT_NOBITS section in the debug
+ file so that the section headers match in sh_size. */
+ inline void update_section_size (const Elf_Data *newdata)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ shdr->sh_size = newdata->d_size;
+ (void) gelf_update_shdr (scn, shdr);
+ if (debugelf != NULL)
+ {
+ /* libelf will use d_size to set sh_size. */
+ Elf_Data *debugdata = elf_getdata (elf_getscn (debugelf,
+ cnt), NULL);
+ debugdata->d_size = newdata->d_size;
+ }
+ }
+
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
@@ -1354,12 +1373,9 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
Elf32_Word *chain = bucket + nbucket;
/* New size of the section. */
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_size = hashd->d_size
- = (2 + symd->d_size / elsize + nbucket)
- * sizeof (Elf32_Word);
- (void) gelf_update_shdr (scn, shdr);
+ hashd->d_size = ((2 + symd->d_size / elsize + nbucket)
+ * sizeof (Elf32_Word));
+ update_section_size (hashd);
/* Clear the arrays. */
memset (bucket, '\0',
@@ -1411,12 +1427,9 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
Elf64_Xword *chain = bucket + nbucket;
/* New size of the section. */
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_size = hashd->d_size
- = (2 + symd->d_size / elsize + nbucket)
- * sizeof (Elf64_Xword);
- (void) gelf_update_shdr (scn, shdr);
+ hashd->d_size = ((2 + symd->d_size / elsize + nbucket)
+ * sizeof (Elf64_Xword));
+ update_section_size (hashd);
/* Clear the arrays. */
memset (bucket, '\0',
@@ -1492,14 +1505,12 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
verstab[newsymidx[inner]] = verstab[inner];
/* New size of the section. */
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- shdr->sh_size = verd->d_size
- = gelf_fsize (newelf, verd->d_type,
- symd->d_size / gelf_fsize (elf, symd->d_type, 1,
- ehdr->e_version),
- ehdr->e_version);
- (void) gelf_update_shdr (scn, shdr);
+ verd->d_size = gelf_fsize (newelf, verd->d_type,
+ symd->d_size
+ / gelf_fsize (elf, symd->d_type, 1,
+ ehdr->e_version),
+ ehdr->e_version);
+ update_section_size (verd);
}
else if (shdr_info[cnt].shdr.sh_type == SHT_GROUP)
{
diff --git a/elfutils/src/unstrip.c b/elfutils/src/unstrip.c
new file mode 100644
index 00000000..2670835a
--- /dev/null
+++ b/elfutils/src/unstrip.c
@@ -0,0 +1,2314 @@
+/* Combine stripped files with separate symbols and debug information.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Roland McGrath <roland@redhat.com>, 2007.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+/* TODO:
+
+ * SHX_XINDEX
+
+ * prelink vs .debug_* linked addresses
+
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <argp.h>
+#include <assert.h>
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <libintl.h>
+#include <locale.h>
+#include <mcheck.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <gelf.h>
+#include <libebl.h>
+#include <libdwfl.h>
+#include "system.h"
+
+#ifndef _
+# define _(str) gettext (str)
+#endif
+
+/* 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;
+
+/* Definitions of arguments for argp functions. */
+static const struct argp_option options[] =
+{
+ /* Group 2 will follow group 1 from dwfl_standard_argp. */
+ { "match-file-names", 'f', NULL, 0,
+ N_("Match MODULE against file names, not module names"), 2 },
+ { "ignore-missing", 'i', NULL, 0, N_("Silently skip unfindable files"), 0 },
+
+ { NULL, 0, NULL, 0, N_("Output options:"), 0 },
+ { "output", 'o', "FILE", 0, N_("Place output into FILE"), 0 },
+ { "output-directory", 'd', "DIRECTORY",
+ 0, N_("Create multiple output files under DIRECTORY"), 0 },
+ { "module-names", 'm', NULL, 0, N_("Use module rather than file names"), 0 },
+ { "all", 'a', NULL, 0,
+ N_("Create output for modules that have no separate debug information"),
+ 0 },
+ { "relocate", 'R', NULL, 0,
+ N_("Apply relocations to section contents in ET_REL files"), 0 },
+ { "list-only", 'n', NULL, 0,
+ N_("Only list module and file names, build IDs"), 0 },
+ { NULL, 0, NULL, 0, NULL, 0 }
+};
+
+struct arg_info
+{
+ const char *output_file;
+ const char *output_dir;
+ Dwfl *dwfl;
+ char **args;
+ bool list;
+ bool all;
+ bool ignore;
+ bool modnames;
+ bool match_files;
+ bool relocate;
+};
+
+/* Handle program arguments. */
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+ struct arg_info *info = state->input;
+
+ switch (key)
+ {
+ case ARGP_KEY_INIT:
+ state->child_inputs[0] = &info->dwfl;
+ break;
+
+ case 'o':
+ if (info->output_file != NULL)
+ {
+ argp_error (state, _("-o option specified twice"));
+ return EINVAL;
+ }
+ info->output_file = arg;
+ break;
+
+ case 'd':
+ if (info->output_dir != NULL)
+ {
+ argp_error (state, _("-d option specified twice"));
+ return EINVAL;
+ }
+ info->output_dir = arg;
+ break;
+
+ case 'm':
+ info->modnames = true;
+ break;
+ case 'f':
+ info->match_files = true;
+ break;
+ case 'a':
+ info->all = true;
+ break;
+ case 'i':
+ info->ignore = true;
+ break;
+ case 'n':
+ info->list = true;
+ break;
+ case 'R':
+ info->relocate = true;
+ break;
+
+ case ARGP_KEY_ARGS:
+ case ARGP_KEY_NO_ARGS:
+ /* We "consume" all the arguments here. */
+ info->args = &state->argv[state->next];
+
+ if (info->output_file != NULL && info->output_dir != NULL)
+ {
+ argp_error (state, _("only one of -o or -d allowed"));
+ return EINVAL;
+ }
+
+ if (info->list && (info->dwfl == NULL
+ || info->output_dir != NULL
+ || info->output_file != NULL))
+ {
+ argp_error (state,
+ _("-n cannot be used with explicit files or -o or -d"));
+ return EINVAL;
+ }
+
+ if (info->output_dir != NULL)
+ {
+ struct stat64 st;
+ error_t fail = 0;
+ if (stat64 (info->output_dir, &st) < 0)
+ fail = errno;
+ else if (!S_ISDIR (st.st_mode))
+ fail = ENOTDIR;
+ if (fail)
+ {
+ argp_failure (state, EXIT_FAILURE, fail,
+ _("output directory '%s'"), info->output_dir);
+ return fail;
+ }
+ }
+
+ if (info->dwfl == NULL)
+ {
+ if (state->next + 2 != state->argc)
+ {
+ argp_error (state, _("exactly two file arguments are required"));
+ return EINVAL;
+ }
+
+ if (info->ignore || info->all || info->modnames || info->relocate)
+ {
+ argp_error (state, _("\
+-m, -a, -R, and -i options not allowed with explicit files"));
+ return EINVAL;
+ }
+
+ /* Bail out immediately to prevent dwfl_standard_argp's parser
+ from defaulting to "-e a.out". */
+ return ENOSYS;
+ }
+ else if (info->output_file == NULL && info->output_dir == NULL
+ && !info->list)
+ {
+ argp_error (state,
+ _("-o or -d is required when using implicit files"));
+ return EINVAL;
+ }
+ break;
+
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+ return 0;
+}
+
+/* Print the version information. */
+static void
+print_version (FILE *stream, struct argp_state *state __attribute__ ((unused)))
+{
+ fprintf (stream, "unstrip (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+ fprintf (stream, _("\
+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\
+"), "2007");
+ fprintf (stream, gettext ("Written by %s.\n"), "Roland McGrath");
+}
+
+#define ELF_CHECK(call, msg) \
+ do \
+ { \
+ if (!(call)) \
+ error (EXIT_FAILURE, 0, msg, elf_errmsg (-1)); \
+ } while (0)
+
+/* Copy INELF to newly-created OUTELF, exit via error for any problems. */
+static void
+copy_elf (Elf *outelf, Elf *inelf)
+{
+ ELF_CHECK (gelf_newehdr (outelf, gelf_getclass (inelf)),
+ _("cannot create ELF header: %s"));
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (inelf, &ehdr_mem);
+ ELF_CHECK (gelf_update_ehdr (outelf, ehdr),
+ _("cannot copy ELF header: %s"));
+
+ if (ehdr->e_phnum > 0)
+ {
+ ELF_CHECK (gelf_newphdr (outelf, ehdr->e_phnum),
+ _("cannot create program headers: %s"));
+
+ GElf_Phdr phdr_mem;
+ for (uint_fast16_t i = 0; i < ehdr->e_phnum; ++i)
+ ELF_CHECK (gelf_update_phdr (outelf, i,
+ gelf_getphdr (inelf, i, &phdr_mem)),
+ _("cannot copy program header: %s"));
+ }
+
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (inelf, scn)) != NULL)
+ {
+ Elf_Scn *newscn = elf_newscn (outelf);
+
+ GElf_Shdr shdr_mem;
+ ELF_CHECK (gelf_update_shdr (newscn, gelf_getshdr (scn, &shdr_mem)),
+ _("cannot copy section header: %s"));
+
+ Elf_Data *data = elf_getdata (scn, NULL);
+ ELF_CHECK (data != NULL, _("cannot get section data: %s"));
+ Elf_Data *newdata = elf_newdata (newscn);
+ ELF_CHECK (newdata != NULL, _("cannot copy section data: %s"));
+ *newdata = *data;
+ elf_flagdata (newdata, ELF_C_SET, ELF_F_DIRTY);
+ }
+}
+
+/* Create directories containing PATH. */
+static void
+make_directories (const char *path)
+{
+ const char *lastslash = strrchr (path, '/');
+ if (lastslash == NULL)
+ return;
+
+ while (lastslash > path && lastslash[-1] == '/')
+ --lastslash;
+ if (lastslash == path)
+ return;
+
+ char *dir = strndupa (path, lastslash - path);
+ while (mkdir (dir, 0777) < 0 && errno != EEXIST)
+ if (errno == ENOENT)
+ make_directories (dir);
+ else
+ error (EXIT_FAILURE, errno, _("cannot create directory '%s'"), dir);
+}
+
+
+/* The binutils linker leaves gratuitous section symbols in .symtab
+ that strip has to remove. Older linkers likewise include a
+ symbol for every section, even unallocated ones, in .dynsym.
+ Because of this, the related sections can shrink in the stripped
+ file from their original size. Older versions of strip do not
+ adjust the sh_size field in the debuginfo file's SHT_NOBITS
+ version of the section header, so it can appear larger. */
+static bool
+section_can_shrink (const GElf_Shdr *shdr)
+{
+ switch (shdr->sh_type)
+ {
+ case SHT_SYMTAB:
+ case SHT_DYNSYM:
+ case SHT_HASH:
+ case SHT_GNU_versym:
+ return true;
+ }
+ return false;
+}
+
+/* See if this symbol table has a leading section symbol for every single
+ section, in order. The binutils linker produces this. While we're here,
+ update each section symbol's st_value. */
+static size_t
+symtab_count_leading_section_symbols (Elf *elf, Elf_Scn *scn, size_t shnum,
+ Elf_Data *newsymdata)
+{
+ Elf_Data *data = elf_getdata (scn, NULL);
+ Elf_Data *shndxdata = NULL; /* XXX */
+
+ for (size_t i = 1; i < shnum; ++i)
+ {
+ GElf_Sym sym_mem;
+ GElf_Word shndx = SHN_UNDEF;
+ GElf_Sym *sym = gelf_getsymshndx (data, shndxdata, i, &sym_mem, &shndx);
+ ELF_CHECK (sym != NULL, _("cannot get symbol table entry: %s"));
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (elf_getscn (elf, i), &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ if (sym->st_shndx != SHN_XINDEX)
+ shndx = sym->st_shndx;
+
+ if (shndx != i || GELF_ST_TYPE (sym->st_info) != STT_SECTION)
+ return i;
+
+ sym->st_value = shdr->sh_addr;
+ if (sym->st_shndx != SHN_XINDEX)
+ shndx = SHN_UNDEF;
+ ELF_CHECK (gelf_update_symshndx (newsymdata, shndxdata, i, sym, shndx),
+ _("cannot update symbol table: %s"));
+ }
+
+ return shnum;
+}
+
+/* We expanded the output section, so update its header. */
+static void
+update_sh_size (Elf_Scn *outscn, const Elf_Data *data)
+{
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *newshdr = gelf_getshdr (outscn, &shdr_mem);
+ ELF_CHECK (newshdr != NULL, _("cannot get section header: %s"));
+
+ newshdr->sh_size = data->d_size;
+
+ ELF_CHECK (gelf_update_shdr (outscn, newshdr),
+ _("cannot update section header: %s"));
+}
+
+/* Update relocation sections using the symbol table. */
+static void
+adjust_relocs (Elf_Scn *outscn, Elf_Scn *inscn, const GElf_Shdr *shdr,
+ size_t map[], const GElf_Shdr *symshdr)
+{
+ Elf_Data *data = elf_getdata (outscn, NULL);
+
+ inline void adjust_reloc (GElf_Xword *info)
+ {
+ size_t ndx = GELF_R_SYM (*info);
+ if (ndx != STN_UNDEF)
+ *info = GELF_R_INFO (map[ndx - 1], GELF_R_TYPE (*info));
+ }
+
+ switch (shdr->sh_type)
+ {
+ case SHT_REL:
+ for (size_t i = 0; i < shdr->sh_size / shdr->sh_entsize; ++i)
+ {
+ GElf_Rel rel_mem;
+ GElf_Rel *rel = gelf_getrel (data, i, &rel_mem);
+ adjust_reloc (&rel->r_info);
+ ELF_CHECK (gelf_update_rel (data, i, rel),
+ _("cannot update relocation: %s"));
+ }
+ break;
+
+ case SHT_RELA:
+ for (size_t i = 0; i < shdr->sh_size / shdr->sh_entsize; ++i)
+ {
+ GElf_Rela rela_mem;
+ GElf_Rela *rela = gelf_getrela (data, i, &rela_mem);
+ adjust_reloc (&rela->r_info);
+ ELF_CHECK (gelf_update_rela (data, i, rela),
+ _("cannot update relocation: %s"));
+ }
+ break;
+
+ case SHT_GROUP:
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *newshdr = gelf_getshdr (outscn, &shdr_mem);
+ ELF_CHECK (newshdr != NULL, _("cannot get section header: %s"));
+ if (newshdr->sh_info != STN_UNDEF)
+ {
+ newshdr->sh_info = map[newshdr->sh_info - 1];
+ ELF_CHECK (gelf_update_shdr (outscn, newshdr),
+ _("cannot update section header: %s"));
+ }
+ break;
+ }
+
+ case SHT_HASH:
+ /* We must expand the table and rejigger its contents. */
+ {
+ const size_t nsym = symshdr->sh_size / symshdr->sh_entsize;
+ const size_t onent = shdr->sh_size / shdr->sh_entsize;
+ assert (data->d_size == shdr->sh_size);
+
+#define CONVERT_HASH(Hash_Word) \
+ { \
+ const Hash_Word *const old_hash = data->d_buf; \
+ const size_t nbucket = old_hash[0]; \
+ const size_t nchain = old_hash[1]; \
+ const Hash_Word *const old_bucket = &old_hash[2]; \
+ const Hash_Word *const old_chain = &old_bucket[nbucket]; \
+ assert (onent == 2 + nbucket + nchain); \
+ \
+ const size_t nent = 2 + nbucket + nsym; \
+ Hash_Word *const new_hash = xcalloc (nent, sizeof new_hash[0]); \
+ Hash_Word *const new_bucket = &new_hash[2]; \
+ Hash_Word *const new_chain = &new_bucket[nbucket]; \
+ \
+ new_hash[0] = nbucket; \
+ new_hash[1] = nsym; \
+ for (size_t i = 0; i < nbucket; ++i) \
+ if (old_bucket[i] != STN_UNDEF) \
+ new_bucket[i] = map[old_bucket[i] - 1]; \
+ \
+ for (size_t i = 1; i < nchain; ++i) \
+ if (old_chain[i] != STN_UNDEF) \
+ new_chain[map[i - 1]] = map[old_chain[i] - 1]; \
+ \
+ data->d_buf = new_hash; \
+ data->d_size = nent * sizeof new_hash[0]; \
+ }
+
+ switch (shdr->sh_entsize)
+ {
+ case 4:
+ CONVERT_HASH (Elf32_Word);
+ break;
+ case 8:
+ CONVERT_HASH (Elf64_Xword);
+ break;
+ default:
+ abort ();
+ }
+
+ elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY);
+ update_sh_size (outscn, data);
+
+#undef CONVERT_HASH
+ }
+ break;
+
+ case SHT_GNU_versym:
+ /* We must expand the table and move its elements around. */
+ {
+ const size_t nent = symshdr->sh_size / symshdr->sh_entsize;
+ const size_t onent = shdr->sh_size / shdr->sh_entsize;
+ assert (nent >= onent);
+
+ /* We don't bother using gelf_update_versym because there is
+ really no conversion to be done. */
+ assert (sizeof (Elf32_Versym) == sizeof (GElf_Versym));
+ assert (sizeof (Elf64_Versym) == sizeof (GElf_Versym));
+ GElf_Versym *versym = xcalloc (nent, sizeof versym[0]);
+
+ for (size_t i = 1; i < onent; ++i)
+ {
+ GElf_Versym *v = gelf_getversym (data, i, &versym[map[i - 1]]);
+ ELF_CHECK (v != NULL, _("cannot get symbol version: %s"));
+ }
+
+ data->d_buf = versym;
+ data->d_size = nent * shdr->sh_entsize;
+ elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY);
+ update_sh_size (outscn, data);
+ }
+ break;
+
+ default:
+ error (EXIT_FAILURE, 0,
+ _("unexpected section type in [%Zu] with sh_link to symtab"),
+ elf_ndxscn (inscn));
+ }
+}
+
+/* Adjust all the relocation sections in the file. */
+static void
+adjust_all_relocs (Elf *elf, Elf_Scn *symtab, const GElf_Shdr *symshdr,
+ size_t map[])
+{
+ size_t new_sh_link = elf_ndxscn (symtab);
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
+ if (scn != symtab)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+ if (shdr->sh_type != SHT_NOBITS && shdr->sh_link == new_sh_link)
+ adjust_relocs (scn, scn, shdr, map, symshdr);
+ }
+}
+
+/* The original file probably had section symbols for all of its
+ sections, even the unallocated ones. To match it as closely as
+ possible, add in section symbols for the added sections. */
+static Elf_Data *
+add_new_section_symbols (Elf_Scn *old_symscn, size_t old_shnum,
+ Elf *elf, bool rel, Elf_Scn *symscn, size_t shnum)
+{
+ const size_t added = shnum - old_shnum;
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (symscn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ const size_t nsym = shdr->sh_size / shdr->sh_entsize;
+ size_t symndx_map[nsym - 1];
+
+ shdr->sh_info += added;
+ shdr->sh_size += added * shdr->sh_entsize;
+
+ ELF_CHECK (gelf_update_shdr (symscn, shdr),
+ _("cannot update section header: %s"));
+
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ Elf_Data *shndxdata = NULL; /* XXX */
+
+ symdata->d_size = shdr->sh_size;
+ symdata->d_buf = xmalloc (symdata->d_size);
+
+ /* Copy the existing section symbols. */
+ Elf_Data *old_symdata = elf_getdata (old_symscn, NULL);
+ for (size_t i = 0; i < old_shnum; ++i)
+ {
+ GElf_Sym sym_mem;
+ GElf_Word shndx = SHN_UNDEF;
+ GElf_Sym *sym = gelf_getsymshndx (old_symdata, shndxdata,
+ i, &sym_mem, &shndx);
+ ELF_CHECK (gelf_update_symshndx (symdata, shndxdata, i,
+ sym, shndx),
+ _("cannot update symbol table: %s"));
+
+ if (i > 0)
+ symndx_map[i - 1] = i;
+ }
+
+ /* Add in the new section symbols. */
+ for (size_t i = old_shnum; i < shnum; ++i)
+ {
+ GElf_Shdr i_shdr_mem;
+ GElf_Shdr *i_shdr = gelf_getshdr (elf_getscn (elf, i), &i_shdr_mem);
+ ELF_CHECK (i_shdr != NULL, _("cannot get section header: %s"));
+ GElf_Sym sym =
+ {
+ .st_value = rel ? 0 : i_shdr->sh_addr,
+ .st_info = GELF_ST_INFO (STB_LOCAL, STT_SECTION),
+ .st_shndx = i < SHN_LORESERVE ? i : SHN_XINDEX
+ };
+ GElf_Word shndx = i < SHN_LORESERVE ? SHN_UNDEF : i;
+ ELF_CHECK (gelf_update_symshndx (symdata, shndxdata, i,
+ &sym, shndx),
+ _("cannot update symbol table: %s"));
+ }
+
+ /* Now copy the rest of the existing symbols. */
+ for (size_t i = old_shnum; i < nsym; ++i)
+ {
+ GElf_Sym sym_mem;
+ GElf_Word shndx = SHN_UNDEF;
+ GElf_Sym *sym = gelf_getsymshndx (old_symdata, shndxdata,
+ i, &sym_mem, &shndx);
+ ELF_CHECK (gelf_update_symshndx (symdata, shndxdata,
+ i + added, sym, shndx),
+ _("cannot update symbol table: %s"));
+
+ symndx_map[i - 1] = i + added;
+ }
+
+ /* Adjust any relocations referring to the old symbol table. */
+ adjust_all_relocs (elf, symscn, shdr, symndx_map);
+
+ return symdata;
+}
+
+/* This has the side effect of updating STT_SECTION symbols' values,
+ in case of prelink adjustments. */
+static Elf_Data *
+check_symtab_section_symbols (Elf *elf, bool rel, Elf_Scn *scn,
+ size_t shnum, size_t shstrndx,
+ Elf_Scn *oscn, size_t oshnum, size_t oshstrndx,
+ size_t debuglink)
+{
+ size_t n = symtab_count_leading_section_symbols (elf, oscn, oshnum,
+ elf_getdata (scn, NULL));
+
+ if (n == oshnum)
+ return add_new_section_symbols (oscn, n, elf, rel, scn, shnum);
+
+ if (n == oshstrndx || (n == debuglink && n == oshstrndx - 1))
+ return add_new_section_symbols (oscn, n, elf, rel, scn, shstrndx);
+
+ return NULL;
+}
+
+struct section
+{
+ Elf_Scn *scn;
+ const char *name;
+ Elf_Scn *outscn;
+ struct Ebl_Strent *strent;
+ GElf_Shdr shdr;
+};
+
+static int
+compare_alloc_sections (const struct section *s1, const struct section *s2,
+ bool rel)
+{
+ if (!rel)
+ {
+ /* Sort by address. */
+ if (s1->shdr.sh_addr < s2->shdr.sh_addr)
+ return -1;
+ if (s1->shdr.sh_addr > s2->shdr.sh_addr)
+ return 1;
+ }
+
+ /* At the same address, preserve original section order. */
+ return (ssize_t) elf_ndxscn (s1->scn) - (ssize_t) elf_ndxscn (s2->scn);
+}
+
+static int
+compare_unalloc_sections (const GElf_Shdr *shdr1, const GElf_Shdr *shdr2,
+ const char *name1, const char *name2)
+{
+ /* Sort by sh_flags as an arbitrary ordering. */
+ if (shdr1->sh_flags < shdr2->sh_flags)
+ return -1;
+ if (shdr1->sh_flags > shdr2->sh_flags)
+ return 1;
+
+ /* Sort by name as last resort. */
+ return strcmp (name1, name2);
+}
+
+static int
+compare_sections (const void *a, const void *b, bool rel)
+{
+ const struct section *s1 = a;
+ const struct section *s2 = b;
+
+ /* Sort all non-allocated sections last. */
+ if ((s1->shdr.sh_flags ^ s2->shdr.sh_flags) & SHF_ALLOC)
+ return (s1->shdr.sh_flags & SHF_ALLOC) ? -1 : 1;
+
+ return ((s1->shdr.sh_flags & SHF_ALLOC)
+ ? compare_alloc_sections (s1, s2, rel)
+ : compare_unalloc_sections (&s1->shdr, &s2->shdr,
+ s1->name, s2->name));
+}
+
+static int
+compare_sections_rel (const void *a, const void *b)
+{
+ return compare_sections (a, b, true);
+}
+
+int
+compare_sections_nonrel (const void *a, const void *b)
+{
+ return compare_sections (a, b, false);
+}
+
+
+struct symbol
+{
+ size_t *map;
+
+ union
+ {
+ const char *name;
+ struct Ebl_Strent *strent;
+ };
+ union
+ {
+ struct
+ {
+ GElf_Addr value;
+ GElf_Xword size;
+ GElf_Word shndx;
+ union
+ {
+ struct
+ {
+ uint8_t info;
+ uint8_t other;
+ } info;
+ int16_t compare;
+ };
+ };
+
+ /* For a symbol discarded after first sort, this matches its better's
+ map pointer. */
+ size_t *duplicate;
+ };
+};
+
+/* Collect input symbols into our internal form. */
+static void
+collect_symbols (Elf *outelf, bool rel, Elf_Scn *symscn, Elf_Scn *strscn,
+ const size_t nent, const GElf_Addr bias,
+ const size_t scnmap[], struct symbol *table, size_t *map,
+ struct section *split_bss)
+{
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ Elf_Data *strdata = elf_getdata (strscn, NULL);
+ Elf_Data *shndxdata = NULL; /* XXX */
+
+ for (size_t i = 1; i < nent; ++i)
+ {
+ GElf_Sym sym_mem;
+ GElf_Word shndx = SHN_UNDEF;
+ GElf_Sym *sym = gelf_getsymshndx (symdata, shndxdata, i,
+ &sym_mem, &shndx);
+ ELF_CHECK (sym != NULL, _("cannot get symbol table entry: %s"));
+ if (sym->st_shndx != SHN_XINDEX)
+ shndx = sym->st_shndx;
+
+ if (sym->st_name >= strdata->d_size)
+ error (EXIT_FAILURE, 0,
+ _("invalid string offset in symbol [%Zu]"), i);
+
+ struct symbol *s = &table[i - 1];
+ s->map = &map[i - 1];
+ s->name = strdata->d_buf + sym->st_name;
+ s->value = sym->st_value + bias;
+ s->size = sym->st_size;
+ s->shndx = shndx;
+ s->info.info = sym->st_info;
+ s->info.other = sym->st_other;
+
+ if (scnmap != NULL && shndx != SHN_UNDEF && shndx < SHN_LORESERVE)
+ s->shndx = scnmap[shndx - 1];
+
+ if (GELF_ST_TYPE (s->info.info) == STT_SECTION && !rel)
+ {
+ /* Update the value to match the output section. */
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (elf_getscn (outelf, s->shndx),
+ &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+ s->value = shdr->sh_addr;
+ }
+ else if (split_bss != NULL
+ && s->value < split_bss->shdr.sh_addr
+ && s->value >= split_bss[-1].shdr.sh_addr
+ && shndx == elf_ndxscn (split_bss->outscn))
+ /* This symbol was in .bss and was split into .dynbss. */
+ s->shndx = elf_ndxscn (split_bss[-1].outscn);
+ }
+}
+
+
+#define CMP(value) \
+ if (s1->value < s2->value) \
+ return -1; \
+ if (s1->value > s2->value) \
+ return 1
+
+/* Compare symbols with a consistent ordering,
+ but one only meaningful for equality. */
+static int
+compare_symbols (const void *a, const void *b)
+{
+ const struct symbol *s1 = a;
+ const struct symbol *s2 = b;
+
+ CMP (value);
+ CMP (size);
+ CMP (shndx);
+
+ return (s1->compare - s2->compare) ?: strcmp (s1->name, s2->name);
+}
+
+/* Compare symbols for output order after slots have been assigned. */
+static int
+compare_symbols_output (const void *a, const void *b)
+{
+ const struct symbol *s1 = a;
+ const struct symbol *s2 = b;
+ int cmp;
+
+ /* Sort discarded symbols last. */
+ cmp = (s1->name == NULL) - (s2->name == NULL);
+
+ if (cmp == 0)
+ /* Local symbols must come first. */
+ cmp = ((GELF_ST_BIND (s2->info.info) == STB_LOCAL)
+ - (GELF_ST_BIND (s1->info.info) == STB_LOCAL));
+
+ if (cmp == 0)
+ /* binutils always puts section symbols first. */
+ cmp = ((GELF_ST_TYPE (s2->info.info) == STT_SECTION)
+ - (GELF_ST_TYPE (s1->info.info) == STT_SECTION));
+
+ if (cmp == 0)
+ {
+ if (GELF_ST_TYPE (s1->info.info) == STT_SECTION)
+ {
+ /* binutils always puts section symbols in section index order. */
+ CMP (shndx);
+ else
+ assert (s1 == s2);
+ }
+
+ /* Nothing really matters, so preserve the original order. */
+ CMP (map);
+ else
+ assert (s1 == s2);
+ }
+
+ return cmp;
+}
+
+#undef CMP
+
+/* Return true iff the flags, size, and name match. */
+static bool
+sections_match (const struct section *sections, size_t i,
+ const GElf_Shdr *shdr, const char *name)
+{
+ return (sections[i].shdr.sh_flags == shdr->sh_flags
+ && (sections[i].shdr.sh_size == shdr->sh_size
+ || (sections[i].shdr.sh_size < shdr->sh_size
+ && section_can_shrink (&sections[i].shdr)))
+ && !strcmp (sections[i].name, name));
+}
+
+/* Locate a matching allocated section in SECTIONS. */
+static struct section *
+find_alloc_section (const GElf_Shdr *shdr, GElf_Addr bias, const char *name,
+ struct section sections[], size_t nalloc)
+{
+ const GElf_Addr addr = shdr->sh_addr + bias;
+ size_t l = 0, u = nalloc;
+ while (l < u)
+ {
+ size_t i = (l + u) / 2;
+ if (addr < sections[i].shdr.sh_addr)
+ u = i;
+ else if (addr > sections[i].shdr.sh_addr)
+ l = i + 1;
+ else
+ {
+ /* We've found allocated sections with this address.
+ Find one with matching size, flags, and name. */
+ while (i > 0 && sections[i - 1].shdr.sh_addr == addr)
+ --i;
+ for (; i < nalloc && sections[i].shdr.sh_addr == addr;
+ ++i)
+ if (sections_match (sections, i, shdr, name))
+ return &sections[i];
+ break;
+ }
+ }
+ return NULL;
+}
+
+static inline const char *
+get_section_name (size_t ndx, const GElf_Shdr *shdr, const Elf_Data *shstrtab)
+{
+ if (shdr->sh_name >= shstrtab->d_size)
+ error (EXIT_FAILURE, 0, _("cannot read section [%Zu] name: %s"),
+ ndx, elf_errmsg (-1));
+ return shstrtab->d_buf + shdr->sh_name;
+}
+
+/* Fix things up when prelink has moved some allocated sections around
+ and the debuginfo file's section headers no longer match up.
+ This fills in SECTIONS[0..NALLOC-1].outscn or exits.
+ If there was a .bss section that was split into two sections
+ with the new one preceding it in sh_addr, we return that pointer. */
+static struct section *
+find_alloc_sections_prelink (Elf *debug, Elf_Data *debug_shstrtab,
+ Elf *main, const GElf_Ehdr *main_ehdr,
+ Elf_Data *main_shstrtab, GElf_Addr bias,
+ struct section *sections,
+ size_t nalloc, size_t nsections)
+{
+ /* Clear assignments that might have been bogus. */
+ for (size_t i = 0; i < nalloc; ++i)
+ sections[i].outscn = NULL;
+
+ Elf_Scn *undo = NULL;
+ for (size_t i = nalloc; i < nsections; ++i)
+ {
+ const struct section *sec = &sections[i];
+ if (sec->shdr.sh_type == SHT_PROGBITS
+ && !(sec->shdr.sh_flags & SHF_ALLOC)
+ && !strcmp (sec->name, ".gnu.prelink_undo"))
+ {
+ undo = sec->scn;
+ break;
+ }
+ }
+
+ /* Find the original allocated sections before prelinking. */
+ struct section *undo_sections = NULL;
+ size_t undo_nalloc = 0;
+ if (undo != NULL)
+ {
+ Elf_Data *undodata = elf_rawdata (undo, NULL);
+ ELF_CHECK (undodata != NULL,
+ _("cannot read '.gnu.prelink_undo' section: %s"));
+
+ union
+ {
+ Elf32_Ehdr e32;
+ Elf64_Ehdr e64;
+ } ehdr;
+ Elf_Data dst =
+ {
+ .d_buf = &ehdr,
+ .d_size = sizeof ehdr,
+ .d_type = ELF_T_EHDR,
+ .d_version = EV_CURRENT
+ };
+ Elf_Data src = *undodata;
+ src.d_size = gelf_fsize (main, ELF_T_EHDR, 1, EV_CURRENT);
+ src.d_type = ELF_T_EHDR;
+ ELF_CHECK (gelf_xlatetom (main, &dst, &src,
+ main_ehdr->e_ident[EI_DATA]) != NULL,
+ _("cannot read '.gnu.prelink_undo' section: %s"));
+
+ uint_fast16_t phnum;
+ uint_fast16_t shnum;
+ if (ehdr.e32.e_ident[EI_CLASS] == ELFCLASS32)
+ {
+ phnum = ehdr.e32.e_phnum;
+ shnum = ehdr.e32.e_shnum;
+ }
+ else
+ {
+ phnum = ehdr.e64.e_phnum;
+ shnum = ehdr.e64.e_shnum;
+ }
+
+ size_t phsize = gelf_fsize (main, ELF_T_PHDR, phnum, EV_CURRENT);
+ src.d_buf += src.d_size + phsize;
+ src.d_size = gelf_fsize (main, ELF_T_SHDR, shnum - 1, EV_CURRENT);
+ src.d_type = ELF_T_SHDR;
+ if ((size_t) (src.d_buf - undodata->d_buf) > undodata->d_size
+ || undodata->d_size - (src.d_buf - undodata->d_buf) != src.d_size)
+ error (EXIT_FAILURE, 0, _("invalid contents in '%s' section"),
+ ".gnu.prelink_undo");
+
+ union
+ {
+ Elf32_Shdr s32[shnum - 1];
+ Elf64_Shdr s64[shnum - 1];
+ } shdr;
+ dst.d_buf = &shdr;
+ dst.d_size = sizeof shdr;
+ ELF_CHECK (gelf_xlatetom (main, &dst, &src,
+ main_ehdr->e_ident[EI_DATA]) != NULL,
+ _("cannot read '.gnu.prelink_undo' section: %s"));
+
+ undo_sections = xmalloc ((shnum - 1) * sizeof undo_sections[0]);
+ for (size_t i = 0; i < shnum - 1; ++i)
+ {
+ struct section *sec = &undo_sections[undo_nalloc];
+ if (ehdr.e32.e_ident[EI_CLASS] == ELFCLASS32)
+ {
+#define COPY(field) sec->shdr.field = shdr.s32[i].field
+ COPY (sh_name);
+ COPY (sh_type);
+ COPY (sh_flags);
+ COPY (sh_addr);
+ COPY (sh_offset);
+ COPY (sh_size);
+ COPY (sh_link);
+ COPY (sh_info);
+ COPY (sh_addralign);
+ COPY (sh_entsize);
+#undef COPY
+ }
+ else
+ sec->shdr = shdr.s64[i];
+ if (sec->shdr.sh_flags & SHF_ALLOC)
+ {
+ sec->shdr.sh_addr += bias;
+ sec->name = get_section_name (i + 1, &sec->shdr, main_shstrtab);
+ sec->scn = elf_getscn (main, i + 1); /* Really just for ndx. */
+ sec->outscn = NULL;
+ sec->strent = NULL;
+ ++undo_nalloc;
+ }
+ }
+ qsort (undo_sections, undo_nalloc,
+ sizeof undo_sections[0], compare_sections_nonrel);
+ }
+
+ bool fail = false;
+ inline void check_match (bool match, Elf_Scn *scn, const char *name)
+ {
+ if (!match)
+ {
+ fail = true;
+ error (0, 0, _("cannot find matching section for [%Zu] '%s'"),
+ elf_ndxscn (scn), name);
+ }
+ }
+
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (debug, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ if (!(shdr->sh_flags & SHF_ALLOC))
+ continue;
+
+ const char *name = get_section_name (elf_ndxscn (scn), shdr,
+ debug_shstrtab);
+
+ if (undo_sections != NULL)
+ {
+ struct section *sec = find_alloc_section (shdr, 0, name,
+ undo_sections,
+ undo_nalloc);
+ if (sec != NULL)
+ {
+ sec->outscn = scn;
+ continue;
+ }
+ }
+
+ /* If there is no prelink info, we are just here to find
+ the sections to give error messages about. */
+ for (size_t i = 0; shdr != NULL && i < nalloc; ++i)
+ if (sections[i].outscn == scn)
+ shdr = NULL;
+ check_match (shdr == NULL, scn, name);
+ }
+
+ if (fail)
+ exit (EXIT_FAILURE);
+
+ /* Now we have lined up output sections for each of the original sections
+ before prelinking. Translate those to the prelinked sections.
+ This matches what prelink's undo_sections does. */
+ struct section *split_bss = NULL;
+ for (size_t i = 0; i < undo_nalloc; ++i)
+ {
+ const struct section *undo_sec = &undo_sections[i];
+
+ const char *name = undo_sec->name;
+ scn = undo_sec->scn; /* This is just for elf_ndxscn. */
+
+ for (size_t j = 0; j < nalloc; ++j)
+ {
+ struct section *sec = &sections[j];
+#define RELA_SCALED(field) \
+ (2 * sec->shdr.field == 3 * undo_sec->shdr.field)
+ if (sec->outscn == NULL
+ && sec->shdr.sh_name == undo_sec->shdr.sh_name
+ && sec->shdr.sh_flags == undo_sec->shdr.sh_flags
+ && sec->shdr.sh_addralign == undo_sec->shdr.sh_addralign
+ && (((sec->shdr.sh_type == undo_sec->shdr.sh_type
+ && sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize
+ && (sec->shdr.sh_size == undo_sec->shdr.sh_size
+ || (sec->shdr.sh_size > undo_sec->shdr.sh_size
+ && main_ehdr->e_type == ET_EXEC
+ && !strcmp (sec->name, ".dynstr"))))
+ || (sec->shdr.sh_size == undo_sec->shdr.sh_size
+ && ((sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize
+ && undo_sec->shdr.sh_type == SHT_NOBITS)
+ || undo_sec->shdr.sh_type == SHT_PROGBITS)
+ && !strcmp (sec->name, ".plt")))
+ || (sec->shdr.sh_type == SHT_RELA
+ && undo_sec->shdr.sh_type == SHT_REL
+ && RELA_SCALED (sh_entsize) && RELA_SCALED (sh_size))
+ || (sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize
+ && (sec->shdr.sh_type == undo_sec->shdr.sh_type
+ || (sec->shdr.sh_type == SHT_PROGBITS
+ && undo_sec->shdr.sh_type == SHT_NOBITS))
+ && sec->shdr.sh_size < undo_sec->shdr.sh_size
+ && (!strcmp (sec->name, ".bss")
+ || !strcmp (sec->name, ".sbss"))
+ && (split_bss = sec) > sections)))
+ {
+ sec->outscn = undo_sec->outscn;
+ undo_sec = NULL;
+ break;
+ }
+ }
+
+ check_match (undo_sec == NULL, scn, name);
+ }
+
+ free (undo_sections);
+
+ if (fail)
+ exit (EXIT_FAILURE);
+
+ return split_bss;
+}
+
+/* Create new .shstrtab contents, subroutine of copy_elided_sections.
+ This can't be open coded there and still use variable-length auto arrays,
+ since the end of our block would free other VLAs too. */
+static Elf_Data *
+new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
+ Elf_Data *shstrtab, size_t unstripped_shstrndx,
+ struct section *sections, size_t stripped_shnum,
+ struct Ebl_Strtab *strtab)
+{
+ if (strtab == NULL)
+ return NULL;
+
+ struct Ebl_Strent *unstripped_strent[unstripped_shnum - 1];
+ memset (unstripped_strent, 0, sizeof unstripped_strent);
+ for (struct section *sec = sections;
+ sec < &sections[stripped_shnum - 1];
+ ++sec)
+ if (sec->outscn != NULL)
+ {
+ if (sec->strent == NULL)
+ {
+ sec->strent = ebl_strtabadd (strtab, sec->name, 0);
+ ELF_CHECK (sec->strent != NULL,
+ _("cannot add section name to string table: %s"));
+ }
+ unstripped_strent[elf_ndxscn (sec->outscn) - 1] = sec->strent;
+ }
+
+ /* Add names of sections we aren't touching. */
+ for (size_t i = 0; i < unstripped_shnum - 1; ++i)
+ if (unstripped_strent[i] == NULL)
+ {
+ Elf_Scn *scn = elf_getscn (unstripped, i + 1);
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ const char *name = get_section_name (i + 1, shdr, shstrtab);
+ unstripped_strent[i] = ebl_strtabadd (strtab, name, 0);
+ ELF_CHECK (unstripped_strent[i] != NULL,
+ _("cannot add section name to string table: %s"));
+ }
+ else
+ unstripped_strent[i] = NULL;
+
+ /* Now finalize the string table so we can get offsets. */
+ Elf_Data *strtab_data = elf_getdata (elf_getscn (unstripped,
+ unstripped_shstrndx), NULL);
+ ELF_CHECK (elf_flagdata (strtab_data, ELF_C_SET, ELF_F_DIRTY),
+ _("cannot update section header string table data: %s"));
+ ebl_strtabfinalize (strtab, strtab_data);
+
+ /* Update the sh_name fields of sections we aren't modifying later. */
+ for (size_t i = 0; i < unstripped_shnum - 1; ++i)
+ if (unstripped_strent[i] != NULL)
+ {
+ Elf_Scn *scn = elf_getscn (unstripped, i + 1);
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ shdr->sh_name = ebl_strtaboffset (unstripped_strent[i]);
+ if (i + 1 == unstripped_shstrndx)
+ shdr->sh_size = strtab_data->d_size;
+ ELF_CHECK (gelf_update_shdr (scn, shdr),
+ _("cannot update section header: %s"));
+ }
+
+ return strtab_data;
+}
+
+/* Fill in any SHT_NOBITS sections in UNSTRIPPED by
+ copying their contents and sh_type from STRIPPED. */
+static void
+copy_elided_sections (Elf *unstripped, Elf *stripped,
+ const GElf_Ehdr *stripped_ehdr, GElf_Addr bias)
+{
+ size_t unstripped_shstrndx;
+ ELF_CHECK (elf_getshstrndx (unstripped, &unstripped_shstrndx) == 0,
+ _("cannot get section header string table section index: %s"));
+
+ size_t stripped_shstrndx;
+ ELF_CHECK (elf_getshstrndx (stripped, &stripped_shstrndx) == 0,
+ _("cannot get section header string table section index: %s"));
+
+ size_t unstripped_shnum;
+ ELF_CHECK (elf_getshnum (unstripped, &unstripped_shnum) == 0,
+ _("cannot get section count: %s"));
+
+ size_t stripped_shnum;
+ ELF_CHECK (elf_getshnum (stripped, &stripped_shnum) == 0,
+ _("cannot get section count: %s"));
+
+ /* Cache the stripped file's section details. */
+ struct section sections[stripped_shnum - 1];
+ Elf_Scn *scn = NULL;
+ while ((scn = elf_nextscn (stripped, scn)) != NULL)
+ {
+ size_t i = elf_ndxscn (scn) - 1;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &sections[i].shdr);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+ sections[i].name = elf_strptr (stripped, stripped_shstrndx,
+ shdr->sh_name);
+ if (sections[i].name == NULL)
+ error (EXIT_FAILURE, 0, _("cannot read section [%Zu] name: %s"),
+ elf_ndxscn (scn), elf_errmsg (-1));
+ sections[i].scn = scn;
+ sections[i].outscn = NULL;
+ sections[i].strent = NULL;
+ }
+
+ const struct section *stripped_symtab = NULL;
+
+ /* Sort the sections, allocated by address and others after. */
+ qsort (sections, stripped_shnum - 1, sizeof sections[0],
+ stripped_ehdr->e_type == ET_REL
+ ? compare_sections_rel : compare_sections_nonrel);
+ size_t nalloc = stripped_shnum - 1;
+ while (nalloc > 0 && !(sections[nalloc - 1].shdr.sh_flags & SHF_ALLOC))
+ {
+ --nalloc;
+ if (sections[nalloc].shdr.sh_type == SHT_SYMTAB)
+ stripped_symtab = &sections[nalloc];
+ }
+
+ /* Locate a matching unallocated section in SECTIONS. */
+ inline struct section *find_unalloc_section (const GElf_Shdr *shdr,
+ const char *name)
+ {
+ size_t l = nalloc, u = stripped_shnum - 1;
+ while (l < u)
+ {
+ size_t i = (l + u) / 2;
+ struct section *sec = &sections[i];
+ int cmp = compare_unalloc_sections (shdr, &sec->shdr,
+ name, sec->name);
+ if (cmp < 0)
+ u = i;
+ else if (cmp > 0)
+ l = i + 1;
+ else
+ return sec;
+ }
+ return NULL;
+ }
+
+ Elf_Data *shstrtab = elf_getdata (elf_getscn (unstripped,
+ unstripped_shstrndx), NULL);
+ ELF_CHECK (shstrtab != NULL,
+ _("cannot read section header string table: %s"));
+
+ /* Match each debuginfo section with its corresponding stripped section. */
+ bool check_prelink = false;
+ Elf_Scn *unstripped_symtab = NULL;
+ size_t unstripped_strtab_ndx = SHN_UNDEF;
+ size_t alloc_avail = 0;
+ scn = NULL;
+ while ((scn = elf_nextscn (unstripped, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ if (shdr->sh_type == SHT_SYMTAB)
+ {
+ unstripped_symtab = scn;
+ unstripped_strtab_ndx = shdr->sh_link;
+ continue;
+ }
+
+ const size_t ndx = elf_ndxscn (scn);
+ if (ndx == unstripped_shstrndx)
+ continue;
+
+ const char *name = get_section_name (ndx, shdr, shstrtab);
+
+ struct section *sec = NULL;
+ if (shdr->sh_flags & SHF_ALLOC)
+ {
+ if (stripped_ehdr->e_type != ET_REL)
+ {
+ /* Look for the section that matches. */
+ sec = find_alloc_section (shdr, bias, name, sections, nalloc);
+ if (sec == NULL)
+ {
+ /* We couldn't figure it out. It may be a prelink issue. */
+ check_prelink = true;
+ continue;
+ }
+ }
+ else
+ {
+ /* The sh_addr of allocated sections does not help us,
+ but the order usually matches. */
+ if (likely (sections_match (sections, alloc_avail, shdr, name)))
+ sec = &sections[alloc_avail++];
+ else
+ for (size_t i = alloc_avail + 1; i < nalloc; ++i)
+ if (sections_match (sections, i, shdr, name))
+ {
+ sec = &sections[i];
+ break;
+ }
+ }
+ }
+ else
+ {
+ /* Look for the section that matches. */
+ sec = find_unalloc_section (shdr, name);
+ if (sec == NULL)
+ {
+ /* An additional unallocated section is fine if not SHT_NOBITS.
+ We looked it up anyway in case it's an unallocated section
+ copied in both files (e.g. SHT_NOTE), and don't keep both. */
+ if (shdr->sh_type != SHT_NOBITS)
+ continue;
+
+ /* Somehow some old .debug files wound up with SHT_NOBITS
+ .comment sections, so let those pass. */
+ if (!strcmp (name, ".comment"))
+ continue;
+ }
+ }
+
+ if (sec == NULL)
+ error (EXIT_FAILURE, 0,
+ _("cannot find matching section for [%Zu] '%s'"),
+ elf_ndxscn (scn), name);
+
+ sec->outscn = scn;
+ }
+
+ /* If that failed due to changes made by prelink, we take another tack.
+ We keep track of a .bss section that was partly split into .dynbss
+ so that collect_symbols can update symbols' st_shndx fields. */
+ struct section *split_bss = NULL;
+ if (check_prelink)
+ {
+ Elf_Data *data = elf_getdata (elf_getscn (stripped, stripped_shstrndx),
+ NULL);
+ ELF_CHECK (data != NULL,
+ _("cannot read section header string table: %s"));
+ split_bss = find_alloc_sections_prelink (unstripped, shstrtab,
+ stripped, stripped_ehdr,
+ data, bias, sections,
+ nalloc, stripped_shnum - 1);
+ }
+
+ /* Make sure each main file section has a place to go. */
+ const struct section *stripped_dynsym = NULL;
+ size_t debuglink = SHN_UNDEF;
+ size_t ndx_section[stripped_shnum - 1];
+ struct Ebl_Strtab *strtab = NULL;
+ for (struct section *sec = sections;
+ sec < &sections[stripped_shnum - 1];
+ ++sec)
+ {
+ size_t secndx = elf_ndxscn (sec->scn);
+
+ if (sec->outscn == NULL)
+ {
+ /* We didn't find any corresponding section for this. */
+
+ if (secndx == stripped_shstrndx)
+ {
+ /* We only need one .shstrtab. */
+ ndx_section[secndx - 1] = unstripped_shstrndx;
+ continue;
+ }
+
+ if (unstripped_symtab != NULL && sec == stripped_symtab)
+ {
+ /* We don't need a second symbol table. */
+ ndx_section[secndx - 1] = elf_ndxscn (unstripped_symtab);
+ continue;
+ }
+
+ if (unstripped_symtab != NULL && stripped_symtab != NULL
+ && secndx == stripped_symtab->shdr.sh_link)
+ {
+ /* ... nor its string table. */
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (unstripped_symtab, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+ ndx_section[secndx - 1] = shdr->sh_link;
+ continue;
+ }
+
+ if (!(sec->shdr.sh_flags & SHF_ALLOC)
+ && !strcmp (sec->name, ".gnu_debuglink"))
+ {
+ /* This was created by stripping. We don't want it. */
+ debuglink = secndx;
+ ndx_section[secndx - 1] = SHN_UNDEF;
+ continue;
+ }
+
+ sec->outscn = elf_newscn (unstripped);
+ Elf_Data *newdata = elf_newdata (sec->outscn);
+ ELF_CHECK (newdata != NULL && gelf_update_shdr (sec->outscn,
+ &sec->shdr),
+ _("cannot add new section: %s"));
+
+ if (strtab == NULL)
+ strtab = ebl_strtabinit (true);
+ sec->strent = ebl_strtabadd (strtab, sec->name, 0);
+ ELF_CHECK (sec->strent != NULL,
+ _("cannot add section name to string table: %s"));
+ }
+
+ /* Cache the mapping of original section indices to output sections. */
+ ndx_section[secndx - 1] = elf_ndxscn (sec->outscn);
+ }
+
+ /* We added some sections, so we need a new shstrtab. */
+ Elf_Data *strtab_data = new_shstrtab (unstripped, unstripped_shnum,
+ shstrtab, unstripped_shstrndx,
+ sections, stripped_shnum,
+ strtab);
+
+ /* Get the updated section count. */
+ ELF_CHECK (elf_getshnum (unstripped, &unstripped_shnum) == 0,
+ _("cannot get section count: %s"));
+
+ bool placed[unstripped_shnum - 1];
+ memset (placed, 0, sizeof placed);
+
+ /* Now update the output sections and copy in their data. */
+ GElf_Off offset = 0;
+ for (const struct section *sec = sections;
+ sec < &sections[stripped_shnum - 1];
+ ++sec)
+ if (sec->outscn != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (sec->outscn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ /* In an ET_REL file under --relocate, the sh_addr of SHF_ALLOC
+ sections will have been set nonzero by relocation. This
+ touched the shdrs of whichever file had the symtab. sh_addr
+ is still zero in the corresponding shdr. The relocated
+ address is what we want to use. */
+ if (stripped_ehdr->e_type != ET_REL
+ || !(shdr_mem.sh_flags & SHF_ALLOC)
+ || shdr_mem.sh_addr == 0)
+ shdr_mem.sh_addr = sec->shdr.sh_addr;
+
+ shdr_mem.sh_type = sec->shdr.sh_type;
+ shdr_mem.sh_size = sec->shdr.sh_size;
+ shdr_mem.sh_info = sec->shdr.sh_info;
+ shdr_mem.sh_link = sec->shdr.sh_link;
+ if (sec->shdr.sh_link != SHN_UNDEF)
+ shdr_mem.sh_link = ndx_section[sec->shdr.sh_link - 1];
+ if (shdr_mem.sh_flags & SHF_INFO_LINK)
+ shdr_mem.sh_info = ndx_section[sec->shdr.sh_info - 1];
+
+ if (strtab != NULL)
+ shdr_mem.sh_name = ebl_strtaboffset (sec->strent);
+
+ Elf_Data *indata = elf_getdata (sec->scn, NULL);
+ ELF_CHECK (indata != NULL, _("cannot get section data: %s"));
+ Elf_Data *outdata = elf_getdata (sec->outscn, NULL);
+ ELF_CHECK (outdata != NULL, _("cannot copy section data: %s"));
+ *outdata = *indata;
+ elf_flagdata (outdata, ELF_C_SET, ELF_F_DIRTY);
+
+ /* Preserve the file layout of the allocated sections. */
+ if (stripped_ehdr->e_type != ET_REL && (shdr_mem.sh_flags & SHF_ALLOC))
+ {
+ shdr_mem.sh_offset = sec->shdr.sh_offset;
+ placed[elf_ndxscn (sec->outscn) - 1] = true;
+
+ const GElf_Off end_offset = (shdr_mem.sh_offset
+ + (shdr_mem.sh_type == SHT_NOBITS
+ ? 0 : shdr_mem.sh_size));
+ if (end_offset > offset)
+ offset = end_offset;
+ }
+
+ ELF_CHECK (gelf_update_shdr (sec->outscn, &shdr_mem),
+ _("cannot update section header: %s"));
+
+ if (shdr_mem.sh_type == SHT_SYMTAB || shdr_mem.sh_type == SHT_DYNSYM)
+ {
+ /* We must adjust all the section indices in the symbol table. */
+
+ Elf_Data *shndxdata = NULL; /* XXX */
+
+ for (size_t i = 1; i < shdr_mem.sh_size / shdr_mem.sh_entsize; ++i)
+ {
+ GElf_Sym sym_mem;
+ GElf_Word shndx = SHN_UNDEF;
+ GElf_Sym *sym = gelf_getsymshndx (outdata, shndxdata,
+ i, &sym_mem, &shndx);
+ ELF_CHECK (sym != NULL,
+ _("cannot get symbol table entry: %s"));
+ if (sym->st_shndx != SHN_XINDEX)
+ shndx = sym->st_shndx;
+
+ if (shndx != SHN_UNDEF && shndx < SHN_LORESERVE)
+ {
+ if (shndx >= stripped_shnum)
+ error (EXIT_FAILURE, 0,
+ _("symbol [%Zu] has invalid section index"), i);
+
+ shndx = ndx_section[shndx - 1];
+ if (shndx < SHN_LORESERVE)
+ {
+ sym->st_shndx = shndx;
+ shndx = SHN_UNDEF;
+ }
+ else
+ sym->st_shndx = SHN_XINDEX;
+
+ ELF_CHECK (gelf_update_symshndx (outdata, shndxdata,
+ i, sym, shndx),
+ _("cannot update symbol table: %s"));
+ }
+ }
+
+ if (shdr_mem.sh_type == SHT_SYMTAB)
+ stripped_symtab = sec;
+ if (shdr_mem.sh_type == SHT_DYNSYM)
+ stripped_dynsym = sec;
+ }
+ }
+
+ /* We may need to update the symbol table. */
+ Elf_Data *symdata = NULL;
+ struct Ebl_Strtab *symstrtab = NULL;
+ Elf_Data *symstrdata = NULL;
+ if (unstripped_symtab != NULL && (stripped_symtab != NULL
+ || check_prelink /* Section adjustments. */
+ || (stripped_ehdr->e_type != ET_REL
+ && bias != 0)))
+ {
+ /* Merge the stripped file's symbol table into the unstripped one. */
+ const size_t stripped_nsym = (stripped_symtab == NULL ? 1
+ : (stripped_symtab->shdr.sh_size
+ / stripped_symtab->shdr.sh_entsize));
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (unstripped_symtab, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+ const size_t unstripped_nsym = shdr->sh_size / shdr->sh_entsize;
+
+ /* First collect all the symbols from both tables. */
+
+ const size_t total_syms = stripped_nsym - 1 + unstripped_nsym - 1;
+ struct symbol symbols[total_syms];
+ size_t symndx_map[total_syms];
+
+ if (stripped_symtab != NULL)
+ collect_symbols (unstripped, stripped_ehdr->e_type == ET_REL,
+ stripped_symtab->scn,
+ elf_getscn (stripped, stripped_symtab->shdr.sh_link),
+ stripped_nsym, 0, ndx_section,
+ symbols, symndx_map, NULL);
+
+ Elf_Scn *unstripped_strtab = elf_getscn (unstripped, shdr->sh_link);
+ collect_symbols (unstripped, stripped_ehdr->e_type == ET_REL,
+ unstripped_symtab, unstripped_strtab, unstripped_nsym,
+ stripped_ehdr->e_type == ET_REL ? 0 : bias, NULL,
+ &symbols[stripped_nsym - 1],
+ &symndx_map[stripped_nsym - 1], split_bss);
+
+ /* Next, sort our array of all symbols. */
+ qsort (symbols, total_syms, sizeof symbols[0], compare_symbols);
+
+ /* Now we can weed out the duplicates. Assign remaining symbols
+ new slots, collecting a map from old indices to new. */
+ size_t nsym = 0;
+ for (struct symbol *s = symbols; s < &symbols[total_syms]; ++s)
+ {
+ /* Skip a section symbol for a removed section. */
+ if (s->shndx == SHN_UNDEF
+ && GELF_ST_TYPE (s->info.info) == STT_SECTION)
+ {
+ s->name = NULL; /* Mark as discarded. */
+ *s->map = STN_UNDEF;
+ s->duplicate = NULL;
+ continue;
+ }
+
+ struct symbol *n = s;
+ while (n + 1 < &symbols[total_syms] && !compare_symbols (s, n + 1))
+ ++n;
+
+ while (s < n)
+ {
+ /* This is a duplicate. Its twin will get the next slot. */
+ s->name = NULL; /* Mark as discarded. */
+ s->duplicate = n->map;
+ ++s;
+ }
+
+ /* Allocate the next slot. */
+ *s->map = ++nsym;
+ }
+
+ /* Now we sort again, to determine the order in the output. */
+ qsort (symbols, total_syms, sizeof symbols[0], compare_symbols_output);
+
+ if (nsym < total_syms)
+ /* The discarded symbols are now at the end of the table. */
+ assert (symbols[nsym].name == NULL);
+
+ /* Now a final pass updates the map with the final order,
+ and builds up the new string table. */
+ symstrtab = ebl_strtabinit (true);
+ for (size_t i = 0; i < nsym; ++i)
+ {
+ assert (symbols[i].name != NULL);
+ assert (*symbols[i].map != 0);
+ *symbols[i].map = 1 + i;
+ symbols[i].strent = ebl_strtabadd (symstrtab, symbols[i].name, 0);
+ }
+
+ /* Scan the discarded symbols too, just to update their slots
+ in SYMNDX_MAP to refer to their live duplicates. */
+ for (size_t i = nsym; i < total_syms; ++i)
+ {
+ assert (symbols[i].name == NULL);
+ if (symbols[i].duplicate == NULL)
+ assert (*symbols[i].map == STN_UNDEF);
+ else
+ {
+ assert (*symbols[i].duplicate != STN_UNDEF);
+ *symbols[i].map = *symbols[i].duplicate;
+ }
+ }
+
+ /* Now we are ready to write the new symbol table. */
+ symdata = elf_getdata (unstripped_symtab, NULL);
+ symstrdata = elf_getdata (unstripped_strtab, NULL);
+ Elf_Data *shndxdata = NULL; /* XXX */
+
+ ebl_strtabfinalize (symstrtab, symstrdata);
+ elf_flagdata (symstrdata, ELF_C_SET, ELF_F_DIRTY);
+
+ shdr->sh_size = symdata->d_size = (1 + nsym) * shdr->sh_entsize;
+ symdata->d_buf = xmalloc (symdata->d_size);
+
+ GElf_Sym sym;
+ memset (&sym, 0, sizeof sym);
+ ELF_CHECK (gelf_update_symshndx (symdata, shndxdata, 0, &sym, SHN_UNDEF),
+ _("cannot update symbol table: %s"));
+
+ shdr->sh_info = 1;
+ for (size_t i = 0; i < nsym; ++i)
+ {
+ struct symbol *s = &symbols[i];
+
+ /* Fill in the symbol details. */
+ sym.st_name = ebl_strtaboffset (s->strent);
+ sym.st_value = s->value; /* Already biased to output address. */
+ sym.st_size = s->size;
+ sym.st_shndx = s->shndx; /* Already mapped to output index. */
+ sym.st_info = s->info.info;
+ sym.st_other = s->info.other;
+
+ /* Keep track of the number of leading local symbols. */
+ if (GELF_ST_BIND (sym.st_info) == STB_LOCAL)
+ {
+ assert (shdr->sh_info == 1 + i);
+ shdr->sh_info = 1 + i + 1;
+ }
+
+ ELF_CHECK (gelf_update_symshndx (symdata, shndxdata, 1 + i,
+ &sym, SHN_UNDEF),
+ _("cannot update symbol table: %s"));
+
+ }
+ elf_flagdata (symdata, ELF_C_SET, ELF_F_DIRTY);
+ ELF_CHECK (gelf_update_shdr (unstripped_symtab, shdr),
+ _("cannot update section header: %s"));
+
+ if (stripped_symtab != NULL)
+ {
+ /* Adjust any relocations referring to the old symbol table. */
+ const size_t old_sh_link = elf_ndxscn (stripped_symtab->scn);
+ for (const struct section *sec = sections;
+ sec < &sections[stripped_shnum - 1];
+ ++sec)
+ if (sec->outscn != NULL && sec->shdr.sh_link == old_sh_link)
+ adjust_relocs (sec->outscn, sec->scn, &sec->shdr,
+ symndx_map, shdr);
+ }
+
+ /* Also adjust references to the other old symbol table. */
+ adjust_all_relocs (unstripped, unstripped_symtab, shdr,
+ &symndx_map[stripped_nsym - 1]);
+ }
+ else if (stripped_symtab != NULL && stripped_shnum != unstripped_shnum)
+ check_symtab_section_symbols (unstripped,
+ stripped_ehdr->e_type == ET_REL,
+ stripped_symtab->scn,
+ unstripped_shnum, unstripped_shstrndx,
+ stripped_symtab->outscn,
+ stripped_shnum, stripped_shstrndx,
+ debuglink);
+
+ if (stripped_dynsym != NULL)
+ (void) check_symtab_section_symbols (unstripped,
+ stripped_ehdr->e_type == ET_REL,
+ stripped_dynsym->outscn,
+ unstripped_shnum,
+ unstripped_shstrndx,
+ stripped_dynsym->scn, stripped_shnum,
+ stripped_shstrndx, debuglink);
+
+ /* We need to preserve the layout of the stripped file so the
+ phdrs will match up. This requires us to do our own layout of
+ the added sections. We do manual layout even for ET_REL just
+ so we can try to match what the original probably had. */
+
+ elf_flagelf (unstripped, ELF_C_SET, ELF_F_LAYOUT);
+
+ if (offset == 0)
+ /* For ET_REL we are starting the layout from scratch. */
+ offset = gelf_fsize (unstripped, ELF_T_EHDR, 1, EV_CURRENT);
+
+ bool skip_reloc = false;
+ do
+ {
+ skip_reloc = !skip_reloc;
+ for (size_t i = 0; i < unstripped_shnum - 1; ++i)
+ if (!placed[i])
+ {
+ scn = elf_getscn (unstripped, 1 + i);
+
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
+
+ if (skip_reloc
+ && (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA))
+ continue;
+
+ GElf_Off align = shdr->sh_addralign ?: 1;
+ offset = (offset + align - 1) & -align;
+ shdr->sh_offset = offset;
+ if (shdr->sh_type != SHT_NOBITS)
+ offset += shdr->sh_size;
+
+ ELF_CHECK (gelf_update_shdr (scn, shdr),
+ _("cannot update section header: %s"));
+
+ if (unstripped_shstrndx == 1 + i)
+ {
+ /* Place the section headers immediately after
+ .shstrtab, and update the ELF header. */
+
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (unstripped, &ehdr_mem);
+ ELF_CHECK (ehdr != NULL, _("cannot get ELF header: %s"));
+
+ GElf_Off sh_align = gelf_getclass (unstripped) * 4;
+ offset = (offset + sh_align - 1) & -sh_align;
+ ehdr->e_shnum = unstripped_shnum;
+ ehdr->e_shoff = offset;
+ offset += unstripped_shnum * ehdr->e_shentsize;
+ ELF_CHECK (gelf_update_ehdr (unstripped, ehdr),
+ _("cannot update ELF header: %s"));
+ }
+
+ placed[i] = true;
+ }
+ } while (skip_reloc);
+
+ if (stripped_ehdr->e_phnum > 0)
+ ELF_CHECK (gelf_newphdr (unstripped, stripped_ehdr->e_phnum),
+ _("cannot create program headers: %s"));
+
+ /* Copy each program header from the stripped file. */
+ for (uint_fast16_t i = 0; i < stripped_ehdr->e_phnum; ++i)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (stripped, i, &phdr_mem);
+ ELF_CHECK (phdr != NULL, _("cannot get program header: %s"));
+
+ ELF_CHECK (gelf_update_phdr (unstripped, i, phdr),
+ _("cannot update program header: %s"));
+ }
+
+ /* Finally, write out the file. */
+ ELF_CHECK (elf_update (unstripped, ELF_C_WRITE) > 0,
+ _("cannot write output file: %s"));
+
+ if (strtab != NULL)
+ {
+ ebl_strtabfree (strtab);
+ free (strtab_data->d_buf);
+ }
+
+ if (symdata != NULL)
+ free (symdata->d_buf);
+ if (symstrtab != NULL)
+ {
+ ebl_strtabfree (symstrtab);
+ free (symstrdata->d_buf);
+ }
+}
+
+/* Process one pair of files, already opened. */
+static void
+handle_file (const char *output_file, bool create_dirs,
+ Elf *stripped, const GElf_Ehdr *stripped_ehdr,
+ Elf *unstripped)
+{
+ /* Determine the address bias between the debuginfo file and the main
+ file, which may have been modified by prelinking. */
+ GElf_Addr bias = 0;
+ if (unstripped != NULL)
+ for (uint_fast16_t i = 0; i < stripped_ehdr->e_phnum; ++i)
+ {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr = gelf_getphdr (stripped, i, &phdr_mem);
+ ELF_CHECK (phdr != NULL, _("cannot get program header: %s"));
+ if (phdr->p_type == PT_LOAD)
+ {
+ GElf_Phdr unstripped_phdr_mem;
+ GElf_Phdr *unstripped_phdr = gelf_getphdr (unstripped, i,
+ &unstripped_phdr_mem);
+ ELF_CHECK (unstripped_phdr != NULL,
+ _("cannot get program header: %s"));
+ bias = phdr->p_vaddr - unstripped_phdr->p_vaddr;
+ break;
+ }
+ }
+
+ /* One day we could adjust all the DWARF data (like prelink itself does). */
+ if (bias != 0)
+ {
+ if (output_file == NULL)
+ error (0, 0, _("\
+DWARF data not adjusted for prelinking bias; consider prelink -u"));
+ else
+ error (0, 0, _("\
+DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"),
+ output_file);
+ }
+
+ if (output_file == NULL)
+ /* Modify the unstripped file in place. */
+ copy_elided_sections (unstripped, stripped, stripped_ehdr, bias);
+ else
+ {
+ if (create_dirs)
+ make_directories (output_file);
+
+ /* Copy the unstripped file and then modify it. */
+ int outfd = open64 (output_file, O_RDWR | O_CREAT,
+ stripped_ehdr->e_type == ET_REL ? 0666 : 0777);
+ if (outfd < 0)
+ error (EXIT_FAILURE, errno, _("cannot open '%s'"), output_file);
+ Elf *outelf = elf_begin (outfd, ELF_C_WRITE, NULL);
+ ELF_CHECK (outelf != NULL, _("cannot create ELF descriptor: %s"));
+
+ if (unstripped == NULL)
+ {
+ /* Actually, we are just copying out the main file as it is. */
+ copy_elf (outelf, stripped);
+ if (stripped_ehdr->e_type != ET_REL)
+ elf_flagelf (outelf, ELF_C_SET, ELF_F_LAYOUT);
+ ELF_CHECK (elf_update (outelf, ELF_C_WRITE) > 0,
+ _("cannot write output file: %s"));
+ }
+ else
+ {
+ copy_elf (outelf, unstripped);
+ copy_elided_sections (outelf, stripped, stripped_ehdr, bias);
+ }
+
+ elf_end (outelf);
+ close (outfd);
+ }
+}
+
+static int
+open_file (const char *file, bool writable)
+{
+ int fd = open64 (file, writable ? O_RDWR : O_RDONLY);
+ if (fd < 0)
+ error (EXIT_FAILURE, errno, _("cannot open '%s'"), file);
+ return fd;
+}
+
+/* Handle a pair of files we need to open by name. */
+static void
+handle_explicit_files (const char *output_file, bool create_dirs,
+ const char *stripped_file, const char *unstripped_file)
+{
+ int stripped_fd = open_file (stripped_file, false);
+ Elf *stripped = elf_begin (stripped_fd, ELF_C_READ, NULL);
+ GElf_Ehdr stripped_ehdr;
+ ELF_CHECK (gelf_getehdr (stripped, &stripped_ehdr),
+ _("cannot create ELF descriptor: %s"));
+
+ int unstripped_fd = -1;
+ Elf *unstripped = NULL;
+ if (unstripped_file != NULL)
+ {
+ unstripped_fd = open_file (unstripped_file, output_file == NULL);
+ unstripped = elf_begin (unstripped_fd,
+ (output_file == NULL ? ELF_C_RDWR : ELF_C_READ),
+ NULL);
+ GElf_Ehdr unstripped_ehdr;
+ ELF_CHECK (gelf_getehdr (unstripped, &unstripped_ehdr),
+ _("cannot create ELF descriptor: %s"));
+
+ if (memcmp (stripped_ehdr.e_ident, unstripped_ehdr.e_ident, EI_NIDENT)
+ || stripped_ehdr.e_type != unstripped_ehdr.e_type
+ || stripped_ehdr.e_machine != unstripped_ehdr.e_machine
+ || stripped_ehdr.e_phnum != unstripped_ehdr.e_phnum)
+ error (EXIT_FAILURE, 0, _("'%s' and '%s' do not seem to match"),
+ stripped_file, unstripped_file);
+ }
+
+ handle_file (output_file, create_dirs, stripped, &stripped_ehdr, unstripped);
+
+ elf_end (stripped);
+ close (stripped_fd);
+
+ elf_end (unstripped);
+ close (unstripped_fd);
+}
+
+
+/* Handle a pair of files opened implicitly by libdwfl for one module. */
+static void
+handle_dwfl_module (const char *output_file, bool create_dirs,
+ Dwfl_Module *mod, bool all, bool ignore, bool relocate)
+{
+ GElf_Addr bias;
+ Elf *stripped = dwfl_module_getelf (mod, &bias);
+ if (stripped == NULL)
+ {
+ if (ignore)
+ return;
+
+ const char *file;
+ const char *modname = dwfl_module_info (mod, NULL, NULL, NULL,
+ NULL, NULL, &file, NULL);
+ if (file == NULL)
+ error (EXIT_FAILURE, 0,
+ _("cannot find stripped file for module '%s': %s"),
+ modname, dwfl_errmsg (-1));
+ else
+ error (EXIT_FAILURE, 0,
+ _("cannot open stripped file '%s' for module '%s': %s"),
+ modname, file, dwfl_errmsg (-1));
+ }
+
+ Elf *debug = dwarf_getelf (dwfl_module_getdwarf (mod, &bias));
+ if (debug == NULL && !all)
+ {
+ if (ignore)
+ return;
+
+ const char *file;
+ const char *modname = dwfl_module_info (mod, NULL, NULL, NULL,
+ NULL, NULL, NULL, &file);
+ if (file == NULL)
+ error (EXIT_FAILURE, 0,
+ _("cannot find debug file for module '%s': %s"),
+ modname, dwfl_errmsg (-1));
+ else
+ error (EXIT_FAILURE, 0,
+ _("cannot open debug file '%s' for module '%s': %s"),
+ modname, file, dwfl_errmsg (-1));
+ }
+
+ if (debug == stripped)
+ {
+ if (all)
+ debug = NULL;
+ else
+ {
+ const char *file;
+ const char *modname = dwfl_module_info (mod, NULL, NULL, NULL,
+ NULL, NULL, &file, NULL);
+ error (EXIT_FAILURE, 0, _("module '%s' file '%s' is not stripped"),
+ modname, file);
+ }
+ }
+
+ GElf_Ehdr stripped_ehdr;
+ ELF_CHECK (gelf_getehdr (stripped, &stripped_ehdr),
+ _("cannot create ELF descriptor: %s"));
+
+ if (stripped_ehdr.e_type == ET_REL)
+ {
+ if (!relocate)
+ {
+ /* We can't use the Elf handles already open,
+ because the DWARF sections have been relocated. */
+
+ const char *stripped_file = NULL;
+ const char *unstripped_file = NULL;
+ (void) dwfl_module_info (mod, NULL, NULL, NULL, NULL, NULL,
+ &stripped_file, &unstripped_file);
+
+ handle_explicit_files (output_file, create_dirs,
+ stripped_file, unstripped_file);
+ return;
+ }
+
+ /* Relocation is what we want! This ensures that all sections that can
+ get sh_addr values assigned have them, even ones not used in DWARF.
+ They might still be used in the symbol table. */
+ if (dwfl_module_relocations (mod) < 0)
+ error (EXIT_FAILURE, 0,
+ _("cannot cache section addresses for module '%s': %s"),
+ dwfl_module_info (mod, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+ dwfl_errmsg (-1));
+ }
+
+ handle_file (output_file, create_dirs, stripped, &stripped_ehdr, debug);
+}
+
+/* Handle one module being written to the output directory. */
+static void
+handle_output_dir_module (const char *output_dir, Dwfl_Module *mod,
+ bool all, bool ignore, bool modnames, bool relocate)
+{
+ if (! modnames)
+ {
+ /* Make sure we've searched for the ELF file. */
+ GElf_Addr bias;
+ (void) dwfl_module_getelf (mod, &bias);
+ }
+
+ const char *file;
+ const char *name = dwfl_module_info (mod, NULL, NULL, NULL,
+ NULL, NULL, &file, NULL);
+
+ if (file == NULL && ignore)
+ return;
+
+ char *output_file;
+ if (asprintf (&output_file, "%s/%s", output_dir, modnames ? name : file) < 0)
+ error (EXIT_FAILURE, 0, _("memory exhausted"));
+
+ handle_dwfl_module (output_file, true, mod, all, ignore, relocate);
+}
+
+
+static void
+list_module (Dwfl_Module *mod)
+{
+ /* Make sure we have searched for the files. */
+ GElf_Addr bias;
+ bool have_elf = dwfl_module_getelf (mod, &bias) != NULL;
+ bool have_dwarf = dwfl_module_getdwarf (mod, &bias) != NULL;
+
+ const char *file;
+ const char *debug;
+ Dwarf_Addr start;
+ Dwarf_Addr end;
+ const char *name = dwfl_module_info (mod, NULL, &start, &end,
+ NULL, NULL, &file, &debug);
+ if (file != NULL && debug != NULL && (debug == file || !strcmp (debug, file)))
+ debug = ".";
+
+ const unsigned char *id;
+ GElf_Addr id_vaddr;
+ int id_len = dwfl_module_build_id (mod, &id, &id_vaddr);
+
+ printf ("%#" PRIx64 "+%#" PRIx64 " ", start, end - start);
+
+ if (id_len > 0)
+ {
+ do
+ printf ("%02" PRIx8, *id++);
+ while (--id_len > 0);
+ if (id_vaddr != 0)
+ printf ("@%#" PRIx64, id_vaddr);
+ }
+ else
+ putchar ('-');
+
+ printf (" %s %s %s\n",
+ file ?: have_elf ? "." : "-",
+ debug ?: have_dwarf ? "." : "-",
+ name);
+}
+
+
+struct match_module_info
+{
+ char **patterns;
+ Dwfl_Module *found;
+ bool match_files;
+};
+
+static int
+match_module (Dwfl_Module *mod,
+ void **userdata __attribute__ ((unused)),
+ const char *name,
+ Dwarf_Addr start __attribute__ ((unused)),
+ void *arg)
+{
+ struct match_module_info *info = arg;
+
+ if (info->patterns[0] == NULL) /* Match all. */
+ {
+ match:
+ info->found = mod;
+ return DWARF_CB_ABORT;
+ }
+
+ if (info->match_files)
+ {
+ /* Make sure we've searched for the ELF file. */
+ GElf_Addr bias;
+ (void) dwfl_module_getelf (mod, &bias);
+
+ const char *file;
+ const char *check = dwfl_module_info (mod, NULL, NULL, NULL,
+ NULL, NULL, &file, NULL);
+ assert (check == name);
+ if (file == NULL)
+ return DWARF_CB_OK;
+
+ name = file;
+ }
+
+ for (char **p = info->patterns; *p != NULL; ++p)
+ if (fnmatch (*p, name, 0) == 0)
+ goto match;
+
+ return DWARF_CB_OK;
+}
+
+/* Handle files opened implicitly via libdwfl. */
+static void
+handle_implicit_modules (const struct arg_info *info)
+{
+ struct match_module_info mmi = { info->args, NULL, info->match_files };
+ inline ptrdiff_t next (ptrdiff_t offset)
+ {
+ return dwfl_getmodules (info->dwfl, &match_module, &mmi, offset);
+ }
+ ptrdiff_t offset = next (0);
+ if (offset == 0)
+ error (EXIT_FAILURE, 0, _("no matching modules found"));
+
+ if (info->list)
+ do
+ list_module (mmi.found);
+ while ((offset = next (offset)) > 0);
+ else if (info->output_dir == NULL)
+ {
+ if (next (offset) != 0)
+ error (EXIT_FAILURE, 0, _("matched more than one module"));
+ handle_dwfl_module (info->output_file, false, mmi.found,
+ info->all, info->ignore, info->relocate);
+ }
+ else
+ do
+ handle_output_dir_module (info->output_dir, mmi.found,
+ info->all, info->ignore,
+ info->modnames, info->relocate);
+ while ((offset = next (offset)) > 0);
+}
+
+int
+main (int argc, char **argv)
+{
+ /* Make memory leak detection possible. */
+ mtrace ();
+
+ /* We use no threads here which can interfere with handling a stream. */
+ __fsetlocking (stdin, FSETLOCKING_BYCALLER);
+ __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+ __fsetlocking (stderr, FSETLOCKING_BYCALLER);
+
+ /* Set locale. */
+ setlocale (LC_ALL, "");
+
+ /* Make sure the message catalog can be found. */
+ bindtextdomain (PACKAGE_TARNAME, LOCALEDIR);
+
+ /* Initialize the message catalog. */
+ textdomain (PACKAGE_TARNAME);
+
+ /* Parse and process arguments. */
+ const struct argp_child argp_children[] =
+ {
+ {
+ .argp = dwfl_standard_argp (),
+ .header = N_("Input selection options:"),
+ .group = 1,
+ },
+ { .argp = NULL },
+ };
+ const struct argp argp =
+ {
+ .options = options,
+ .parser = parse_opt,
+ .children = argp_children,
+ .args_doc = N_("STRIPPED-FILE DEBUG-FILE\n[MODULE...]"),
+ .doc = N_("\
+Combine stripped files with separate symbols and debug information.\v\
+The first form puts the result in DEBUG-FILE if -o was not given.\n\
+\n\
+MODULE arguments give file name patterns matching modules to process.\n\
+With -f these match the file name of the main (stripped) file \
+(slashes are never special), otherwise they match the simple module names. \
+With no arguments, process all modules found.\n\
+\n\
+Multiple modules are written to files under OUTPUT-DIRECTORY, \
+creating subdirectories as needed. \
+With -m these files have simple module names, otherwise they have the \
+name of the main file complete with directory underneath OUTPUT-DIRECTORY.\n\
+\n\
+With -n no files are written, but one line to standard output for each module:\
+\n\tSTART+SIZE BUILDID FILE DEBUGFILE MODULENAME\n\
+START and SIZE are hexadecimal giving the address bounds of the module. \
+BUILDID is hexadecimal for the build ID bits, or - if no ID is known; \
+the hexadecimal may be followed by @0xADDR giving the address where the \
+ID resides if that is known. \
+FILE is the file name found for the module, or - if none was found, \
+or . if an ELF image is available but not from any named file. \
+DEBUGFILE is the separate debuginfo file name, \
+or - if no debuginfo was found, or . if FILE contains the debug information.\
+")
+ };
+
+ int remaining;
+ struct arg_info info = { .args = NULL };
+ error_t result = argp_parse (&argp, argc, argv, 0, &remaining, &info);
+ if (result == ENOSYS)
+ assert (info.dwfl == NULL);
+ else if (result)
+ return EXIT_FAILURE;
+ assert (info.args != NULL);
+
+ /* Tell the library which version we are expecting. */
+ elf_version (EV_CURRENT);
+
+ if (info.dwfl == NULL)
+ {
+ assert (result == ENOSYS);
+
+ if (info.output_dir != NULL)
+ {
+ char *file;
+ if (asprintf (&file, "%s/%s", info.output_dir, info.args[0]) < 0)
+ error (EXIT_FAILURE, 0, _("memory exhausted"));
+ handle_explicit_files (file, true, info.args[0], info.args[1]);
+ free (file);
+ }
+ else
+ handle_explicit_files (info.output_file, false,
+ info.args[0], info.args[1]);
+ }
+ else
+ {
+ /* parse_opt checked this. */
+ assert (info.output_file != NULL || info.output_dir != NULL || info.list);
+
+ handle_implicit_modules (&info);
+
+ dwfl_end (info.dwfl);
+ }
+
+ return 0;
+}
diff --git a/elfutils/tests/ChangeLog b/elfutils/tests/ChangeLog
index 5b188f84..f029f156 100644
--- a/elfutils/tests/ChangeLog
+++ b/elfutils/tests/ChangeLog
@@ -1,3 +1,160 @@
+2007-10-20 Roland McGrath <roland@redhat.com>
+
+ * run-dwfl-addr-sect.sh: Change expected output, no errors.
+
+2007-10-19 Roland McGrath <roland@redhat.com>
+
+ * dwfl-addr-sect.c (handle_address): Return int.
+ Don't exit on error, just return nonzero.
+ (main): Collect results.
+ * run-dwfl-addr-sect.sh: New file.
+ * testfile43.bz2: New data file.
+ * Makefile.am (EXTRA_DIST, TESTS): Add them.
+
+2007-10-18 Roland McGrath <roland@redhat.com>
+
+ * run-allregs.sh: Update expected ppc output for vrsave/vscr.
+
+2007-10-16 Roland McGrath <roland@redhat.com>
+
+ * test-subr.sh (remove_files): Don't pass -Bb to diff.
+
+2007-10-09 Roland McGrath <roland@redhat.com>
+
+ * dwflmodtest.c (print_module): Don't use %p in output.
+ * run-dwfl-bug-offline-rel.sh: Updated expected output.
+
+2007-10-08 Roland McGrath <roland@redhat.com>
+
+ * testfile42.bz2: New data file.
+ * Makefile.am (EXTRA_DIST): Add it.
+ * run-elflint-test.sh: New test on that file.
+
+2007-10-04 Roland McGrath <roland@redhat.com>
+
+ * run-readelf-test4.sh: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add it.
+
+2007-10-03 Roland McGrath <roland@redhat.com>
+
+ * run-readelf-test3.sh: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add it.
+
+2007-10-01 Roland McGrath <roland@redhat.com>
+
+ * run-readelf-test2.sh: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add it.
+
+2007-09-11 Roland McGrath <roland@redhat.com>
+
+ * run-addrname-test.sh: Add a new case.
+ * testfile41.bz2: New data file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+2007-08-23 Roland McGrath <roland@redhat.com>
+
+ * run-allregs.sh: Update expected x86-64 output for %rflags.
+
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test7.sh: New file.
+ * testfile39.bz2: New data file.
+ * testfile40.bz2: New data file.
+ * testfile40.debug.bz2: New data file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
+2007-08-09 Roland McGrath <roland@redhat.com>
+
+ * dwfl-bug-report.c: Fix header inclusion.
+
+2007-08-08 Roland McGrath <roland@redhat.com>
+
+ * run-addrname-test.sh: Add a new case using addr2line -S.
+ * testfile38.bz2: New data file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+2007-07-16 Roland McGrath <roland@redhat.com>
+
+ * dwfl-bug-report.c: New file.
+ * Makefile.am (noinst_PROGRAMS, TESTS): Add it.
+ (dwfl_bug_report_LDADD): New variable.
+
+2007-06-06 Roland McGrath <roland@redhat.com>
+
+ * run-unstrip-test.sh: Declare testfile.unstrip for removal.
+
+2007-06-05 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am (EXTRA_DIST): Add missing line continuation and
+ testfile37.bz and testfile37.debug.bz2.
+
+2007-05-23 Roland McGrath <roland@redhat.com>
+
+ * run-allregs.sh: Update expected Alpha results.
+
+2007-05-18 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test4.sh (stripped, debugfile): Use new reference files.
+ * testfile37.bz2: New data file.
+ * testfile37.debug.bz2: New data file.
+ * run-unstrip-test2.sh: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
+2007-05-10 Roland McGrath <roland@redhat.com>
+
+ * run-dwfl-bug-offline-rel.sh: New file.
+ * testfile36.bz2: New data file.
+ * testfile36.debug.bz2: New data file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
+2007-04-28 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test6.sh (stripped, debugfile): Use new reference files.
+ * testfile35.bz2: New data file.
+ * testfile35.debug.bz2: New data file.
+ * run-unstrip-test.sh: New file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
+ * run-strip-test.sh: Do all elflint and cmp runs even when some fail.
+
+2007-04-26 Roland McGrath <roland@redhat.com>
+
+ * run-elflint-self.sh: Run all tests even if one fails.
+
+ * run-allregs.sh: Add expected output for alpha.
+
+2007-04-24 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test.sh: When we saved the debug info, test unstrip too.
+
+2007-04-22 Roland McGrath <roland@redhat.com>
+
+ * run-allregs.sh: Update expected register info.
+
+2007-04-16 Roland McGrath <roland@redhat.com>
+
+ * dwfl-addr-sect.c: New file.
+ * Makefile.am (noinst_PROGRAMS): Add it.
+ (dwfl_addr_sect_LDADD): New variable.
+
+2007-04-05 Roland McGrath <roland@redhat.com>
+
+ * get-files.c: Test dwarf_getsrcdirs.
+ * run-get-files.sh: Update expected output.
+
+2007-04-01 Roland McGrath <roland@redhat.com>
+
+ * run-allregs.sh: Updated expected output for x86_64.
+
+2007-03-04 Roland McGrath <roland@redhat.com>
+
+ * dwfl-bug-fd-leak.c: New file.
+ * Makefile.am (noinst_PROGRAMS, TESTS): Add it.
+ (dwfl_bug_fd_leak_LDADD): New variable.
+
+ * dwflmodtest.c: Test dwfl_getmodules before and after getdwarf,
+ show what files have been located.
+
2007-02-02 Roland McGrath <roland@redhat.com>
* run-addrname-test.sh: New file.
@@ -503,7 +660,7 @@
* show-abbrev.c (main): Adjust for dwarf_getabbrev interface change.
-2005-04-04 Roland McGrath <roland@frob.com>
+2005-04-04 Roland McGrath <roland@redhat.com>
* line2addr.c (main): Initialize LINES and NLINES before calling
dwarf_getsrc_file, and free LINES afterwards.
diff --git a/elfutils/tests/Makefile.am b/elfutils/tests/Makefile.am
index bff5568b..45560788 100644
--- a/elfutils/tests/Makefile.am
+++ b/elfutils/tests/Makefile.am
@@ -58,7 +58,8 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
get-aranges allfcts line2addr addrscopes funcscopes \
show-abbrev hash newscn ecp dwflmodtest \
find-prologues funcretval allregs rdwrmmap \
- dwfl-bug-addr-overflow arls
+ dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
+ dwfl-addr-sect dwfl-bug-report
# get-ciefde
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -70,13 +71,19 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
run-show-abbrev.sh run-line2addr.sh hash \
newscn run-strip-test.sh run-strip-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-strip-test6.sh run-strip-test7.sh \
+ run-unstrip-test.sh run-unstrip-test2.sh \
+ run-ecp-test.sh run-ecp-test2.sh \
run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
- run-find-prologues.sh run-allregs.sh run-readelf-test1.sh \
+ run-find-prologues.sh run-allregs.sh \
+ run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
+ run-readelf-test4.sh \
run-native-test.sh run-bug1-test.sh \
- dwfl-bug-addr-overflow run-addrname-test.sh
+ dwfl-bug-addr-overflow run-addrname-test.sh \
+ dwfl-bug-fd-leak dwfl-bug-report \
+ run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh
# run-show-ciefde.sh
if !STANDALONE
@@ -101,11 +108,13 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
+ run-strip-test7.sh run-unstrip-test.sh run-unstrip-test2.sh \
run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
run-find-prologues.sh run-allregs.sh run-native-test.sh \
- run-addrname-test.sh \
+ run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
+ run-dwfl-addr-sect.sh \
testfile15.bz2 testfile15.debug.bz2 \
testfile16.bz2 testfile16.debug.bz2 \
testfile17.bz2 testfile17.debug.bz2 \
@@ -114,11 +123,17 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile21.bz2 testfile21.index.bz2 \
testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
testfile26.bz2 testfile27.bz2 \
- coverage.sh test-subr.sh test-wrapper.sh run-readelf-test1.sh \
+ coverage.sh test-subr.sh test-wrapper.sh \
+ run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
+ run-readelf-test4.sh \
run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
testfile29.bz2 testfile29.rdwr.bz2 \
testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
- testfile34.bz2
+ testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
+ testfile36.bz2 testfile36.debug.bz2 \
+ testfile37.bz2 testfile37.debug.bz2 \
+ testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
+ testfile41.bz2 testfile42.bz2 testfile43.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
@@ -203,6 +218,9 @@ dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
rdwrmmap_LDADD = $(libelf)
dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
arls_LDADD = $(libelf) $(libmudflap)
+dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
CLEANFILES = xxx *.gcno *.gcda *gconv
diff --git a/elfutils/tests/Makefile.in b/elfutils/tests/Makefile.in
index ec65676f..05cdb57f 100644
--- a/elfutils/tests/Makefile.in
+++ b/elfutils/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006 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,15 +14,11 @@
@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
@@ -49,7 +45,28 @@ noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
newscn$(EXEEXT) ecp$(EXEEXT) dwflmodtest$(EXEEXT) \
find-prologues$(EXEEXT) funcretval$(EXEEXT) allregs$(EXEEXT) \
rdwrmmap$(EXEEXT) dwfl-bug-addr-overflow$(EXEEXT) \
- arls$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_3)
+ arls$(EXEEXT) dwfl-bug-fd-leak$(EXEEXT) \
+ dwfl-addr-sect$(EXEEXT) dwfl-bug-report$(EXEEXT) \
+ $(am__EXEEXT_1) $(am__EXEEXT_3)
+TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \
+ test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \
+ update3$(EXEEXT) update4$(EXEEXT) run-show-die-info.sh \
+ run-get-files.sh run-get-lines.sh run-get-pubnames.sh \
+ run-get-aranges.sh run-allfcts.sh run-show-abbrev.sh \
+ run-line2addr.sh hash$(EXEEXT) newscn$(EXEEXT) \
+ run-strip-test.sh run-strip-test2.sh run-strip-test3.sh \
+ run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
+ run-strip-test7.sh run-unstrip-test.sh run-unstrip-test2.sh \
+ run-ecp-test.sh run-ecp-test2.sh run-elflint-test.sh \
+ run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
+ run-ranlib-test3.sh run-ranlib-test4.sh run-addrscopes.sh \
+ run-strings-test.sh run-funcscopes.sh run-find-prologues.sh \
+ run-allregs.sh run-readelf-test1.sh run-readelf-test2.sh \
+ run-readelf-test3.sh run-readelf-test4.sh run-native-test.sh \
+ run-bug1-test.sh dwfl-bug-addr-overflow$(EXEEXT) \
+ run-addrname-test.sh dwfl-bug-fd-leak$(EXEEXT) \
+ dwfl-bug-report$(EXEEXT) run-dwfl-bug-offline-rel.sh \
+ run-dwfl-addr-sect.sh $(am__EXEEXT_1) $(am__EXEEXT_3)
# run-show-ciefde.sh
@STANDALONE_FALSE@am__append_3 = msg_tst
@STANDALONE_FALSE@am__append_4 = msg_tst
@@ -58,11 +75,11 @@ noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(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 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.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
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@STANDALONE_FALSE@am__EXEEXT_1 = msg_tst$(EXEEXT)
@@ -142,11 +159,26 @@ asm_tst9_SOURCES = asm-tst9.c
asm_tst9_OBJECTS = asm-tst9.$(OBJEXT)
asm_tst9_DEPENDENCIES = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4)
+dwfl_addr_sect_SOURCES = dwfl-addr-sect.c
+dwfl_addr_sect_OBJECTS = dwfl-addr-sect.$(OBJEXT)
+dwfl_addr_sect_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_4)
dwfl_bug_addr_overflow_SOURCES = dwfl-bug-addr-overflow.c
dwfl_bug_addr_overflow_OBJECTS = dwfl-bug-addr-overflow.$(OBJEXT)
dwfl_bug_addr_overflow_DEPENDENCIES = $(am__DEPENDENCIES_3) \
$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_4)
+dwfl_bug_fd_leak_SOURCES = dwfl-bug-fd-leak.c
+dwfl_bug_fd_leak_OBJECTS = dwfl-bug-fd-leak.$(OBJEXT)
+dwfl_bug_fd_leak_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_4)
+dwfl_bug_report_SOURCES = dwfl-bug-report.c
+dwfl_bug_report_OBJECTS = dwfl-bug-report.$(OBJEXT)
+dwfl_bug_report_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_4)
dwflmodtest_SOURCES = dwflmodtest.c
dwflmodtest_OBJECTS = dwflmodtest.$(OBJEXT)
dwflmodtest_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \
@@ -235,7 +267,7 @@ update4_SOURCES = update4.c
update4_OBJECTS = update4.$(OBJEXT)
update4_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_4)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -245,7 +277,8 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = addrscopes.c allfcts.c allregs.c arextract.c arls.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 \
- dwfl-bug-addr-overflow.c dwflmodtest.c ecp.c find-prologues.c \
+ dwfl-addr-sect.c dwfl-bug-addr-overflow.c dwfl-bug-fd-leak.c \
+ dwfl-bug-report.c dwflmodtest.c ecp.c find-prologues.c \
funcretval.c funcscopes.c get-aranges.c get-files.c \
get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \
newfile.c newscn.c rdwrmmap.c saridx.c scnnames.c \
@@ -254,7 +287,8 @@ SOURCES = addrscopes.c allfcts.c allregs.c arextract.c arls.c \
DIST_SOURCES = addrscopes.c allfcts.c allregs.c arextract.c arls.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 \
- dwfl-bug-addr-overflow.c dwflmodtest.c ecp.c find-prologues.c \
+ dwfl-addr-sect.c dwfl-bug-addr-overflow.c dwfl-bug-fd-leak.c \
+ dwfl-bug-report.c dwflmodtest.c ecp.c find-prologues.c \
funcretval.c funcscopes.c get-aranges.c get-files.c \
get-lines.c get-pubnames.c hash.c line2addr.c msg_tst.c \
newfile.c newscn.c rdwrmmap.c saridx.c scnnames.c \
@@ -264,15 +298,11 @@ ETAGS = etags
CTAGS = ctags
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@
-BUILD_STATIC_FALSE = @BUILD_STATIC_FALSE@
-BUILD_STATIC_TRUE = @BUILD_STATIC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -285,13 +315,9 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
-GCOV_FALSE = @GCOV_FALSE@
-GCOV_TRUE = @GCOV_TRUE@
GMSGFMT = @GMSGFMT@
-GPROF_FALSE = @GPROF_FALSE@
-GPROF_TRUE = @GPROF_TRUE@
-HAVE_LIBASM_FALSE = @HAVE_LIBASM_FALSE@
-HAVE_LIBASM_TRUE = @HAVE_LIBASM_TRUE@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -306,19 +332,12 @@ LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
+MKDIR_P = @MKDIR_P@
MODVERSION = @MODVERSION@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
-MUDFLAP_FALSE = @MUDFLAP_FALSE@
-MUDFLAP_TRUE = @MUDFLAP_TRUE@
-NATIVE_LD_FALSE = @NATIVE_LD_FALSE@
-NATIVE_LD_TRUE = @NATIVE_LD_TRUE@
-NEVER_FALSE = @NEVER_FALSE@
-NEVER_TRUE = @NEVER_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -330,20 +349,18 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STANDALONE_FALSE = @STANDALONE_FALSE@
-STANDALONE_TRUE = @STANDALONE_TRUE@
STRIP = @STRIP@
-TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
-TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
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@
@@ -356,28 +373,39 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
@MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
@@ -398,19 +426,6 @@ AM_LDFLAGS = $(am__append_1) $(am__append_2)
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
-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-allfcts.sh run-show-abbrev.sh run-line2addr.sh hash newscn \
- run-strip-test.sh run-strip-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-elflint-test.sh \
- run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
- run-ranlib-test3.sh run-ranlib-test4.sh run-addrscopes.sh \
- run-strings-test.sh run-funcscopes.sh run-find-prologues.sh \
- run-allregs.sh run-readelf-test1.sh run-native-test.sh \
- run-bug1-test.sh dwfl-bug-addr-overflow run-addrname-test.sh \
- $(am__append_4) $(am__append_6)
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
run-get-pubnames.sh run-get-aranges.sh \
@@ -422,11 +437,13 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
+ run-strip-test7.sh run-unstrip-test.sh run-unstrip-test2.sh \
run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
run-find-prologues.sh run-allregs.sh run-native-test.sh \
- run-addrname-test.sh \
+ run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
+ run-dwfl-addr-sect.sh \
testfile15.bz2 testfile15.debug.bz2 \
testfile16.bz2 testfile16.debug.bz2 \
testfile17.bz2 testfile17.debug.bz2 \
@@ -435,11 +452,17 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile21.bz2 testfile21.index.bz2 \
testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
testfile26.bz2 testfile27.bz2 \
- coverage.sh test-subr.sh test-wrapper.sh run-readelf-test1.sh \
+ coverage.sh test-subr.sh test-wrapper.sh \
+ run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
+ run-readelf-test4.sh \
run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
testfile29.bz2 testfile29.rdwr.bz2 \
testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
- testfile34.bz2
+ testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
+ testfile36.bz2 testfile36.debug.bz2 \
+ testfile37.bz2 testfile37.debug.bz2 \
+ testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
+ testfile41.bz2 testfile42.bz2 testfile43.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
@@ -508,6 +531,9 @@ dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
rdwrmmap_LDADD = $(libelf)
dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
arls_LDADD = $(libelf) $(libmudflap)
+dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
CLEANFILES = xxx *.gcno *.gcda *gconv
all: all-am
@@ -547,130 +573,139 @@ clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
addrscopes$(EXEEXT): $(addrscopes_OBJECTS) $(addrscopes_DEPENDENCIES)
@rm -f addrscopes$(EXEEXT)
- $(LINK) $(addrscopes_LDFLAGS) $(addrscopes_OBJECTS) $(addrscopes_LDADD) $(LIBS)
+ $(LINK) $(addrscopes_OBJECTS) $(addrscopes_LDADD) $(LIBS)
allfcts$(EXEEXT): $(allfcts_OBJECTS) $(allfcts_DEPENDENCIES)
@rm -f allfcts$(EXEEXT)
- $(LINK) $(allfcts_LDFLAGS) $(allfcts_OBJECTS) $(allfcts_LDADD) $(LIBS)
+ $(LINK) $(allfcts_OBJECTS) $(allfcts_LDADD) $(LIBS)
allregs$(EXEEXT): $(allregs_OBJECTS) $(allregs_DEPENDENCIES)
@rm -f allregs$(EXEEXT)
- $(LINK) $(allregs_LDFLAGS) $(allregs_OBJECTS) $(allregs_LDADD) $(LIBS)
+ $(LINK) $(allregs_OBJECTS) $(allregs_LDADD) $(LIBS)
arextract$(EXEEXT): $(arextract_OBJECTS) $(arextract_DEPENDENCIES)
@rm -f arextract$(EXEEXT)
- $(LINK) $(arextract_LDFLAGS) $(arextract_OBJECTS) $(arextract_LDADD) $(LIBS)
+ $(LINK) $(arextract_OBJECTS) $(arextract_LDADD) $(LIBS)
arls$(EXEEXT): $(arls_OBJECTS) $(arls_DEPENDENCIES)
@rm -f arls$(EXEEXT)
- $(LINK) $(arls_LDFLAGS) $(arls_OBJECTS) $(arls_LDADD) $(LIBS)
+ $(LINK) $(arls_OBJECTS) $(arls_LDADD) $(LIBS)
arsymtest$(EXEEXT): $(arsymtest_OBJECTS) $(arsymtest_DEPENDENCIES)
@rm -f arsymtest$(EXEEXT)
- $(LINK) $(arsymtest_LDFLAGS) $(arsymtest_OBJECTS) $(arsymtest_LDADD) $(LIBS)
+ $(LINK) $(arsymtest_OBJECTS) $(arsymtest_LDADD) $(LIBS)
asm-tst1$(EXEEXT): $(asm_tst1_OBJECTS) $(asm_tst1_DEPENDENCIES)
@rm -f asm-tst1$(EXEEXT)
- $(LINK) $(asm_tst1_LDFLAGS) $(asm_tst1_OBJECTS) $(asm_tst1_LDADD) $(LIBS)
+ $(LINK) $(asm_tst1_OBJECTS) $(asm_tst1_LDADD) $(LIBS)
asm-tst2$(EXEEXT): $(asm_tst2_OBJECTS) $(asm_tst2_DEPENDENCIES)
@rm -f asm-tst2$(EXEEXT)
- $(LINK) $(asm_tst2_LDFLAGS) $(asm_tst2_OBJECTS) $(asm_tst2_LDADD) $(LIBS)
+ $(LINK) $(asm_tst2_OBJECTS) $(asm_tst2_LDADD) $(LIBS)
asm-tst3$(EXEEXT): $(asm_tst3_OBJECTS) $(asm_tst3_DEPENDENCIES)
@rm -f asm-tst3$(EXEEXT)
- $(LINK) $(asm_tst3_LDFLAGS) $(asm_tst3_OBJECTS) $(asm_tst3_LDADD) $(LIBS)
+ $(LINK) $(asm_tst3_OBJECTS) $(asm_tst3_LDADD) $(LIBS)
asm-tst4$(EXEEXT): $(asm_tst4_OBJECTS) $(asm_tst4_DEPENDENCIES)
@rm -f asm-tst4$(EXEEXT)
- $(LINK) $(asm_tst4_LDFLAGS) $(asm_tst4_OBJECTS) $(asm_tst4_LDADD) $(LIBS)
+ $(LINK) $(asm_tst4_OBJECTS) $(asm_tst4_LDADD) $(LIBS)
asm-tst5$(EXEEXT): $(asm_tst5_OBJECTS) $(asm_tst5_DEPENDENCIES)
@rm -f asm-tst5$(EXEEXT)
- $(LINK) $(asm_tst5_LDFLAGS) $(asm_tst5_OBJECTS) $(asm_tst5_LDADD) $(LIBS)
+ $(LINK) $(asm_tst5_OBJECTS) $(asm_tst5_LDADD) $(LIBS)
asm-tst6$(EXEEXT): $(asm_tst6_OBJECTS) $(asm_tst6_DEPENDENCIES)
@rm -f asm-tst6$(EXEEXT)
- $(LINK) $(asm_tst6_LDFLAGS) $(asm_tst6_OBJECTS) $(asm_tst6_LDADD) $(LIBS)
+ $(LINK) $(asm_tst6_OBJECTS) $(asm_tst6_LDADD) $(LIBS)
asm-tst7$(EXEEXT): $(asm_tst7_OBJECTS) $(asm_tst7_DEPENDENCIES)
@rm -f asm-tst7$(EXEEXT)
- $(LINK) $(asm_tst7_LDFLAGS) $(asm_tst7_OBJECTS) $(asm_tst7_LDADD) $(LIBS)
+ $(LINK) $(asm_tst7_OBJECTS) $(asm_tst7_LDADD) $(LIBS)
asm-tst8$(EXEEXT): $(asm_tst8_OBJECTS) $(asm_tst8_DEPENDENCIES)
@rm -f asm-tst8$(EXEEXT)
- $(LINK) $(asm_tst8_LDFLAGS) $(asm_tst8_OBJECTS) $(asm_tst8_LDADD) $(LIBS)
+ $(LINK) $(asm_tst8_OBJECTS) $(asm_tst8_LDADD) $(LIBS)
asm-tst9$(EXEEXT): $(asm_tst9_OBJECTS) $(asm_tst9_DEPENDENCIES)
@rm -f asm-tst9$(EXEEXT)
- $(LINK) $(asm_tst9_LDFLAGS) $(asm_tst9_OBJECTS) $(asm_tst9_LDADD) $(LIBS)
+ $(LINK) $(asm_tst9_OBJECTS) $(asm_tst9_LDADD) $(LIBS)
+dwfl-addr-sect$(EXEEXT): $(dwfl_addr_sect_OBJECTS) $(dwfl_addr_sect_DEPENDENCIES)
+ @rm -f dwfl-addr-sect$(EXEEXT)
+ $(LINK) $(dwfl_addr_sect_OBJECTS) $(dwfl_addr_sect_LDADD) $(LIBS)
dwfl-bug-addr-overflow$(EXEEXT): $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_DEPENDENCIES)
@rm -f dwfl-bug-addr-overflow$(EXEEXT)
- $(LINK) $(dwfl_bug_addr_overflow_LDFLAGS) $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_LDADD) $(LIBS)
+ $(LINK) $(dwfl_bug_addr_overflow_OBJECTS) $(dwfl_bug_addr_overflow_LDADD) $(LIBS)
+dwfl-bug-fd-leak$(EXEEXT): $(dwfl_bug_fd_leak_OBJECTS) $(dwfl_bug_fd_leak_DEPENDENCIES)
+ @rm -f dwfl-bug-fd-leak$(EXEEXT)
+ $(LINK) $(dwfl_bug_fd_leak_OBJECTS) $(dwfl_bug_fd_leak_LDADD) $(LIBS)
+dwfl-bug-report$(EXEEXT): $(dwfl_bug_report_OBJECTS) $(dwfl_bug_report_DEPENDENCIES)
+ @rm -f dwfl-bug-report$(EXEEXT)
+ $(LINK) $(dwfl_bug_report_OBJECTS) $(dwfl_bug_report_LDADD) $(LIBS)
dwflmodtest$(EXEEXT): $(dwflmodtest_OBJECTS) $(dwflmodtest_DEPENDENCIES)
@rm -f dwflmodtest$(EXEEXT)
- $(LINK) $(dwflmodtest_LDFLAGS) $(dwflmodtest_OBJECTS) $(dwflmodtest_LDADD) $(LIBS)
+ $(LINK) $(dwflmodtest_OBJECTS) $(dwflmodtest_LDADD) $(LIBS)
ecp$(EXEEXT): $(ecp_OBJECTS) $(ecp_DEPENDENCIES)
@rm -f ecp$(EXEEXT)
- $(LINK) $(ecp_LDFLAGS) $(ecp_OBJECTS) $(ecp_LDADD) $(LIBS)
+ $(LINK) $(ecp_OBJECTS) $(ecp_LDADD) $(LIBS)
find-prologues$(EXEEXT): $(find_prologues_OBJECTS) $(find_prologues_DEPENDENCIES)
@rm -f find-prologues$(EXEEXT)
- $(LINK) $(find_prologues_LDFLAGS) $(find_prologues_OBJECTS) $(find_prologues_LDADD) $(LIBS)
+ $(LINK) $(find_prologues_OBJECTS) $(find_prologues_LDADD) $(LIBS)
funcretval$(EXEEXT): $(funcretval_OBJECTS) $(funcretval_DEPENDENCIES)
@rm -f funcretval$(EXEEXT)
- $(LINK) $(funcretval_LDFLAGS) $(funcretval_OBJECTS) $(funcretval_LDADD) $(LIBS)
+ $(LINK) $(funcretval_OBJECTS) $(funcretval_LDADD) $(LIBS)
funcscopes$(EXEEXT): $(funcscopes_OBJECTS) $(funcscopes_DEPENDENCIES)
@rm -f funcscopes$(EXEEXT)
- $(LINK) $(funcscopes_LDFLAGS) $(funcscopes_OBJECTS) $(funcscopes_LDADD) $(LIBS)
+ $(LINK) $(funcscopes_OBJECTS) $(funcscopes_LDADD) $(LIBS)
get-aranges$(EXEEXT): $(get_aranges_OBJECTS) $(get_aranges_DEPENDENCIES)
@rm -f get-aranges$(EXEEXT)
- $(LINK) $(get_aranges_LDFLAGS) $(get_aranges_OBJECTS) $(get_aranges_LDADD) $(LIBS)
+ $(LINK) $(get_aranges_OBJECTS) $(get_aranges_LDADD) $(LIBS)
get-files$(EXEEXT): $(get_files_OBJECTS) $(get_files_DEPENDENCIES)
@rm -f get-files$(EXEEXT)
- $(LINK) $(get_files_LDFLAGS) $(get_files_OBJECTS) $(get_files_LDADD) $(LIBS)
+ $(LINK) $(get_files_OBJECTS) $(get_files_LDADD) $(LIBS)
get-lines$(EXEEXT): $(get_lines_OBJECTS) $(get_lines_DEPENDENCIES)
@rm -f get-lines$(EXEEXT)
- $(LINK) $(get_lines_LDFLAGS) $(get_lines_OBJECTS) $(get_lines_LDADD) $(LIBS)
+ $(LINK) $(get_lines_OBJECTS) $(get_lines_LDADD) $(LIBS)
get-pubnames$(EXEEXT): $(get_pubnames_OBJECTS) $(get_pubnames_DEPENDENCIES)
@rm -f get-pubnames$(EXEEXT)
- $(LINK) $(get_pubnames_LDFLAGS) $(get_pubnames_OBJECTS) $(get_pubnames_LDADD) $(LIBS)
+ $(LINK) $(get_pubnames_OBJECTS) $(get_pubnames_LDADD) $(LIBS)
hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES)
@rm -f hash$(EXEEXT)
- $(LINK) $(hash_LDFLAGS) $(hash_OBJECTS) $(hash_LDADD) $(LIBS)
+ $(LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS)
line2addr$(EXEEXT): $(line2addr_OBJECTS) $(line2addr_DEPENDENCIES)
@rm -f line2addr$(EXEEXT)
- $(LINK) $(line2addr_LDFLAGS) $(line2addr_OBJECTS) $(line2addr_LDADD) $(LIBS)
+ $(LINK) $(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)
+ $(LINK) $(msg_tst_OBJECTS) $(msg_tst_LDADD) $(LIBS)
newfile$(EXEEXT): $(newfile_OBJECTS) $(newfile_DEPENDENCIES)
@rm -f newfile$(EXEEXT)
- $(LINK) $(newfile_LDFLAGS) $(newfile_OBJECTS) $(newfile_LDADD) $(LIBS)
+ $(LINK) $(newfile_OBJECTS) $(newfile_LDADD) $(LIBS)
newscn$(EXEEXT): $(newscn_OBJECTS) $(newscn_DEPENDENCIES)
@rm -f newscn$(EXEEXT)
- $(LINK) $(newscn_LDFLAGS) $(newscn_OBJECTS) $(newscn_LDADD) $(LIBS)
+ $(LINK) $(newscn_OBJECTS) $(newscn_LDADD) $(LIBS)
rdwrmmap$(EXEEXT): $(rdwrmmap_OBJECTS) $(rdwrmmap_DEPENDENCIES)
@rm -f rdwrmmap$(EXEEXT)
- $(LINK) $(rdwrmmap_LDFLAGS) $(rdwrmmap_OBJECTS) $(rdwrmmap_LDADD) $(LIBS)
+ $(LINK) $(rdwrmmap_OBJECTS) $(rdwrmmap_LDADD) $(LIBS)
saridx$(EXEEXT): $(saridx_OBJECTS) $(saridx_DEPENDENCIES)
@rm -f saridx$(EXEEXT)
- $(LINK) $(saridx_LDFLAGS) $(saridx_OBJECTS) $(saridx_LDADD) $(LIBS)
+ $(LINK) $(saridx_OBJECTS) $(saridx_LDADD) $(LIBS)
scnnames$(EXEEXT): $(scnnames_OBJECTS) $(scnnames_DEPENDENCIES)
@rm -f scnnames$(EXEEXT)
- $(LINK) $(scnnames_LDFLAGS) $(scnnames_OBJECTS) $(scnnames_LDADD) $(LIBS)
+ $(LINK) $(scnnames_OBJECTS) $(scnnames_LDADD) $(LIBS)
sectiondump$(EXEEXT): $(sectiondump_OBJECTS) $(sectiondump_DEPENDENCIES)
@rm -f sectiondump$(EXEEXT)
- $(LINK) $(sectiondump_LDFLAGS) $(sectiondump_OBJECTS) $(sectiondump_LDADD) $(LIBS)
+ $(LINK) $(sectiondump_OBJECTS) $(sectiondump_LDADD) $(LIBS)
show-abbrev$(EXEEXT): $(show_abbrev_OBJECTS) $(show_abbrev_DEPENDENCIES)
@rm -f show-abbrev$(EXEEXT)
- $(LINK) $(show_abbrev_LDFLAGS) $(show_abbrev_OBJECTS) $(show_abbrev_LDADD) $(LIBS)
+ $(LINK) $(show_abbrev_OBJECTS) $(show_abbrev_LDADD) $(LIBS)
show-die-info$(EXEEXT): $(show_die_info_OBJECTS) $(show_die_info_DEPENDENCIES)
@rm -f show-die-info$(EXEEXT)
- $(LINK) $(show_die_info_LDFLAGS) $(show_die_info_OBJECTS) $(show_die_info_LDADD) $(LIBS)
+ $(LINK) $(show_die_info_OBJECTS) $(show_die_info_LDADD) $(LIBS)
showptable$(EXEEXT): $(showptable_OBJECTS) $(showptable_DEPENDENCIES)
@rm -f showptable$(EXEEXT)
- $(LINK) $(showptable_LDFLAGS) $(showptable_OBJECTS) $(showptable_LDADD) $(LIBS)
+ $(LINK) $(showptable_OBJECTS) $(showptable_LDADD) $(LIBS)
test-nlist$(EXEEXT): $(test_nlist_OBJECTS) $(test_nlist_DEPENDENCIES)
@rm -f test-nlist$(EXEEXT)
- $(LINK) $(test_nlist_LDFLAGS) $(test_nlist_OBJECTS) $(test_nlist_LDADD) $(LIBS)
+ $(LINK) $(test_nlist_OBJECTS) $(test_nlist_LDADD) $(LIBS)
update1$(EXEEXT): $(update1_OBJECTS) $(update1_DEPENDENCIES)
@rm -f update1$(EXEEXT)
- $(LINK) $(update1_LDFLAGS) $(update1_OBJECTS) $(update1_LDADD) $(LIBS)
+ $(LINK) $(update1_OBJECTS) $(update1_LDADD) $(LIBS)
update2$(EXEEXT): $(update2_OBJECTS) $(update2_DEPENDENCIES)
@rm -f update2$(EXEEXT)
- $(LINK) $(update2_LDFLAGS) $(update2_OBJECTS) $(update2_LDADD) $(LIBS)
+ $(LINK) $(update2_OBJECTS) $(update2_LDADD) $(LIBS)
update3$(EXEEXT): $(update3_OBJECTS) $(update3_DEPENDENCIES)
@rm -f update3$(EXEEXT)
- $(LINK) $(update3_LDFLAGS) $(update3_OBJECTS) $(update3_LDADD) $(LIBS)
+ $(LINK) $(update3_OBJECTS) $(update3_LDADD) $(LIBS)
update4$(EXEEXT): $(update4_OBJECTS) $(update4_DEPENDENCIES)
@rm -f update4$(EXEEXT)
- $(LINK) $(update4_LDFLAGS) $(update4_OBJECTS) $(update4_LDADD) $(LIBS)
+ $(LINK) $(update4_OBJECTS) $(update4_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -693,7 +728,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm-tst7.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm-tst8.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm-tst9.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-addr-sect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-bug-addr-overflow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-bug-fd-leak.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-bug-report.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwflmodtest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find-prologues.Po@am__quote@
@@ -722,19 +760,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update4.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -785,9 +822,9 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
srcdir=$(srcdir); export srcdir; \
- list='$(TESTS)'; \
+ list=' $(TESTS) '; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
@@ -796,7 +833,7 @@ check-TESTS: $(TESTS)
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
+ *$$ws$$tst$$ws*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
@@ -808,7 +845,7 @@ check-TESTS: $(TESTS)
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
+ *$$ws$$tst$$ws*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
@@ -858,22 +895,21 @@ check-TESTS: $(TESTS)
else :; fi
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; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
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 \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -937,12 +973,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am: installcheck-local
maintainer-clean: maintainer-clean-am
@@ -962,18 +1006,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-generic clean-noinstPROGRAMS ctags distclean \
distclean-compile distclean-generic distclean-tags 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 \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installcheck-local installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am
+ tags uninstall uninstall-am
@STANDALONE_FALSE@installcheck-local:
diff --git a/elfutils/tests/dwfl-addr-sect.c b/elfutils/tests/dwfl-addr-sect.c
new file mode 100644
index 00000000..62d11541
--- /dev/null
+++ b/elfutils/tests/dwfl-addr-sect.c
@@ -0,0 +1,88 @@
+/* Test program for libdwfl ... foo
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include <config.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <stdlib.h>
+#include <string.h>
+#include <error.h>
+#include <locale.h>
+#include <argp.h>
+#include ELFUTILS_HEADER(dwfl)
+#include <dwarf.h>
+
+static int
+handle_address (Dwfl *dwfl, Dwarf_Addr address)
+{
+ Dwfl_Module *mod = dwfl_addrmodule (dwfl, address);
+ Dwarf_Addr adjusted = address;
+ Dwarf_Addr bias;
+ Elf_Scn *scn = dwfl_module_address_section (mod, &adjusted, &bias);
+ if (scn == NULL)
+ {
+ error (0, 0, "%#" PRIx64 ": dwfl_module_address_section: %s",
+ address, dwfl_errmsg (-1));
+ return 1;
+ }
+ printf ("address %#" PRIx64 " => module \"%s\" section %zu + %#" PRIx64 "\n",
+ address,
+ dwfl_module_info (mod, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+ elf_ndxscn (scn), adjusted);
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+
+ /* Set locale. */
+ (void) setlocale (LC_ALL, "");
+
+ int remaining;
+ Dwfl *dwfl = NULL;
+ (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining, &dwfl);
+ assert (dwfl != NULL);
+
+ int result = 0;
+ for (; remaining < argc; ++remaining)
+ {
+ char *endp;
+ uintmax_t addr = strtoumax (argv[remaining], &endp, 0);
+ if (endp != argv[remaining])
+ result |= handle_address (dwfl, addr);
+ else
+ result = 1;
+ }
+
+ dwfl_end (dwfl);
+
+ return result;
+}
diff --git a/elfutils/tests/dwfl-bug-fd-leak.c b/elfutils/tests/dwfl-bug-fd-leak.c
new file mode 100644
index 00000000..c75a79b6
--- /dev/null
+++ b/elfutils/tests/dwfl-bug-fd-leak.c
@@ -0,0 +1,110 @@
+/* Test program for libdwfl file decriptors leakage.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include <config.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <locale.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <error.h>
+#include <unistd.h>
+#include <dwarf.h>
+#include <sys/resource.h>
+#include ELFUTILS_HEADER(dwfl)
+
+
+static Dwfl *
+elfutils_open (pid_t pid, Dwarf_Addr address)
+{
+ static char *debuginfo_path;
+ static const Dwfl_Callbacks proc_callbacks =
+ {
+ .find_debuginfo = dwfl_standard_find_debuginfo,
+ .debuginfo_path = &debuginfo_path,
+
+ .find_elf = dwfl_linux_proc_find_elf,
+ };
+ Dwfl *dwfl = dwfl_begin (&proc_callbacks);
+ if (dwfl == NULL)
+ error (2, 0, "dwfl_begin: %s", dwfl_errmsg (-1));
+
+ int result = dwfl_linux_proc_report (dwfl, pid);
+ if (result < 0)
+ error (2, 0, "dwfl_linux_proc_report: %s", dwfl_errmsg (-1));
+ else if (result > 0)
+ error (2, result, "dwfl_linux_proc_report");
+
+ if (dwfl_report_end (dwfl, NULL, NULL) != 0)
+ error (2, 0, "dwfl_report_end: %s", dwfl_errmsg (-1));
+
+ Dwarf_Addr bias;
+ Dwarf *dbg = dwfl_addrdwarf (dwfl, address, &bias);
+ if (dbg != NULL)
+ {
+ Elf *elf = dwarf_getelf (dbg);
+ if (elf == NULL)
+ error (2, 0, "dwarf_getelf: %s", dwarf_errmsg (-1));
+ }
+ else
+ {
+ Elf *elf = dwfl_module_getelf (dwfl_addrmodule (dwfl, address), &bias);
+ if (elf == NULL)
+ error (2, 0, "dwfl_module_getelf: %s", dwfl_errmsg (-1));
+ }
+
+ return dwfl;
+}
+
+static void
+elfutils_close (Dwfl *dwfl)
+{
+ dwfl_end (dwfl);
+}
+
+int
+main (void)
+{
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+
+ /* Set locale. */
+ (void) setlocale (LC_ALL, "");
+
+ struct rlimit fd_limit = { .rlim_cur = 32, .rlim_max = 32 };
+ if (setrlimit (RLIMIT_NOFILE, &fd_limit) < 0)
+ error (2, errno, "setrlimit");
+
+ for (int i = 0; i < 5000; ++i)
+ {
+ Dwfl *dwfl = elfutils_open (getpid (), (Dwarf_Addr) main);
+ elfutils_close (dwfl);
+ }
+
+ return 0;
+}
diff --git a/elfutils/tests/dwfl-bug-report.c b/elfutils/tests/dwfl-bug-report.c
new file mode 100644
index 00000000..459a41ae
--- /dev/null
+++ b/elfutils/tests/dwfl-bug-report.c
@@ -0,0 +1,56 @@
+/* Test program for dwfl_report_end bug.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils 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; version 2 of the License.
+
+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#include <config.h>
+#include ELFUTILS_HEADER(dwfl)
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+static const Dwfl_Callbacks callbacks =
+ {
+ .find_elf = dwfl_linux_proc_find_elf,
+ .find_debuginfo = dwfl_standard_find_debuginfo,
+ };
+
+int
+main (void)
+{
+ Dwfl *dwfl = dwfl_begin (&callbacks);
+
+ for (int i = 0; i < 5; ++i)
+ {
+ dwfl_report_begin (dwfl);
+ dwfl_report_module (dwfl, "module1", 0, 10);
+ dwfl_report_end (dwfl, NULL, NULL);
+ }
+
+ dwfl_end (dwfl);
+
+ return 0;
+}
diff --git a/elfutils/tests/dwflmodtest.c b/elfutils/tests/dwflmodtest.c
index 7e454e47..94f960fa 100644
--- a/elfutils/tests/dwflmodtest.c
+++ b/elfutils/tests/dwflmodtest.c
@@ -1,5 +1,5 @@
/* Test program for libdwfl basic module tracking, relocation.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -163,14 +163,33 @@ print_func (Dwarf_Die *func, void *arg)
}
static int
+list_module (Dwfl_Module *mod __attribute__ ((unused)),
+ void **userdata __attribute__ ((unused)),
+ const char *name, Dwarf_Addr base,
+ void *arg __attribute__ ((unused)))
+{
+ Dwarf_Addr start;
+ Dwarf_Addr end;
+ const char *file;
+ const char *debug;
+ if (dwfl_module_info (mod, NULL, &start, &end,
+ NULL, NULL, &file, &debug) != name
+ || start != base)
+ abort ();
+ printf ("module: %30s %08" PRIx64 "..%08" PRIx64 " %s %s\n",
+ name, start, end, file, debug);
+ return DWARF_CB_OK;
+}
+
+static int
print_module (Dwfl_Module *mod __attribute__ ((unused)),
void **userdata __attribute__ ((unused)),
const char *name, Dwarf_Addr base,
Dwarf *dw, Dwarf_Addr bias,
void *arg)
{
- printf ("module: %30s %08" PRIx64 " %12p %" PRIx64 " (%s)\n",
- name, base, dw, bias, dwfl_errmsg (-1));
+ printf ("module: %30s %08" PRIx64 " %s %" PRIx64 " (%s)\n",
+ name, base, dw == NULL ? "no" : "DWARF", bias, dwfl_errmsg (-1));
if (dw != NULL && *(const bool *) arg)
{
@@ -252,11 +271,24 @@ main (int argc, char **argv)
ptrdiff_t p = 0;
do
+ p = dwfl_getmodules (dwfl, &list_module, NULL, p);
+ while (p > 0);
+ if (p < 0)
+ error (2, 0, "dwfl_getmodules: %s", dwfl_errmsg (-1));
+
+ do
p = dwfl_getdwarf (dwfl, &print_module, &show_functions, p);
while (p > 0);
if (p < 0)
error (2, 0, "dwfl_getdwarf: %s", dwfl_errmsg (-1));
+ p = 0;
+ do
+ p = dwfl_getmodules (dwfl, &list_module, NULL, p);
+ while (p > 0);
+ if (p < 0)
+ error (2, 0, "dwfl_getmodules: %s", dwfl_errmsg (-1));
+
dwfl_end (dwfl);
return 0;
diff --git a/elfutils/tests/get-files.c b/elfutils/tests/get-files.c
index 69dd77ee..81daea27 100644
--- a/elfutils/tests/get-files.c
+++ b/elfutils/tests/get-files.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004, 2005 Red Hat, Inc.
+/* Copyright (C) 2002, 2004, 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -84,6 +84,22 @@ main (int argc, char *argv[])
break;
}
+ const char *const *dirs;
+ size_t ndirs;
+ if (dwarf_getsrcdirs (files, &dirs, &ndirs) != 0)
+ {
+ printf ("%s: cannot get include directories\n", argv[cnt]);
+ result = 1;
+ break;
+ }
+
+ if (dirs[0] == NULL)
+ puts (" dirs[0] = (null)");
+ else
+ printf (" dirs[0] = \"%s\"\n", dirs[0]);
+ for (size_t i = 1; i < ndirs; ++i)
+ printf (" dirs[%zu] = \"%s\"\n", i, dirs[i]);
+
for (size_t i = 0; i < nfiles; ++i)
printf (" file[%zu] = \"%s\"\n", i,
dwarf_filesrc (files, i, NULL, NULL));
diff --git a/elfutils/tests/run-addrname-test.sh b/elfutils/tests/run-addrname-test.sh
index 6469646c..ce47fe10 100755
--- a/elfutils/tests/run-addrname-test.sh
+++ b/elfutils/tests/run-addrname-test.sh
@@ -25,7 +25,7 @@
. $srcdir/test-subr.sh
-testfiles testfile34
+testfiles testfile34 testfile38 testfile41
testrun_compare ../src/addr2line -f -e testfile34 \
0x08048074 0x08048075 0x08048076 \
@@ -44,4 +44,22 @@ _end
??:0
EOF
+testrun_compare ../src/addr2line -S -e testfile38 0x02 0x10a 0x211 0x31a <<\EOF
+t1_global_outer+0x2
+??:0
+t2_global_symbol+0x2
+??:0
+t3_global_after_0+0x1
+??:0
+(.text)+0x31a
+??:0
+EOF
+
+testrun_compare ../src/addr2line -S -e testfile41 0x1 0x104 <<\EOF
+small_global_at_large_global+0x1
+??:0
+small_global_first_at_large_global+0x1
+??:0
+EOF
+
exit 0
diff --git a/elfutils/tests/run-allregs.sh b/elfutils/tests/run-allregs.sh
index 46503f20..82d57409 100755
--- a/elfutils/tests/run-allregs.sh
+++ b/elfutils/tests/run-allregs.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2006 Red Hat, Inc.
+# Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
# This file is part of Red Hat elfutils.
#
# Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -48,8 +48,8 @@ integer registers:
9: %eflags (eflags), unsigned 32 bits
10: %trapno (trapno), unsigned 32 bits
FPU-control registers:
- 37: %fctrl (fctrl), unsigned 32 bits
- 38: %fstat (fstat), unsigned 32 bits
+ 37: %fctrl (fctrl), unsigned 16 bits
+ 38: %fstat (fstat), unsigned 16 bits
39: %mxcsr (mxcsr), unsigned 32 bits
MMX registers:
29: %mm0 (mm0), unsigned 64 bits
@@ -106,6 +106,7 @@ integer registers:
14: %r14 (r14), signed 64 bits
15: %r15 (r15), signed 64 bits
16: %rip (rip), address 64 bits
+ 49: %rflags (rflags), unsigned 64 bits
MMX registers:
41: %mm0 (mm0), unsigned 64 bits
42: %mm1 (mm1), unsigned 64 bits
@@ -132,6 +133,21 @@ SSE registers:
30: %xmm13 (xmm13), unsigned 128 bits
31: %xmm14 (xmm14), unsigned 128 bits
32: %xmm15 (xmm15), unsigned 128 bits
+control registers:
+ 62: %tr (tr), unsigned 64 bits
+ 63: %ldtr (ldtr), unsigned 64 bits
+ 64: %mxcsr (mxcsr), unsigned 64 bits
+ 65: %fcw (fcw), unsigned 16 bits
+ 66: %fsw (fsw), unsigned 16 bits
+segment registers:
+ 50: %es (es), unsigned 16 bits
+ 51: %cs (cs), unsigned 16 bits
+ 52: %ss (ss), unsigned 16 bits
+ 53: %ds (ds), unsigned 16 bits
+ 54: %fs (fs), unsigned 16 bits
+ 55: %gs (gs), unsigned 16 bits
+ 58: %fs.base (fs.base), address 64 bits
+ 59: %gs.base (gs.base), address 64 bits
x87 registers:
33: %st0 (st0), float 80 bits
34: %st1 (st1), float 80 bits
@@ -180,38 +196,38 @@ integer registers:
64: cr (cr), unsigned 32 bits
66: msr (msr), unsigned 32 bits
FPU registers:
- 32: f0 (f0), float 32 bits
- 33: f1 (f1), float 32 bits
- 34: f2 (f2), float 32 bits
- 35: f3 (f3), float 32 bits
- 36: f4 (f4), float 32 bits
- 37: f5 (f5), float 32 bits
- 38: f6 (f6), float 32 bits
- 39: f7 (f7), float 32 bits
- 40: f8 (f8), float 32 bits
- 41: f9 (f9), float 32 bits
- 42: f10 (f10), float 32 bits
- 43: f11 (f11), float 32 bits
- 44: f12 (f12), float 32 bits
- 45: f13 (f13), float 32 bits
- 46: f14 (f14), float 32 bits
- 47: f15 (f15), float 32 bits
- 48: f16 (f16), float 32 bits
- 49: f17 (f17), float 32 bits
- 50: f18 (f18), float 32 bits
- 51: f19 (f19), float 32 bits
- 52: f20 (f20), float 32 bits
- 53: f21 (f21), float 32 bits
- 54: f22 (f22), float 32 bits
- 55: f23 (f23), float 32 bits
- 56: f24 (f24), float 32 bits
- 57: f25 (f25), float 32 bits
- 58: f26 (f26), float 32 bits
- 59: f27 (f27), float 32 bits
- 60: f28 (f28), float 32 bits
- 61: f29 (f29), float 32 bits
- 62: f30 (f30), float 32 bits
- 63: f31 (f31), float 32 bits
+ 32: f0 (f0), float 64 bits
+ 33: f1 (f1), float 64 bits
+ 34: f2 (f2), float 64 bits
+ 35: f3 (f3), float 64 bits
+ 36: f4 (f4), float 64 bits
+ 37: f5 (f5), float 64 bits
+ 38: f6 (f6), float 64 bits
+ 39: f7 (f7), float 64 bits
+ 40: f8 (f8), float 64 bits
+ 41: f9 (f9), float 64 bits
+ 42: f10 (f10), float 64 bits
+ 43: f11 (f11), float 64 bits
+ 44: f12 (f12), float 64 bits
+ 45: f13 (f13), float 64 bits
+ 46: f14 (f14), float 64 bits
+ 47: f15 (f15), float 64 bits
+ 48: f16 (f16), float 64 bits
+ 49: f17 (f17), float 64 bits
+ 50: f18 (f18), float 64 bits
+ 51: f19 (f19), float 64 bits
+ 52: f20 (f20), float 64 bits
+ 53: f21 (f21), float 64 bits
+ 54: f22 (f22), float 64 bits
+ 55: f23 (f23), float 64 bits
+ 56: f24 (f24), float 64 bits
+ 57: f25 (f25), float 64 bits
+ 58: f26 (f26), float 64 bits
+ 59: f27 (f27), float 64 bits
+ 60: f28 (f28), float 64 bits
+ 61: f29 (f29), float 64 bits
+ 62: f30 (f30), float 64 bits
+ 63: f31 (f31), float 64 bits
65: fpscr (fpscr), unsigned 32 bits
privileged registers:
70: sr0 (sr0), unsigned 32 bits
@@ -230,16 +246,16 @@ privileged registers:
83: sr13 (sr13), unsigned 32 bits
84: sr14 (sr14), unsigned 32 bits
85: sr15 (sr15), unsigned 32 bits
- 100: spr0 (spr0), unsigned 32 bits
- 101: spr1 (spr1), unsigned 32 bits
+ 100: mq (mq), unsigned 32 bits
+ 101: xer (xer), unsigned 32 bits
102: spr2 (spr2), unsigned 32 bits
103: spr3 (spr3), unsigned 32 bits
104: spr4 (spr4), unsigned 32 bits
105: spr5 (spr5), unsigned 32 bits
106: spr6 (spr6), unsigned 32 bits
107: spr7 (spr7), unsigned 32 bits
- 108: spr8 (spr8), unsigned 32 bits
- 109: spr9 (spr9), unsigned 32 bits
+ 108: lr (lr), unsigned 32 bits
+ 109: ctr (ctr), unsigned 32 bits
110: spr10 (spr10), unsigned 32 bits
111: spr11 (spr11), unsigned 32 bits
112: spr12 (spr12), unsigned 32 bits
@@ -248,11 +264,11 @@ privileged registers:
115: spr15 (spr15), unsigned 32 bits
116: spr16 (spr16), unsigned 32 bits
117: spr17 (spr17), unsigned 32 bits
- 118: spr18 (spr18), unsigned 32 bits
- 119: spr19 (spr19), unsigned 32 bits
+ 118: dsisr (dsisr), unsigned 32 bits
+ 119: dar (dar), unsigned 32 bits
120: spr20 (spr20), unsigned 32 bits
121: spr21 (spr21), unsigned 32 bits
- 122: spr22 (spr22), unsigned 32 bits
+ 122: dec (dec), unsigned 32 bits
123: spr23 (spr23), unsigned 32 bits
124: spr24 (spr24), unsigned 32 bits
125: spr25 (spr25), unsigned 32 bits
@@ -486,7 +502,6 @@ privileged registers:
353: spr253 (spr253), unsigned 32 bits
354: spr254 (spr254), unsigned 32 bits
355: spr255 (spr255), unsigned 32 bits
- 356: spr256 (spr256), unsigned 32 bits
357: spr257 (spr257), unsigned 32 bits
358: spr258 (spr258), unsigned 32 bits
359: spr259 (spr259), unsigned 32 bits
@@ -1131,6 +1146,8 @@ privileged registers:
998: spr898 (spr898), unsigned 32 bits
999: spr899 (spr899), unsigned 32 bits
vector registers:
+ 67: vscr (vscr), unsigned 32 bits
+ 356: vrsave (vrsave), unsigned 32 bits
1124: vr0 (vr0), unsigned 128 bits
1125: vr1 (vr1), unsigned 128 bits
1126: vr2 (vr2), unsigned 128 bits
@@ -1253,15 +1270,15 @@ privileged registers:
84: sr14 (sr14), unsigned 64 bits
85: sr15 (sr15), unsigned 64 bits
100: spr0 (spr0), unsigned 64 bits
- 101: spr1 (spr1), unsigned 64 bits
+ 101: xer (xer), unsigned 64 bits
102: spr2 (spr2), unsigned 64 bits
103: spr3 (spr3), unsigned 64 bits
104: spr4 (spr4), unsigned 64 bits
105: spr5 (spr5), unsigned 64 bits
106: spr6 (spr6), unsigned 64 bits
107: spr7 (spr7), unsigned 64 bits
- 108: spr8 (spr8), unsigned 64 bits
- 109: spr9 (spr9), unsigned 64 bits
+ 108: lr (lr), unsigned 64 bits
+ 109: ctr (ctr), unsigned 64 bits
110: spr10 (spr10), unsigned 64 bits
111: spr11 (spr11), unsigned 64 bits
112: spr12 (spr12), unsigned 64 bits
@@ -1270,11 +1287,11 @@ privileged registers:
115: spr15 (spr15), unsigned 64 bits
116: spr16 (spr16), unsigned 64 bits
117: spr17 (spr17), unsigned 64 bits
- 118: spr18 (spr18), unsigned 64 bits
- 119: spr19 (spr19), unsigned 64 bits
+ 118: dsisr (dsisr), unsigned 64 bits
+ 119: dar (dar), unsigned 64 bits
120: spr20 (spr20), unsigned 64 bits
121: spr21 (spr21), unsigned 64 bits
- 122: spr22 (spr22), unsigned 64 bits
+ 122: dec (dec), unsigned 64 bits
123: spr23 (spr23), unsigned 64 bits
124: spr24 (spr24), unsigned 64 bits
125: spr25 (spr25), unsigned 64 bits
@@ -1508,7 +1525,6 @@ privileged registers:
353: spr253 (spr253), unsigned 64 bits
354: spr254 (spr254), unsigned 64 bits
355: spr255 (spr255), unsigned 64 bits
- 356: spr256 (spr256), unsigned 64 bits
357: spr257 (spr257), unsigned 64 bits
358: spr258 (spr258), unsigned 64 bits
359: spr259 (spr259), unsigned 64 bits
@@ -2153,6 +2169,8 @@ privileged registers:
998: spr898 (spr898), unsigned 64 bits
999: spr899 (spr899), unsigned 64 bits
vector registers:
+ 67: vscr (vscr), unsigned 32 bits
+ 356: vrsave (vrsave), unsigned 32 bits
1124: vr0 (vr0), unsigned 128 bits
1125: vr1 (vr1), unsigned 128 bits
1126: vr2 (vr2), unsigned 128 bits
@@ -2503,4 +2521,75 @@ control registers:
85: %y (y), unsigned 64 bits
EOF
+regs_test testfile10 <<\EOF
+integer registers:
+ 0: $v0 (v0), signed 64 bits
+ 1: $t0 (t0), signed 64 bits
+ 2: $t1 (t1), signed 64 bits
+ 3: $t2 (t2), signed 64 bits
+ 4: $t3 (t3), signed 64 bits
+ 5: $t4 (t4), signed 64 bits
+ 6: $t5 (t5), signed 64 bits
+ 7: $t6 (t6), signed 64 bits
+ 8: $t7 (t7), signed 64 bits
+ 9: $s0 (s0), signed 64 bits
+ 10: $s1 (s1), signed 64 bits
+ 11: $s2 (s2), signed 64 bits
+ 12: $s3 (s3), signed 64 bits
+ 13: $s4 (s4), signed 64 bits
+ 14: $s5 (s5), signed 64 bits
+ 15: $s6 (s6), signed 64 bits
+ 16: $a0 (a0), signed 64 bits
+ 17: $a1 (a1), signed 64 bits
+ 18: $a2 (a2), signed 64 bits
+ 19: $a3 (a3), signed 64 bits
+ 20: $a4 (a4), signed 64 bits
+ 21: $a5 (a5), signed 64 bits
+ 22: $t8 (t8), signed 64 bits
+ 23: $t9 (t9), signed 64 bits
+ 24: $t10 (t10), signed 64 bits
+ 25: $t11 (t11), signed 64 bits
+ 26: $ra (ra), address 64 bits
+ 27: $t12 (t12), signed 64 bits
+ 28: $at (at), signed 64 bits
+ 29: $gp (gp), address 64 bits
+ 30: $sp (sp), address 64 bits
+ 31: $zero (zero), signed 64 bits
+ 64: $pc (pc), address 64 bits
+ 66: $unique (unique), address 64 bits
+FPU registers:
+ 32: $f0 (f0), float 64 bits
+ 33: $f1 (f1), float 64 bits
+ 34: $f2 (f2), float 64 bits
+ 35: $f3 (f3), float 64 bits
+ 36: $f4 (f4), float 64 bits
+ 37: $f5 (f5), float 64 bits
+ 38: $f6 (f6), float 64 bits
+ 39: $f7 (f7), float 64 bits
+ 40: $f8 (f8), float 64 bits
+ 41: $f9 (f9), float 64 bits
+ 42: $f10 (f10), float 64 bits
+ 43: $f11 (f11), float 64 bits
+ 44: $f12 (f12), float 64 bits
+ 45: $f13 (f13), float 64 bits
+ 46: $f14 (f14), float 64 bits
+ 47: $f15 (f15), float 64 bits
+ 48: $f16 (f16), float 64 bits
+ 49: $f17 (f17), float 64 bits
+ 50: $f18 (f18), float 64 bits
+ 51: $f19 (f19), float 64 bits
+ 52: $f20 (f20), float 64 bits
+ 53: $f21 (f21), float 64 bits
+ 54: $f22 (f22), float 64 bits
+ 55: $f23 (f23), float 64 bits
+ 56: $f24 (f24), float 64 bits
+ 57: $f25 (f25), float 64 bits
+ 58: $f26 (f26), float 64 bits
+ 59: $f27 (f27), float 64 bits
+ 60: $f28 (f28), float 64 bits
+ 61: $f29 (f29), float 64 bits
+ 62: $f30 (f30), float 64 bits
+ 63: $fpcr (fpcr), unsigned 64 bits
+EOF
+
exit 0
diff --git a/elfutils/tests/run-dwfl-addr-sect.sh b/elfutils/tests/run-dwfl-addr-sect.sh
new file mode 100755
index 00000000..69280f58
--- /dev/null
+++ b/elfutils/tests/run-dwfl-addr-sect.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile43
+
+export LC_ALL=C
+testrun_compare ./dwfl-addr-sect -e testfile43 0x64 0x8 0x98 <<\EOF
+address 0x64 => module "" section 4 + 0
+address 0x8 => module "" section 1 + 0x8
+address 0x98 => module "" section 7 + 0
+EOF
+
+exit 0
diff --git a/elfutils/tests/run-dwfl-bug-offline-rel.sh b/elfutils/tests/run-dwfl-bug-offline-rel.sh
new file mode 100755
index 00000000..d1f6149a
--- /dev/null
+++ b/elfutils/tests/run-dwfl-bug-offline-rel.sh
@@ -0,0 +1,36 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile36 testfile36.debug
+
+testrun_compare ./dwflmodtest -e testfile36 <<\EOF
+module: 00000000..00002308 testfile36 (null)
+module: 00000000 DWARF 0 (no error)
+module: 00000000..00002308 testfile36 testfile36.debug
+EOF
+
+exit 0
diff --git a/elfutils/tests/run-elflint-self.sh b/elfutils/tests/run-elflint-self.sh
index 7f7c01e0..7da0886a 100755
--- a/elfutils/tests/run-elflint-self.sh
+++ b/elfutils/tests/run-elflint-self.sh
@@ -26,12 +26,13 @@
. $srcdir/test-subr.sh
+status=0
runtest() {
# Uncomment for debuging
# echo $1
if [ -f $1 ]; then
testrun ../src/elflint --quiet --gnu-ld $1 ||
- (echo "*** failure in $1"; exit 1)
+ { echo "*** failure in $1"; status=1; }
fi
}
@@ -57,3 +58,5 @@ runtest ../libebl/libebl_ppc64.so
runtest ../libebl/libebl_sh.so
runtest ../libebl/libebl_sparc.so
runtest ../libebl/libebl_x86_64.so
+
+exit $status
diff --git a/elfutils/tests/run-elflint-test.sh b/elfutils/tests/run-elflint-test.sh
index 660f1070..a0b93a25 100755
--- a/elfutils/tests/run-elflint-test.sh
+++ b/elfutils/tests/run-elflint-test.sh
@@ -38,4 +38,7 @@ testrun ../src/elflint -q testfile32
testfiles testfile33
testrun ../src/elflint -q testfile33
+testfiles testfile42
+testrun ../src/elflint -q --gnu-ld testfile42
+
exit 0
diff --git a/elfutils/tests/run-get-files.sh b/elfutils/tests/run-get-files.sh
index e301f8d4..7d51f5fc 100755
--- a/elfutils/tests/run-get-files.sh
+++ b/elfutils/tests/run-get-files.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2002, 2004, 2005 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2004, 2005, 2007 Red Hat, Inc.
# This file is part of Red Hat elfutils.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
@@ -30,9 +30,11 @@ testfiles testfile testfile2
testrun_compare ./get-files testfile testfile2 <<\EOF
cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 191
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
file[0] = "???"
file[1] = "/home/drepper/gnu/new-bu/build/ttt/m.c"
cuhl = 11, o = 114, asz = 4, osz = 4, ncu = 5617
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
file[0] = "???"
file[1] = "/home/drepper/gnu/new-bu/build/ttt/b.c"
file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h"
@@ -46,9 +48,11 @@ cuhl = 11, o = 114, asz = 4, osz = 4, ncu = 5617
file[10] = "/usr/include/_G_config.h"
file[11] = "/usr/include/gconv.h"
cuhl = 11, o = 412, asz = 4, osz = 4, ncu = 5752
+ dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
file[0] = "???"
file[1] = "/home/drepper/gnu/new-bu/build/ttt/f.c"
cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 2418
+ dirs[0] = "/shoggoth/drepper"
file[0] = "???"
file[1] = "/shoggoth/drepper/b.c"
file[2] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stddef.h"
@@ -59,9 +63,11 @@ cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 2418
file[7] = "/usr/include/libio.h"
file[8] = "/usr/include/_G_config.h"
cuhl = 11, o = 213, asz = 4, osz = 4, ncu = 2521
+ dirs[0] = "/shoggoth/drepper"
file[0] = "???"
file[1] = "/shoggoth/drepper/f.c"
cuhl = 11, o = 267, asz = 4, osz = 4, ncu = 2680
+ dirs[0] = "/shoggoth/drepper"
file[0] = "???"
file[1] = "/shoggoth/drepper/m.c"
EOF
diff --git a/elfutils/tests/run-readelf-test2.sh b/elfutils/tests/run-readelf-test2.sh
new file mode 100755
index 00000000..4edaea6c
--- /dev/null
+++ b/elfutils/tests/run-readelf-test2.sh
@@ -0,0 +1,36 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile28
+
+testrun_compare ../src/readelf -x .strtab testfile28 <<\EOF
+
+Hex dump of section [6] '.strtab', 1 bytes at offset 0x290:
+ 0x00000000 00 .
+EOF
+
+exit 0
diff --git a/elfutils/tests/run-readelf-test3.sh b/elfutils/tests/run-readelf-test3.sh
new file mode 100755
index 00000000..71dd8aea
--- /dev/null
+++ b/elfutils/tests/run-readelf-test3.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile40.debug
+
+testrun_compare ../src/readelf -n testfile40.debug <<\EOF
+
+Note section [ 6] '.note' of 60 bytes at offset 0x120:
+ Owner Data size Type
+ GNU 20 GNU_BUILD_ID
+ Build ID: 34072edcd87ef6728f4b4a7956167b2fcfc3f1d3
+ Linux 4 <unknown>: 0
+EOF
+
+exit 0
diff --git a/elfutils/tests/run-readelf-test4.sh b/elfutils/tests/run-readelf-test4.sh
new file mode 100755
index 00000000..85e76ed0
--- /dev/null
+++ b/elfutils/tests/run-readelf-test4.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile19.index
+
+testrun_compare ../src/readelf -c testfile19.index <<\EOF
+
+Index of archive 'testfile19.index' has 4 entries:
+Archive member 'u1.o' contains:
+ a
+Archive member 'u2.o' contains:
+ aa
+Archive member 'u3.o' contains:
+ a
+EOF
+
+exit 0
diff --git a/elfutils/tests/run-strip-test.sh b/elfutils/tests/run-strip-test.sh
index 656e449b..480101eb 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, 2005 Red Hat, Inc.
+# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007 Red Hat, Inc.
# This file is part of Red Hat elfutils.
# Written by Ulrich Drepper <drepper@redhat.com>, 1999.
#
@@ -32,20 +32,28 @@ debugout=${debugfile:+-f testfile.debug.temp -F $debugfile}
testfiles $original $stripped $debugfile
-tempfiles testfile.temp testfile.debug.temp
+tempfiles testfile.temp testfile.debug.temp testfile.unstrip
testrun ../src/strip -o testfile.temp $debugout $original
-cmp $stripped testfile.temp
+status=0
+
+cmp $stripped testfile.temp || status=$?
# Check elflint and the expected result.
-testrun ../src/elflint -q testfile.temp
+testrun ../src/elflint -q testfile.temp || status=$?
test -z "$debugfile" || {
-cmp $debugfile testfile.debug.temp
+cmp $debugfile testfile.debug.temp || status=$?
# Check elflint and the expected result.
-testrun ../src/elflint -q -d testfile.debug.temp
+testrun ../src/elflint -q -d testfile.debug.temp || status=$?
+
+# Now test unstrip recombining those files.
+testrun ../src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp
+
+# Check that it came back whole.
+testrun ../src/elfcmp --hash-inexact $original testfile.unstrip
}
-exit 0
+exit $status
diff --git a/elfutils/tests/run-strip-test4.sh b/elfutils/tests/run-strip-test4.sh
index 8e9be228..64924a92 100755
--- a/elfutils/tests/run-strip-test4.sh
+++ b/elfutils/tests/run-strip-test4.sh
@@ -1,5 +1,5 @@
original=testfile11
-stripped=testfile15
-debugfile=testfile15.debug
+stripped=testfile37
+debugfile=testfile37.debug
. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test6.sh b/elfutils/tests/run-strip-test6.sh
index 8ee5f02c..c59bf5e4 100755
--- a/elfutils/tests/run-strip-test6.sh
+++ b/elfutils/tests/run-strip-test6.sh
@@ -1,5 +1,5 @@
original=testfile12
-stripped=testfile17
-debugfile=testfile17.debug
+stripped=testfile35
+debugfile=testfile35.debug
. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-strip-test7.sh b/elfutils/tests/run-strip-test7.sh
new file mode 100755
index 00000000..c65cd050
--- /dev/null
+++ b/elfutils/tests/run-strip-test7.sh
@@ -0,0 +1,5 @@
+original=testfile39
+stripped=testfile40
+debugfile=testfile40.debug
+
+. $srcdir/run-strip-test.sh
diff --git a/elfutils/tests/run-unstrip-test.sh b/elfutils/tests/run-unstrip-test.sh
new file mode 100755
index 00000000..8f0fc698
--- /dev/null
+++ b/elfutils/tests/run-unstrip-test.sh
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 2007 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils 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; version 2 of the License.
+#
+# Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+original=${original:-testfile12}
+stripped=${stripped:-testfile17}
+debugfile=${debugfile:-${stripped}.debug}
+
+testfiles $original $stripped $debugfile
+tempfiles testfile.unstrip
+
+# These are old reference output from run-test-strip6.sh, when
+# strip left the .debug file with unchanged sh_size in
+# stripped sections that shrank in the stripped file. strip
+# no longer does that, but unstrip must still handle it.
+
+testrun ../src/unstrip -o testfile.unstrip $stripped $debugfile
+
+testrun ../src/elfcmp --hash-inexact $original testfile.unstrip
diff --git a/elfutils/tests/run-unstrip-test2.sh b/elfutils/tests/run-unstrip-test2.sh
new file mode 100755
index 00000000..44074c19
--- /dev/null
+++ b/elfutils/tests/run-unstrip-test2.sh
@@ -0,0 +1,5 @@
+original=testfile11
+stripped=testfile15
+debugfile=testfile15.debug
+
+. $srcdir/run-unstrip-test.sh
diff --git a/elfutils/tests/test-subr.sh b/elfutils/tests/test-subr.sh
index d92c602e..7fda05a0 100644
--- a/elfutils/tests/test-subr.sh
+++ b/elfutils/tests/test-subr.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
+# Copyright (C) 2005, 2007 Red Hat, Inc.
# This file is part of Red Hat elfutils.
#
# Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -58,7 +58,7 @@ testrun_compare()
{
outfile="${1##*/}.out"
testrun_out $outfile "$@"
- diff -Bbu $outfile -
+ diff -u $outfile -
# diff's exit status will kill the script.
}
diff --git a/elfutils/tests/testfile35.bz2 b/elfutils/tests/testfile35.bz2
new file mode 100644
index 00000000..b5913015
--- /dev/null
+++ b/elfutils/tests/testfile35.bz2
Binary files differ
diff --git a/elfutils/tests/testfile35.debug.bz2 b/elfutils/tests/testfile35.debug.bz2
new file mode 100644
index 00000000..f1918627
--- /dev/null
+++ b/elfutils/tests/testfile35.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile36.bz2 b/elfutils/tests/testfile36.bz2
new file mode 100644
index 00000000..e912a197
--- /dev/null
+++ b/elfutils/tests/testfile36.bz2
Binary files differ
diff --git a/elfutils/tests/testfile36.debug.bz2 b/elfutils/tests/testfile36.debug.bz2
new file mode 100644
index 00000000..76aca42e
--- /dev/null
+++ b/elfutils/tests/testfile36.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile37.bz2 b/elfutils/tests/testfile37.bz2
new file mode 100644
index 00000000..254ce324
--- /dev/null
+++ b/elfutils/tests/testfile37.bz2
Binary files differ
diff --git a/elfutils/tests/testfile37.debug.bz2 b/elfutils/tests/testfile37.debug.bz2
new file mode 100644
index 00000000..74e46a87
--- /dev/null
+++ b/elfutils/tests/testfile37.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile38.bz2 b/elfutils/tests/testfile38.bz2
new file mode 100644
index 00000000..42adb774
--- /dev/null
+++ b/elfutils/tests/testfile38.bz2
Binary files differ
diff --git a/elfutils/tests/testfile39.bz2 b/elfutils/tests/testfile39.bz2
new file mode 100644
index 00000000..42d0fbce
--- /dev/null
+++ b/elfutils/tests/testfile39.bz2
Binary files differ
diff --git a/elfutils/tests/testfile40.bz2 b/elfutils/tests/testfile40.bz2
new file mode 100644
index 00000000..ad41985c
--- /dev/null
+++ b/elfutils/tests/testfile40.bz2
Binary files differ
diff --git a/elfutils/tests/testfile40.debug.bz2 b/elfutils/tests/testfile40.debug.bz2
new file mode 100644
index 00000000..2eec4d7a
--- /dev/null
+++ b/elfutils/tests/testfile40.debug.bz2
Binary files differ
diff --git a/elfutils/tests/testfile41.bz2 b/elfutils/tests/testfile41.bz2
new file mode 100644
index 00000000..f9bf5a48
--- /dev/null
+++ b/elfutils/tests/testfile41.bz2
Binary files differ
diff --git a/elfutils/tests/testfile42.bz2 b/elfutils/tests/testfile42.bz2
new file mode 100644
index 00000000..2530aba2
--- /dev/null
+++ b/elfutils/tests/testfile42.bz2
Binary files differ
diff --git a/elfutils/tests/testfile43.bz2 b/elfutils/tests/testfile43.bz2
new file mode 100644
index 00000000..c99db24a
--- /dev/null
+++ b/elfutils/tests/testfile43.bz2
Binary files differ