aboutsummaryrefslogtreecommitdiffstats
path: root/libasm
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2012-03-07 23:04:02 -0800
committerBen Cheng <bccheng@google.com>2012-03-08 17:00:54 -0800
commitcc6695e2684ce93cdf8bd2da63d55d2cf49ff076 (patch)
tree58f9941f89a1bde4e068610a507f86c6cb02eadf /libasm
parent669e96ff41a1b72aa034a26563d90b4768d51482 (diff)
downloadplatform_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.tar.gz
platform_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.tar.bz2
platform_external_elfutils-cc6695e2684ce93cdf8bd2da63d55d2cf49ff076.zip
Upgrade elfutils from version 0.97 to 0.138
This upgrade is in preparation for adding perf to the Android tree, where perf needs newer version of elfutils. This particular snapshot also cleans up the current makefile where only the host version of libelf.a (needed by elftree). Additional build targets for libebl.a, libebl_arm.a, and libebl_sh.a are eliminated since they are not used in the tree at all. Changes that build other target modules and associated modifications to work with bionic will be added later. Change-Id: Ifa808ba5ad2881ccb2c0cf44d134931faad801e1
Diffstat (limited to 'libasm')
-rw-r--r--libasm/ChangeLog91
-rw-r--r--libasm/Makefile593
-rw-r--r--libasm/Makefile.am69
-rw-r--r--libasm/Makefile.in224
-rw-r--r--libasm/asm_abort.c33
-rw-r--r--libasm/asm_addint16.c28
-rw-r--r--libasm/asm_addint32.c28
-rw-r--r--libasm/asm_addint64.c28
-rw-r--r--libasm/asm_addint8.c49
-rw-r--r--libasm/asm_addsleb128.c32
-rw-r--r--libasm/asm_addstrz.c30
-rw-r--r--libasm/asm_adduint16.c28
-rw-r--r--libasm/asm_adduint32.c28
-rw-r--r--libasm/asm_adduint64.c28
-rw-r--r--libasm/asm_adduint8.c30
-rw-r--r--libasm/asm_adduleb128.c32
-rw-r--r--libasm/asm_align.c57
-rw-r--r--libasm/asm_begin.c114
-rw-r--r--libasm/asm_end.c117
-rw-r--r--libasm/asm_error.c36
-rw-r--r--libasm/asm_fill.c28
-rw-r--r--libasm/asm_getelf.c28
-rw-r--r--libasm/asm_newabssym.c30
-rw-r--r--libasm/asm_newcomsym.c30
-rw-r--r--libasm/asm_newscn.c33
-rw-r--r--libasm/asm_newscn_ingrp.c32
-rw-r--r--libasm/asm_newscngrp.c30
-rw-r--r--libasm/asm_newsubscn.c30
-rw-r--r--libasm/asm_newsym.c53
-rw-r--r--libasm/asm_scngrp_newsignature.c30
-rw-r--r--libasm/disasm_begin.c61
-rw-r--r--libasm/disasm_cb.c176
-rw-r--r--libasm/disasm_end.c42
-rw-r--r--libasm/disasm_str.c69
-rw-r--r--libasm/libasm.h72
-rw-r--r--libasm/libasm.map5
-rw-r--r--libasm/libasmP.h60
-rw-r--r--libasm/symbolhash.c30
-rw-r--r--libasm/symbolhash.h28
39 files changed, 1444 insertions, 1098 deletions
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index 630696d7..c98deb64 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,92 @@
+2008-12-03 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am [USE_TLS]: Like libasm.so with libpthread.
+
+2008-01-11 Ulrich Drepper <drepper@redhat.com>
+
+ * libasm.h (DisasmGetSymCB_t): Change type of fourth and fifth
+ parameter.
+ * disasm_cb.c: Adjust accordingly.
+
+2008-01-08 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (euinclude): Variable removed.
+ (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
+
+2007-12-20 Ulrich Drepper <drepper@redhat.com>
+
+ * disasm_cb.c: Add initial support to resolve addresses to symbols.
+
+2007-02-05 Ulrich Drepper <drepper@redhat.com>
+
+ * disasm_begin.c: New file.
+ * disasm_cb.c: New file.
+ * disasm_end.c: New file.
+ * disasm_str.c: New file.
+
+2006-08-29 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (CLEANFILES): Add libasm.so.$(VERSION).
+
+2005-11-13 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (INCLUDES): Search in libdw.
+
+2005-09-02 Ulrich Drepper <drepper@redhat.com>
+
+ * asm_error.c (asm_errmsg): Unify error message.
+
+2005-08-28 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am: Use $(LINK) not $(CC) when creating DSO.
+ (%.os): Use COMPILE.os.
+ (COMPILE.os): Filter out gconv options.
+
+2005-08-02 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am (AM_CFLAGS): Add -std=gnu99.
+ * asm_abort.c: Don't try to remove output file if there is none.
+ * asm_addint8.c: In print mode, print to file not stdout.
+ * asm_addsleb128.c: Likewise.
+ * asm_adduleb128.c: Likewise.
+ * asm_newscn.c: Likewise.
+ * asm_align.c: Implement print mode.
+ * asm_begin.c (asm_begin): Change interface. Take binary class and
+ byte order information from new Ebl parameter.
+ * libasm.h: Adjust prototype.
+ * asm_end.c (text_end): Close file if necesary.
+ * asm_error.c: Add new error ASM_E_IOERROR.
+ * libasmP.h: Add ASM_E_IOERROR definition.
+
+2005-02-15 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+
+ * asm_end.c (text_end): Mark parameter as possibly unused.
+
+2005-02-06 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am: Remove lint handling.
+
+2005-02-05 Ulrich Drepper <drepper@redhat.com>
+
+ * asm_end.c (binary_end): Don't terminate with error() in case
+ something goes wrong.
+
+ * Makefile.am: Check for text relocations in constructed DSO.
+
+ * Makefile.am (AM_CFLAGS): More warnings. Add -fmudflap for MUDFLAP.
+
+ * asm_end.c (binary_end): Remove shadowing variables.
+ Little cleanups.
+
+ * asm_newsym.c: Allocate memory for the string parameter.
+
+2005-02-04 Ulrich Drepper <drepper@redhat.com>
+
+ * asm_newscn_ingrp.c (asm_newscn_ingrp): Use INTUSE to reference
+ asm_newscn.
+
2004-09-25 Ulrich Drepper <drepper@redhat.com>
* asm_error.c: Make compile with gcc 4.0.
@@ -20,4 +109,4 @@
2003-08-11 Ulrich Drepper <drepper@redhat.com>
- * Moved to CVS archive.
+ * Moved to CVS archive.
diff --git a/libasm/Makefile b/libasm/Makefile
deleted file mode 100644
index cf50cdbe..00000000
--- a/libasm/Makefile
+++ /dev/null
@@ -1,593 +0,0 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
-# libasm/Makefile. Generated from Makefile.in by configure.
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-
-
-SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) $(libasm_so_SOURCES)
-
-srcdir = .
-top_srcdir = ..
-
-pkgdatadir = $(datadir)/elfutils
-pkglibdir = $(libdir)/elfutils
-pkgincludedir = $(includedir)/elfutils
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = /usr/bin/install -c
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = i686-pc-linux-gnu
-host_triplet = i686-pc-linux-gnu
-noinst_PROGRAMS = $(am__EXEEXT_1)
-#am_libasm_pic_a_OBJECTS =
-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 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"
-libLIBRARIES_INSTALL = $(INSTALL_DATA)
-LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-libasm_a_AR = $(AR) $(ARFLAGS)
-libasm_a_LIBADD =
-am_libasm_a_OBJECTS = asm_begin.$(OBJEXT) asm_abort.$(OBJEXT) \
- asm_end.$(OBJEXT) asm_error.$(OBJEXT) asm_getelf.$(OBJEXT) \
- asm_newscn.$(OBJEXT) asm_newscn_ingrp.$(OBJEXT) \
- asm_newsubscn.$(OBJEXT) asm_newsym.$(OBJEXT) \
- asm_newcomsym.$(OBJEXT) asm_newabssym.$(OBJEXT) \
- asm_newscngrp.$(OBJEXT) asm_scngrp_newsignature.$(OBJEXT) \
- asm_fill.$(OBJEXT) asm_align.$(OBJEXT) asm_addstrz.$(OBJEXT) \
- asm_addint8.$(OBJEXT) asm_adduint8.$(OBJEXT) \
- asm_addint16.$(OBJEXT) asm_adduint16.$(OBJEXT) \
- asm_addint32.$(OBJEXT) asm_adduint32.$(OBJEXT) \
- asm_addint64.$(OBJEXT) asm_adduint64.$(OBJEXT) \
- asm_adduleb128.$(OBJEXT) asm_addsleb128.$(OBJEXT) \
- symbolhash.$(OBJEXT)
-libasm_a_OBJECTS = $(am_libasm_a_OBJECTS)
-libasm_pic_a_AR = $(AR) $(ARFLAGS)
-libasm_pic_a_LIBADD =
-libasm_pic_a_OBJECTS = $(am_libasm_pic_a_OBJECTS)
-am__EXEEXT_1 = libasm.so$(EXEEXT)
-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)
-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 $@
-SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) \
- $(libasm_so_SOURCES)
-DIST_SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) \
- $(libasm_so_SOURCES)
-euincludeHEADERS_INSTALL = $(INSTALL_HEADER)
-HEADERS = $(euinclude_HEADERS) $(noinst_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run aclocal-1.9
-AMDEP_FALSE = #
-AMDEP_TRUE =
-AMTAR = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run tar
-AUTOCONF = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run autoconf
-AUTOHEADER = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run autoheader
-AUTOMAKE = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run automake-1.9
-AWK = gawk
-CC = gcc
-CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O2
-CPP = gcc -E
-CPPFLAGS =
-CYGPATH_W = echo
-DATADIRNAME = ${prefix}/share
-DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-DEPDIR = .deps
-ECHO_C =
-ECHO_N = -n
-ECHO_T =
-EGREP = grep -E
-EXEEXT =
-GMSGFMT = /usr/bin/msgfmt
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-INTLLIBS =
-LDFLAGS =
-LEX = flex
-LEXLIB = -lfl
-LEX_OUTPUT_ROOT = lex.yy
-LIBICONV = -liconv
-LIBINTL =
-LIBOBJS =
-LIBS =
-LOCALEDIR = ${prefix}/share
-LTLIBICONV = -liconv
-LTLIBINTL =
-LTLIBOBJS =
-MAKEINFO = ${SHELL} /work/elfutils/stock/elfutils-0.97/config/missing --run makeinfo
-MKINSTALLDIRS = config/mkinstalldirs
-MSGFMT = /usr/bin/msgfmt
-MSGMERGE = /usr/bin/msgmerge
-MUDFLAP_FALSE =
-MUDFLAP_TRUE = #
-NATIVE_LD_FALSE =
-NATIVE_LD_TRUE = #
-OBJEXT = o
-PACKAGE = elfutils
-PACKAGE_BUGREPORT = http://bugzilla.redhat.com/bugzilla/
-PACKAGE_NAME = Red Hat elfutils
-PACKAGE_STRING = Red Hat elfutils 0.97
-PACKAGE_TARNAME = elfutils
-PACKAGE_VERSION = 0.97
-PATH_SEPARATOR = :
-POSUB = po
-RANLIB = ranlib
-SET_MAKE =
-SHELL = /bin/sh
-STRIP =
-USE_NLS = yes
-VERSION = 1
-XGETTEXT = /usr/bin/xgettext
-YACC = bison -y
-ac_ct_CC = gcc
-ac_ct_RANLIB = ranlib
-ac_ct_STRIP =
-am__fastdepCC_FALSE = #
-am__fastdepCC_TRUE =
-am__include = include
-am__leading_dot = .
-am__quote =
-am__tar = ${AMTAR} chof - "$$tardir"
-am__untar = ${AMTAR} xf -
-base_cpu = none
-bindir = ${exec_prefix}/bin
-build = i686-pc-linux-gnu
-build_alias =
-build_cpu = i686
-build_os = linux-gnu
-build_vendor = pc
-datadir = ${prefix}/share
-exec_prefix = ${prefix}
-host = i686-pc-linux-gnu
-host_alias =
-host_cpu = i686
-host_os = linux-gnu
-host_vendor = pc
-includedir = ${prefix}/include
-infodir = ${prefix}/info
-install_sh = /work/elfutils/stock/elfutils-0.97/config/install-sh
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-localstatedir = ${prefix}/var
-mandir = ${prefix}/man
-mkdir_p = mkdir -p --
-oldincludedir = /usr/include
-prefix = /work/elfutils/google/linux-install-elfutils-0.97/
-program_transform_name = s,x,x,
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-sysconfdir = ${prefix}/etc
-target_alias =
-AM_CFLAGS = -Wall -Werror
-#AM_CFLAGS = -Wall
-INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
- -I$(top_srcdir)/lib
-
-GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
-LINT = splint
-lib_LIBRARIES = libasm.a
-noinst_LIBRARIES = libasm_pic.a
-euincludedir = ${includedir}/elfutils
-euinclude_HEADERS = libasm.h
-libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
- asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
- asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
- asm_newabssym.c \
- asm_newscngrp.c asm_scngrp_newsignature.c \
- asm_fill.c asm_align.c asm_addstrz.c \
- asm_addint8.c asm_adduint8.c \
- asm_addint16.c asm_adduint16.c \
- asm_addint32.c asm_adduint32.c \
- asm_addint64.c asm_adduint64.c \
- asm_adduleb128.c asm_addsleb128.c \
- symbolhash.c
-
-libasm_pic_a_SOURCES =
-am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
-libasm_so_SOURCES =
-noinst_HEADERS = libasmP.h symbolhash.h
-EXTRA_DIST = libasm.map
-CLEANFILES = $(am_libasm_pic_a_OBJECTS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits libasm/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnits libasm/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libLIBRARIES: $(lib_LIBRARIES)
- @$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
- @list='$(lib_LIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
- else :; fi; \
- done
- @$(POST_INSTALL)
- @list='$(lib_LIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- p=$(am__strip_dir) \
- echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
- $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
- else :; fi; \
- done
-
-uninstall-libLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- rm -f "$(DESTDIR)$(libdir)/$$p"; \
- done
-
-clean-libLIBRARIES:
- -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libasm.a: $(libasm_a_OBJECTS) $(libasm_a_DEPENDENCIES)
- -rm -f libasm.a
- $(libasm_a_AR) libasm.a $(libasm_a_OBJECTS) $(libasm_a_LIBADD)
- $(RANLIB) libasm.a
-libasm_pic.a: $(libasm_pic_a_OBJECTS) $(libasm_pic_a_DEPENDENCIES)
- -rm -f libasm_pic.a
- $(libasm_pic_a_AR) libasm_pic.a $(libasm_pic_a_OBJECTS) $(libasm_pic_a_LIBADD)
- $(RANLIB) libasm_pic.a
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-#libasm.so$(EXEEXT): $(libasm_so_OBJECTS) $(libasm_so_DEPENDENCIES)
-# @rm -f libasm.so$(EXEEXT)
-# $(LINK) $(libasm_so_LDFLAGS) $(libasm_so_OBJECTS) $(libasm_so_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-include ./$(DEPDIR)/asm_abort.Po
-include ./$(DEPDIR)/asm_addint16.Po
-include ./$(DEPDIR)/asm_addint32.Po
-include ./$(DEPDIR)/asm_addint64.Po
-include ./$(DEPDIR)/asm_addint8.Po
-include ./$(DEPDIR)/asm_addsleb128.Po
-include ./$(DEPDIR)/asm_addstrz.Po
-include ./$(DEPDIR)/asm_adduint16.Po
-include ./$(DEPDIR)/asm_adduint32.Po
-include ./$(DEPDIR)/asm_adduint64.Po
-include ./$(DEPDIR)/asm_adduint8.Po
-include ./$(DEPDIR)/asm_adduleb128.Po
-include ./$(DEPDIR)/asm_align.Po
-include ./$(DEPDIR)/asm_begin.Po
-include ./$(DEPDIR)/asm_end.Po
-include ./$(DEPDIR)/asm_error.Po
-include ./$(DEPDIR)/asm_fill.Po
-include ./$(DEPDIR)/asm_getelf.Po
-include ./$(DEPDIR)/asm_newabssym.Po
-include ./$(DEPDIR)/asm_newcomsym.Po
-include ./$(DEPDIR)/asm_newscn.Po
-include ./$(DEPDIR)/asm_newscn_ingrp.Po
-include ./$(DEPDIR)/asm_newscngrp.Po
-include ./$(DEPDIR)/asm_newsubscn.Po
-include ./$(DEPDIR)/asm_newsym.Po
-include ./$(DEPDIR)/asm_scngrp_newsignature.Po
-include ./$(DEPDIR)/symbolhash.Po
-
-.c.o:
- if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-# source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(COMPILE) -c $<
-
-.c.obj:
- if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-# source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
-# $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-install-euincludeHEADERS: $(euinclude_HEADERS)
- @$(NORMAL_INSTALL)
- 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) \
- echo " $(euincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(euincludedir)/$$f'"; \
- $(euincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(euincludedir)/$$f"; \
- done
-
-uninstall-euincludeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(euinclude_HEADERS)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(euincludedir)/$$f'"; \
- rm -f "$(DESTDIR)$(euincludedir)/$$f"; \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-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; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-#install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-#uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \
- clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-euincludeHEADERS
-
-install-exec-am: install-libLIBRARIES
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \
- uninstall-libLIBRARIES
-
-.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
-
-libasm.so: libasm_pic.a libasm.map
- $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so
- ln -fs $@ $@.$(VERSION)
-
-%.os: %.c %.o
- if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
- -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
- then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
- rm -f "$(DEPDIR)/$*.Tpo"; \
- else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- fi
-
-install: install-am libasm.so
- $(mkinstalldirs) $(DESTDIR)$(libdir)
- $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
- ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
- ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so
-
-uninstall: uninstall-am
- rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
- rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
- rm -f $(DESTDIR)$(libdir)/libasm.so
- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
-
-.PSEUDO: lint
-lint:
- $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \
- $(addprefix $(srcdir)/,$(libelf_la_SOURCES))
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libasm/Makefile.am b/libasm/Makefile.am
index 9ba304d1..62b5ee29 100644
--- a/libasm/Makefile.am
+++ b/libasm/Makefile.am
@@ -1,38 +1,51 @@
## Process this file with automake to create Makefile.in
-## Configure input file for elfutils.
##
-## Copyright (C) 2002, 2004 Red Hat, Inc.
+## Copyright (C) 2002, 2004, 2005, 2006, 2008 Red Hat, Inc.
+## This file is part of Red Hat elfutils.
##
-## This program is Open Source software; you can redistribute it and/or
-## modify it under the terms of the Open Software License version 1.0 as
-## published by the Open Source Initiative.
+## 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.
##
-## You should have received a copy of the Open Software License along
-## with this program; if not, you may obtain a copy of the Open Software
-## License version 1.0 from http://www.opensource.org/licenses/osl.php or
-## by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
-## 3001 King Ranch Road, Ukiah, CA 95482.
+## 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>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
if MUDFLAP
-AM_CFLAGS = -Wall
+AM_CFLAGS = -fmudflap
else
-AM_CFLAGS = -Wall -Werror
+AM_CFLAGS =
endif
-INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
+INCLUDES = -I. -I$(srcdir) -I.. \
+ -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
-I$(top_srcdir)/lib
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
VERSION = 1
-LINT = splint
+COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
+ $(COMPILE)))
lib_LIBRARIES = libasm.a
if !MUDFLAP
noinst_LIBRARIES = libasm_pic.a
noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
endif
-euincludedir = ${includedir}/elfutils
-euinclude_HEADERS = libasm.h
+pkginclude_HEADERS = libasm.h
libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
@@ -45,23 +58,30 @@ libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
asm_addint32.c asm_adduint32.c \
asm_addint64.c asm_adduint64.c \
asm_adduleb128.c asm_addsleb128.c \
+ disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
symbolhash.c
if !MUDFLAP
libasm_pic_a_SOURCES =
am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
+libasm_so_LDLIBS =
+if USE_TLS
+libasm_so_LDLIBS += -lpthread
+endif
+
libasm_so_SOURCES =
libasm.so: libasm_pic.a libasm.map
- $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so
+ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
+ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
+ -Wl,--soname,$@.$(VERSION) \
+ ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
+ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
ln -fs $@ $@.$(VERSION)
%.os: %.c %.o
- if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+ if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
-MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
rm -f "$(DEPDIR)/$*.Tpo"; \
@@ -81,12 +101,7 @@ uninstall: uninstall-am
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
endif
-.PSEUDO: lint
-lint:
- $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \
- $(addprefix $(srcdir)/,$(libelf_la_SOURCES))
-
noinst_HEADERS = libasmP.h symbolhash.h
EXTRA_DIST = libasm.map
-CLEANFILES = $(am_libasm_pic_a_OBJECTS)
+CLEANFILES = $(am_libasm_pic_a_OBJECTS) *.gcno *.gcda libasm.so.$(VERSION)
diff --git a/libasm/Makefile.in b/libasm/Makefile.in
index 9683d4d2..6bc21374 100644
--- a/libasm/Makefile.in
+++ b/libasm/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 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,17 +16,11 @@
-SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) $(libasm_so_SOURCES)
-
-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,17 +36,16 @@ build_triplet = @build@
host_triplet = @host@
@MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
@MUDFLAP_TRUE@am_libasm_pic_a_OBJECTS =
+@MUDFLAP_FALSE@@USE_TLS_TRUE@am__append_1 = -lpthread
subdir = libasm
-DIST_COMMON = $(euinclude_HEADERS) $(noinst_HEADERS) \
+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 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.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'`;
@@ -61,7 +54,7 @@ am__vpath_adj = case $$p in \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"
libLIBRARIES_INSTALL = $(INSTALL_DATA)
LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
AR = ar
@@ -80,7 +73,8 @@ am_libasm_a_OBJECTS = asm_begin.$(OBJEXT) asm_abort.$(OBJEXT) \
asm_addint32.$(OBJEXT) asm_adduint32.$(OBJEXT) \
asm_addint64.$(OBJEXT) asm_adduint64.$(OBJEXT) \
asm_adduleb128.$(OBJEXT) asm_addsleb128.$(OBJEXT) \
- symbolhash.$(OBJEXT)
+ disasm_begin.$(OBJEXT) disasm_cb.$(OBJEXT) \
+ disasm_end.$(OBJEXT) disasm_str.$(OBJEXT) symbolhash.$(OBJEXT)
libasm_a_OBJECTS = $(am_libasm_a_OBJECTS)
libasm_pic_a_AR = $(AR) $(ARFLAGS)
libasm_pic_a_LIBADD =
@@ -90,7 +84,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.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -101,14 +95,12 @@ SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) \
$(libasm_so_SOURCES)
DIST_SOURCES = $(libasm_a_SOURCES) $(libasm_pic_a_SOURCES) \
$(libasm_so_SOURCES)
-euincludeHEADERS_INSTALL = $(INSTALL_HEADER)
-HEADERS = $(euinclude_HEADERS) $(noinst_HEADERS)
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(noinst_HEADERS) $(pkginclude_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@
@@ -117,43 +109,39 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
+DEBUGPRED = @DEBUGPRED@
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTLLIBS = @INTLLIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBICONV = @LIBICONV@
-LIBINTL = @LIBINTL@
+LIBEBL_SUBDIR = @LIBEBL_SUBDIR@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LOCALEDIR = @LOCALEDIR@
-LTLIBICONV = @LTLIBICONV@
-LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
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@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -162,7 +150,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -170,12 +157,14 @@ STRIP = @STRIP@
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@
@@ -188,39 +177,56 @@ 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@
+eu_version = @eu_version@
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@
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror
-@MUDFLAP_TRUE@AM_CFLAGS = -Wall
-INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
+top_build_prefix = @top_build_prefix@
+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 \
+@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2
+INCLUDES = -I. -I$(srcdir) -I.. \
+ -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
-I$(top_srcdir)/lib
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
-LINT = splint
+COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
+ $(COMPILE)))
+
lib_LIBRARIES = libasm.a
@MUDFLAP_FALSE@noinst_LIBRARIES = libasm_pic.a
-euincludedir = ${includedir}/elfutils
-euinclude_HEADERS = libasm.h
+pkginclude_HEADERS = libasm.h
libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
@@ -232,19 +238,21 @@ libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
asm_addint32.c asm_adduint32.c \
asm_addint64.c asm_adduint64.c \
asm_adduleb128.c asm_addsleb128.c \
+ disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
symbolhash.c
@MUDFLAP_FALSE@libasm_pic_a_SOURCES =
@MUDFLAP_FALSE@am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
+@MUDFLAP_FALSE@libasm_so_LDLIBS = $(am__append_1)
@MUDFLAP_FALSE@libasm_so_SOURCES =
noinst_HEADERS = libasmP.h symbolhash.h
EXTRA_DIST = libasm.map
-CLEANFILES = $(am_libasm_pic_a_OBJECTS)
+CLEANFILES = $(am_libasm_pic_a_OBJECTS) *.gcno *.gcda libasm.so.$(VERSION)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -269,13 +277,13 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(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) \
@@ -318,7 +326,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)
@@ -352,38 +360,41 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm_newsubscn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm_newsym.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asm_scngrp_newsignature.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disasm_begin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disasm_cb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disasm_end.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disasm_str.Po@am__quote@
@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)
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(euincludedir)" || $(mkdir_p) "$(DESTDIR)$(euincludedir)"
- @list='$(euinclude_HEADERS)'; for p in $$list; do \
+ 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) \
- echo " $(euincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(euincludedir)/$$f'"; \
- $(euincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(euincludedir)/$$f"; \
+ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
done
-uninstall-euincludeHEADERS:
+uninstall-pkgincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(euinclude_HEADERS)'; for p in $$list; do \
+ @list='$(pkginclude_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(euincludedir)/$$f'"; \
- rm -f "$(DESTDIR)$(euincludedir)/$$f"; \
+ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -391,8 +402,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -404,8 +415,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -415,13 +426,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -435,22 +445,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; \
@@ -465,8 +474,8 @@ check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(euincludedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
@MUDFLAP_TRUE@install: install-am
install-exec: install-exec-am
@@ -514,14 +523,22 @@ info: info-am
info-am:
-install-data-am: install-euincludeHEADERS
+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
@@ -541,31 +558,35 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \
- uninstall-libLIBRARIES
+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 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 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-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-euincludeHEADERS \
- uninstall-info-am uninstall-libLIBRARIES
+ tags uninstall uninstall-am uninstall-libLIBRARIES \
+ uninstall-pkgincludeHEADERS
@MUDFLAP_FALSE@libasm.so: libasm_pic.a libasm.map
-@MUDFLAP_FALSE@ $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-@MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
-@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION) \
-@MUDFLAP_FALSE@ ../libebl/libebl.a ../libelf/libelf.so
+@MUDFLAP_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
+@MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
+@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION) \
+@MUDFLAP_FALSE@ ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
+@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
@MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
@MUDFLAP_FALSE@%.os: %.c %.o
-@MUDFLAP_FALSE@ if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+@MUDFLAP_FALSE@ if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
@MUDFLAP_FALSE@ -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
@MUDFLAP_FALSE@ then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
@MUDFLAP_FALSE@ rm -f "$(DEPDIR)/$*.Tpo"; \
@@ -583,11 +604,6 @@ uninstall-am: uninstall-euincludeHEADERS uninstall-info-am \
@MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
@MUDFLAP_FALSE@ rm -f $(DESTDIR)$(libdir)/libasm.so
@MUDFLAP_FALSE@ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
-
-.PSEUDO: lint
-lint:
- $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \
- $(addprefix $(srcdir)/,$(libelf_la_SOURCES))
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libasm/asm_abort.c b/libasm/asm_abort.c
index f35757ca..d12c163d 100644
--- a/libasm/asm_abort.c
+++ b/libasm/asm_abort.c
@@ -1,16 +1,28 @@
/* Abort operations on the assembler context, free all resources.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -36,7 +48,8 @@ asm_abort (ctx)
(void) elf_end (ctx->out.elf);
/* Now close the temporary file and remove it. */
- (void) unlink (ctx->tmp_fname);
+ if (ctx->fd != -1)
+ (void) unlink (ctx->tmp_fname);
/* Free the resources. */
__libasm_finictx (ctx);
diff --git a/libasm/asm_addint16.c b/libasm/asm_addint16.c
index 98125171..5aa8d60e 100644
--- a/libasm/asm_addint16.c
+++ b/libasm/asm_addint16.c
@@ -1,16 +1,28 @@
/* Add integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 16
diff --git a/libasm/asm_addint32.c b/libasm/asm_addint32.c
index 05ac3d25..25c50cea 100644
--- a/libasm/asm_addint32.c
+++ b/libasm/asm_addint32.c
@@ -1,16 +1,28 @@
/* Add integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 32
diff --git a/libasm/asm_addint64.c b/libasm/asm_addint64.c
index f9d93f80..9116d94c 100644
--- a/libasm/asm_addint64.c
+++ b/libasm/asm_addint64.c
@@ -1,16 +1,28 @@
/* Add integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 64
diff --git a/libasm/asm_addint8.c b/libasm/asm_addint8.c
index 35d9bf57..ff4376b8 100644
--- a/libasm/asm_addint8.c
+++ b/libasm/asm_addint8.c
@@ -1,16 +1,28 @@
/* Add integer to a section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -53,22 +65,25 @@ FCT(SIZE) (asmscn, num)
{
// XXX Needs to use backend specified pseudo-ops
if (SIZE == 8)
- printf ("\t.byte\t%" PRId8 "\n", (int8_t) num);
+ fprintf (asmscn->ctx->out.file, "\t.byte\t%" PRId8 "\n", (int8_t) num);
else if (SIZE == 16)
- printf ("\t.value\t%" PRId16 "\n", (int16_t) num);
+ fprintf (asmscn->ctx->out.file, "\t.value\t%" PRId16 "\n",
+ (int16_t) num);
else if (SIZE == 32)
- printf ("\t.long\t%" PRId32 "\n", (int32_t) num);
+ fprintf (asmscn->ctx->out.file, "\t.long\t%" PRId32 "\n",
+ (int32_t) num);
else
{
// XXX This is not necessary for 64-bit machines
bool is_leb = (elf_getident (asmscn->ctx->out.elf, NULL)[EI_DATA]
== ELFDATA2LSB);
- printf ("\t.long\t%" PRId32 "\n\t.long\t%" PRId32 "\n",
- (int32_t) (is_leb
- ? num % 0x100000000ll : num / 0x100000000ll),
- (int32_t) (is_leb
- ? num / 0x100000000ll : num % 0x100000000ll));
+ fprintf (asmscn->ctx->out.file,
+ "\t.long\t%" PRId32 "\n\t.long\t%" PRId32 "\n",
+ (int32_t) (is_leb
+ ? num % 0x100000000ll : num / 0x100000000ll),
+ (int32_t) (is_leb
+ ? num / 0x100000000ll : num % 0x100000000ll));
}
}
else
diff --git a/libasm/asm_addsleb128.c b/libasm/asm_addsleb128.c
index 0661b36e..614ba69c 100644
--- a/libasm/asm_addsleb128.c
+++ b/libasm/asm_addsleb128.c
@@ -1,16 +1,28 @@
/* Add signed little endian base 128 integer to a section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -37,7 +49,7 @@ asm_addsleb128 (asmscn, num)
}
if (unlikely (asmscn->ctx->textp))
- printf ("\t.sleb128\t%" PRId32 "\n", num);
+ fprintf (asmscn->ctx->out.file, "\t.sleb128\t%" PRId32 "\n", num);
else
{
char tmpbuf[(sizeof (num) * 8 + 6) / 7];
diff --git a/libasm/asm_addstrz.c b/libasm/asm_addstrz.c
index e183b0b5..ddd03541 100644
--- a/libasm/asm_addstrz.c
+++ b/libasm/asm_addstrz.c
@@ -1,16 +1,28 @@
/* Add string to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_adduint16.c b/libasm/asm_adduint16.c
index 8c1e698f..063e5d42 100644
--- a/libasm/asm_adduint16.c
+++ b/libasm/asm_adduint16.c
@@ -1,16 +1,28 @@
/* Add unsigned integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 16
diff --git a/libasm/asm_adduint32.c b/libasm/asm_adduint32.c
index a2257954..6dc814f8 100644
--- a/libasm/asm_adduint32.c
+++ b/libasm/asm_adduint32.c
@@ -1,16 +1,28 @@
/* Add unsigned integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 32
diff --git a/libasm/asm_adduint64.c b/libasm/asm_adduint64.c
index edda4d38..71bb16a0 100644
--- a/libasm/asm_adduint64.c
+++ b/libasm/asm_adduint64.c
@@ -1,16 +1,28 @@
/* Add unsigned integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#define SIZE 64
diff --git a/libasm/asm_adduint8.c b/libasm/asm_adduint8.c
index 7bfb3414..c8801537 100644
--- a/libasm/asm_adduint8.c
+++ b/libasm/asm_adduint8.c
@@ -1,16 +1,28 @@
/* Add unsigned integer to a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_adduleb128.c b/libasm/asm_adduleb128.c
index 521d265a..042c76b3 100644
--- a/libasm/asm_adduleb128.c
+++ b/libasm/asm_adduleb128.c
@@ -1,16 +1,28 @@
/* Add integer to a section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -37,7 +49,7 @@ asm_adduleb128 (asmscn, num)
}
if (unlikely (asmscn->ctx->textp))
- printf ("\t.uleb128\t%" PRIu32 "\n", num);
+ fprintf (asmscn->ctx->out.file, "\t.uleb128\t%" PRIu32 "\n", num);
else
{
char tmpbuf[(sizeof (num) * 8 + 6) / 7];
diff --git a/libasm/asm_align.c b/libasm/asm_align.c
index e7350924..b5a573b2 100644
--- a/libasm/asm_align.c
+++ b/libasm/asm_align.c
@@ -1,21 +1,34 @@
/* Align section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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 <inttypes.h>
#include <stdlib.h>
#include <sys/param.h>
@@ -39,6 +52,25 @@ asm_align (asmscn, value)
return -1;
}
+ if (unlikely (asmscn->ctx->textp))
+ {
+ fprintf (asmscn->ctx->out.file, "\t.align %" PRId32 ", ",
+ (int32_t) value);
+ if (asmscn->pattern->len == 1)
+ fprintf (asmscn->ctx->out.file, "%02hhx\n", asmscn->pattern->bytes[0]);
+ else
+ {
+ fputc_unlocked ('"', asmscn->ctx->out.file);
+
+ for (size_t cnt = 0; cnt < asmscn->pattern->len; ++cnt)
+ fprintf (asmscn->ctx->out.file, "\\x%02hhx",
+ asmscn->pattern->bytes[cnt]);
+
+ fputs_unlocked ("\"\n", asmscn->ctx->out.file);
+ }
+ return 0;
+ }
+
rwlock_wrlock (asmscn->ctx->lock);
int result = 0;
@@ -47,10 +79,7 @@ asm_align (asmscn, value)
if ((asmscn->offset & (value - 1)) != 0)
{
/* Add fillbytes. */
- size_t cnt;
- size_t byteptr;
-
- cnt = value - (asmscn->offset & (value - 1));
+ size_t cnt = value - (asmscn->offset & (value - 1));
/* Ensure there is enough room to add the fill bytes. */
result = __libasm_ensure_section_space (asmscn, cnt);
@@ -59,7 +88,7 @@ asm_align (asmscn, value)
/* Fill in the bytes. We align the pattern according to the
current offset. */
- byteptr = asmscn->offset % asmscn->pattern->len;
+ size_t byteptr = asmscn->offset % asmscn->pattern->len;
/* Update the total size. */
asmscn->offset += cnt;
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index 3896f78f..b8094dcd 100644
--- a/libasm/asm_begin.c
+++ b/libasm/asm_begin.c
@@ -1,16 +1,28 @@
/* Create descriptor for assembling.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -18,6 +30,8 @@
#include <assert.h>
#include <errno.h>
+#include <stdio.h>
+#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -30,12 +44,27 @@
static AsmCtx_t *
prepare_text_output (AsmCtx_t *result)
{
+ if (result->fd == -1)
+ result->out.file = stdout;
+ else
+ {
+ result->out.file = fdopen (result->fd, "a");
+ if (result->out.file == NULL)
+ {
+ close (result->fd);
+ free (result);
+ result = NULL;
+ }
+
+ __fsetlocking (result->out.file, FSETLOCKING_BYCALLER);
+ }
+
return result;
}
static AsmCtx_t *
-prepare_binary_output (AsmCtx_t *result, int machine, int klass, int data)
+prepare_binary_output (AsmCtx_t *result, Ebl *ebl)
{
GElf_Ehdr *ehdr;
GElf_Ehdr ehdr_mem;
@@ -53,7 +82,8 @@ prepare_binary_output (AsmCtx_t *result, int machine, int klass, int data)
}
/* Create the ELF header for the output file. */
- if (gelf_newehdr (result->out.elf, klass) == 0)
+ int class = ebl_get_elfclass (ebl);
+ if (gelf_newehdr (result->out.elf, class) == 0)
goto err_libelf;
ehdr = gelf_getehdr (result->out.elf, &ehdr_mem);
@@ -65,11 +95,10 @@ prepare_binary_output (AsmCtx_t *result, int machine, int klass, int data)
/* Set the ELF version. */
ehdr->e_version = EV_CURRENT;
- /* Use the machine value the user provided. */
- ehdr->e_machine = machine;
- /* Same for the class and endianness. */
- ehdr->e_ident[EI_CLASS] = klass;
- ehdr->e_ident[EI_DATA] = data;
+ /* Use the machine, class, and endianess values from the Ebl descriptor. */
+ ehdr->e_machine = ebl_get_elfmachine (ebl);
+ ehdr->e_ident[EI_CLASS] = class;
+ ehdr->e_ident[EI_DATA] = ebl_get_elfdata (ebl);
memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG);
@@ -95,47 +124,48 @@ prepare_binary_output (AsmCtx_t *result, int machine, int klass, int data)
AsmCtx_t *
-asm_begin (fname, textp, machine, klass, data)
+asm_begin (fname, ebl, textp)
const char *fname;
+ Ebl *ebl;
bool textp;
- int machine;
- int klass;
- int data;
{
- size_t fname_len = strlen (fname);
- AsmCtx_t *result;
-
+ if (fname == NULL && ! textp)
+ return NULL;
- /* First order of business: find the appropriate backend. If it
- does not exist we don't have to look further. */
- // XXX
+ size_t fname_len = fname != NULL ? strlen (fname) : 0;
/* Create the file descriptor. We do not generate the output file
right away. Instead we create a temporary file in the same
directory which, if everything goes alright, will replace a
possibly existing file with the given name. */
- result = (AsmCtx_t *) malloc (sizeof (AsmCtx_t) + 2 * fname_len + 9);
+ AsmCtx_t *result
+ = (AsmCtx_t *) malloc (sizeof (AsmCtx_t) + 2 * fname_len + 9);
if (result == NULL)
return NULL;
- /* Initialize the lock. */
- rwlock_init (result->lock);
+ /* Initialize the lock. */
+ rwlock_init (result->lock);
- /* Create the name of the temporary file. */
- result->fname = stpcpy (mempcpy (result->tmp_fname, fname, fname_len),
- ".XXXXXX") + 1;
- memcpy (result->fname, fname, fname_len + 1);
-
- /* Create the temporary file. */
- result->fd = mkstemp (result->tmp_fname);
- if (result->fd == -1)
+ if (fname != NULL)
{
- int save_errno = errno;
- free (result);
- __libasm_seterrno (ASM_E_CANNOT_CREATE);
- errno = save_errno;
- return NULL;
+ /* Create the name of the temporary file. */
+ result->fname = stpcpy (mempcpy (result->tmp_fname, fname, fname_len),
+ ".XXXXXX") + 1;
+ memcpy (result->fname, fname, fname_len + 1);
+
+ /* Create the temporary file. */
+ result->fd = mkstemp (result->tmp_fname);
+ if (result->fd == -1)
+ {
+ int save_errno = errno;
+ free (result);
+ __libasm_seterrno (ASM_E_CANNOT_CREATE);
+ errno = save_errno;
+ return NULL;
+ }
}
+ else
+ result->fd = -1;
/* Initialize the counter for temporary symbols. */
result->tempsym_count = 0;
@@ -145,7 +175,7 @@ asm_begin (fname, textp, machine, klass, data)
if (textp)
result = prepare_text_output (result);
else
- result = prepare_binary_output (result, machine, klass, data);
+ result = prepare_binary_output (result, ebl);
return result;
}
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index 01326a11..1d815fa6 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -1,16 +1,28 @@
/* Finalize operations on the assembler context, free all resources.
- Copyright (C) 2002, 2003 Red Hat, Inc.
+ Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -31,9 +43,14 @@
static int
-text_end (AsmCtx_t *ctx)
+text_end (AsmCtx_t *ctx __attribute__ ((unused)))
{
- // XXX Does anything have to be done?
+ if (fclose (ctx->out.file) != 0)
+ {
+ __libasm_seterrno (ASM_E_IOERROR);
+ return -1;
+ }
+
return 0;
}
@@ -93,9 +110,10 @@ binary_end (AsmCtx_t *ctx)
Elf_Data *newdata = elf_newdata (scn);
if (newdata == NULL)
- error (EXIT_FAILURE, 0,
- _("cannot create section for output file: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
newdata->d_buf = content->data;
newdata->d_type = ELF_T_BYTE;
@@ -114,26 +132,19 @@ binary_end (AsmCtx_t *ctx)
/* Create the symbol table if necessary. */
if (ctx->nsymbol_tab > 0)
{
- Elf_Scn *symscn;
- Elf_Scn *strscn;
- AsmSym_t *sym;
- int ptr_local;
- int ptr_nonlocal;
- GElf_Sym syment;
- uint32_t *xshndx = NULL;
- void *runp;
-
/* Create the symbol table and string table section names. */
symscn_strent = ebl_strtabadd (ctx->section_strtab, ".symtab", 8);
strscn_strent = ebl_strtabadd (ctx->section_strtab, ".strtab", 8);
/* Create the symbol string table section. */
- strscn = elf_newscn (ctx->out.elf);
+ Elf_Scn *strscn = elf_newscn (ctx->out.elf);
strtabdata = elf_newdata (strscn);
shdr = gelf_getshdr (strscn, &shdr_mem);
if (strtabdata == NULL || shdr == NULL)
- error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
strscnndx = elf_ndxscn (strscn);
ebl_strtabfinalize (ctx->symbol_strtab, strtabdata);
@@ -144,12 +155,14 @@ binary_end (AsmCtx_t *ctx)
(void) gelf_update_shdr (strscn, shdr);
/* Create the symbol table section. */
- symscn = elf_newscn (ctx->out.elf);
+ Elf_Scn *symscn = elf_newscn (ctx->out.elf);
data = elf_newdata (symscn);
shdr = gelf_getshdr (symscn, &shdr_mem);
if (data == NULL || shdr == NULL)
- error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
symscnndx = elf_ndxscn (symscn);
/* We know how many symbols there will be in the symbol table. */
@@ -163,20 +176,19 @@ binary_end (AsmCtx_t *ctx)
data->d_off = 0;
/* Clear the first entry. */
+ GElf_Sym syment;
memset (&syment, '\0', sizeof (syment));
(void) gelf_update_sym (data, 0, &syment);
/* Iterate over the symbol table. */
- runp = NULL;
- ptr_local = 1; /* Start with index 1; zero remains unused. */
- ptr_nonlocal = ctx->nsymbol_tab;
+ void *runp = NULL;
+ int ptr_local = 1; /* Start with index 1; zero remains unused. */
+ int ptr_nonlocal = ctx->nsymbol_tab;
+ uint32_t *xshndx = NULL;
+ AsmSym_t *sym;
while ((sym = asm_symbol_tab_iterate (&ctx->symbol_tab, &runp)) != NULL)
if (asm_emit_symbol_p (ebl_string (sym->strent)))
{
- int ptr;
- Elf32_Word ndx;
- Elf_Scn *scn;
-
assert (ptr_local <= ptr_nonlocal);
syment.st_name = ebl_strtaboffset (sym->strent);
@@ -187,14 +199,15 @@ binary_end (AsmCtx_t *ctx)
/* Add local symbols at the beginning, the other from
the end. */
- ptr = sym->binding == STB_LOCAL ? ptr_local++ : ptr_nonlocal--;
+ int ptr = sym->binding == STB_LOCAL ? ptr_local++ : ptr_nonlocal--;
/* Determine the section index. We have to handle the
overflow correctly. */
- scn = (sym->scn->subsection_id == 0
- ? sym->scn->data.main.scn
- : sym->scn->data.up->data.main.scn);
+ Elf_Scn *scn = (sym->scn->subsection_id == 0
+ ? sym->scn->data.main.scn
+ : sym->scn->data.up->data.main.scn);
+ Elf32_Word ndx;
if (unlikely (scn == ASM_ABS_SCN))
ndx = SHN_ABS;
else if (unlikely (scn == ASM_COM_SCN))
@@ -206,15 +219,15 @@ binary_end (AsmCtx_t *ctx)
/* The extended section index section does not yet
exist. */
Elf_Scn *xndxscn;
- size_t symscnndx = elf_ndxscn (symscn);
xndxscn = elf_newscn (ctx->out.elf);
xndxdata = elf_newdata (xndxscn);
shdr = gelf_getshdr (xndxscn, &shdr_mem);
if (xndxdata == NULL || shdr == NULL)
- error (EXIT_FAILURE, 0, _("\
-cannot create extended section index table: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
xndxscnndx = elf_ndxscn (xndxscn);
shdr->sh_type = SHT_SYMTAB_SHNDX;
@@ -276,8 +289,10 @@ cannot create extended section index table: %s"),
shstrtabdata = elf_newdata (shstrscn);
shdr = gelf_getshdr (shstrscn, &shdr_mem);
if (shstrscn == NULL || shstrtabdata == NULL || shdr == NULL)
- error (EXIT_FAILURE, 0, _("cannot create section for output file: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
/* Add the name of the section header string table. */
@@ -300,9 +315,6 @@ cannot create extended section index table: %s"),
do
{
Elf_Scn *scn;
- GElf_Shdr shdr_mem;
- GElf_Shdr *shdr;
- Elf_Data *data;
Elf32_Word *grpdata;
scn = runp->scn;
@@ -312,9 +324,10 @@ cannot create extended section index table: %s"),
data = elf_newdata (scn);
if (data == NULL)
- error (EXIT_FAILURE, 0,
- _("cannot create section group for output file: %s"),
- elf_errmsg (-1));
+ {
+ __libasm_seterrno (ASM_E_LIBELF);
+ return -1;
+ }
/* It is correct to use 'elf32_fsize' instead of 'gelf_fsize'
here. */
diff --git a/libasm/asm_error.c b/libasm/asm_error.c
index 9d2d81ed..29c54cb0 100644
--- a/libasm/asm_error.c
+++ b/libasm/asm_error.c
@@ -1,16 +1,28 @@
/* Error handling in libasm.
- Copyright (C) 2002, 2004 Red Hat, Inc.
+ Copyright (C) 2002, 2004, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -112,7 +124,9 @@ static const char *msgs[ASM_E_NUM] =
[ASM_E_CANNOT_CHMOD] = N_("cannot change mode of output file"),
[ASM_E_CANNOT_RENAME] = N_("cannot rename output file"),
[ASM_E_DUPLSYM] = N_("duplicate symbol"),
- [ASM_E_TYPE] = N_("invalid section type for operation")
+ [ASM_E_TYPE] = N_("invalid section type for operation"),
+ [ASM_E_IOERROR] = N_("error during output of data"),
+ [ASM_E_ENOSUP] = N_("no backend support available"),
};
const char *
@@ -146,7 +160,7 @@ asm_errmsg (error)
last_error = global_error;
if (error < -1)
- return _("Unknown error");
+ return _("unknown error");
if (error == 0 && last_error == 0)
/* No error. */
return NULL;
diff --git a/libasm/asm_fill.c b/libasm/asm_fill.c
index 67b64417..66f7134b 100644
--- a/libasm/asm_fill.c
+++ b/libasm/asm_fill.c
@@ -1,16 +1,28 @@
/* Determine fill pattern for a section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_getelf.c b/libasm/asm_getelf.c
index 3bbb0d90..df5cffda 100644
--- a/libasm/asm_getelf.c
+++ b/libasm/asm_getelf.c
@@ -1,16 +1,28 @@
/* Return ELF descriptor associated with the assembler context.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_newabssym.c b/libasm/asm_newabssym.c
index fba46f0f..1dacb012 100644
--- a/libasm/asm_newabssym.c
+++ b/libasm/asm_newabssym.c
@@ -1,16 +1,28 @@
/* Create new ABS symbol.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_newcomsym.c b/libasm/asm_newcomsym.c
index 61e5a909..4a7144ec 100644
--- a/libasm/asm_newcomsym.c
+++ b/libasm/asm_newcomsym.c
@@ -1,16 +1,28 @@
/* Create new COMMON symbol.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c
index 75890a60..8a5e78b5 100644
--- a/libasm/asm_newscn.c
+++ b/libasm/asm_newscn.c
@@ -1,16 +1,28 @@
/* Create new section in output file.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -81,7 +93,8 @@ text_newscn (AsmScn_t *result, GElf_Word type, GElf_Xword flags)
/* Terminate the string. */
*wp = '\0';
- printf ("\t.section \"%s\"%s%s\n", result->name, flagstr, typestr);
+ fprintf (result->ctx->out.file, "\t.section \"%s\"%s%s\n",
+ result->name, flagstr, typestr);
return result;
}
diff --git a/libasm/asm_newscn_ingrp.c b/libasm/asm_newscn_ingrp.c
index dc0c4351..c17e22e9 100644
--- a/libasm/asm_newscn_ingrp.c
+++ b/libasm/asm_newscn_ingrp.c
@@ -1,16 +1,28 @@
/* Create new section, which is member of a group, in output file.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -29,7 +41,7 @@ asm_newscn_ingrp (ctx, scnname, type, flags, grp)
GElf_Xword flags;
AsmScnGrp_t *grp;
{
- AsmScn_t *result = __asm_newscn_internal (ctx, scnname, type, flags);
+ AsmScn_t *result = INTUSE (asm_newscn) (ctx, scnname, type, flags);
if (likely (result != NULL))
{
diff --git a/libasm/asm_newscngrp.c b/libasm/asm_newscngrp.c
index c1c8be3e..1eed25cd 100644
--- a/libasm/asm_newscngrp.c
+++ b/libasm/asm_newscngrp.c
@@ -1,16 +1,28 @@
/* Create new section group.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_newsubscn.c b/libasm/asm_newsubscn.c
index e767720e..d1a86dd7 100644
--- a/libasm/asm_newsubscn.c
+++ b/libasm/asm_newsubscn.c
@@ -1,16 +1,28 @@
/* Create new subsection section in given section.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c
index 6a6df2d8..e2727b15 100644
--- a/libasm/asm_newsym.c
+++ b/libasm/asm_newsym.c
@@ -1,16 +1,28 @@
/* Define new symbol for current position in given section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
@@ -54,9 +66,13 @@ asm_newsym (asmscn, name, size, type, binding)
// XXX This requires getting the format from the machine backend. */
snprintf (tempsym, TEMPSYMLEN, ".L%07u", asmscn->ctx->tempsym_count++);
+
+ name = tempsym;
}
- result = (AsmSym_t *) malloc (sizeof (AsmSym_t));
+ size_t name_len = strlen (name) + 1;
+
+ result = (AsmSym_t *) malloc (sizeof (AsmSym_t) + name_len);
if (result == NULL)
return NULL;
@@ -69,15 +85,12 @@ asm_newsym (asmscn, name, size, type, binding)
result->binding = binding;
result->symidx = 0;
result->strent = ebl_strtabadd (asmscn->ctx->symbol_strtab,
- name ?: tempsym, 0);
+ memcpy (result + 1, name, name_len), 0);
if (unlikely (asmscn->ctx->textp))
{
/* We are only interested in the name and don't need to know whether
it is a local name or not. */
- if (name == NULL)
- name = tempsym;
-
/* First print the binding pseudo-op. */
if (binding == STB_GLOBAL)
fprintf (asmscn->ctx->out.file, "\t.globl\t%s\n", name);
@@ -97,15 +110,21 @@ asm_newsym (asmscn, name, size, type, binding)
else
{
/* Put the symbol in the hash table so that we can later find it. */
- if (asm_symbol_tab_insert (&asmscn->ctx->symbol_tab,
- elf_hash (name ?: tempsym), result) != 0)
+ if (asm_symbol_tab_insert (&asmscn->ctx->symbol_tab, elf_hash (name),
+ result) != 0)
{
/* The symbol already exists. */
__libasm_seterrno (ASM_E_DUPLSYM);
+ /* Note that we can free the entry since there must be no
+ reference in the string table to the string. We can only
+ fail to insert the symbol into the symbol table if there
+ is already a symbol with this name. In this case the
+ ebl_strtabadd function would use the previously provided
+ name. */
free (result);
result = NULL;
}
- else if (name != NULL && asm_emit_symbol_p (name))
+ else if (name != tempsym && asm_emit_symbol_p (name))
/* Only count non-private symbols. */
++asmscn->ctx->nsymbol_tab;
}
diff --git a/libasm/asm_scngrp_newsignature.c b/libasm/asm_scngrp_newsignature.c
index d4042a24..9908e403 100644
--- a/libasm/asm_scngrp_newsignature.c
+++ b/libasm/asm_scngrp_newsignature.c
@@ -1,16 +1,28 @@
/* Update signature of section group.
Copyright (C) 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/disasm_begin.c b/libasm/disasm_begin.c
new file mode 100644
index 00000000..5b98b2a3
--- /dev/null
+++ b/libasm/disasm_begin.c
@@ -0,0 +1,61 @@
+/* Create context descriptor for disassembler.
+ Copyright (C) 2005, 2008 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
+ 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 <stdlib.h>
+
+#include "libasmP.h"
+#include "../libebl/libeblP.h"
+
+
+DisasmCtx_t *
+disasm_begin (Ebl *ebl, Elf *elf, DisasmGetSymCB_t symcb)
+{
+ if (ebl == NULL)
+ return NULL;
+
+ if (ebl->disasm == NULL)
+ {
+ __libasm_seterrno (ASM_E_ENOSUP);
+ return NULL;
+ }
+
+ DisasmCtx_t *ctx = (DisasmCtx_t *) malloc (sizeof (DisasmCtx_t));
+ if (ctx == NULL)
+ {
+ __libasm_seterrno (ASM_E_NOMEM);
+ return NULL;
+ }
+
+ ctx->ebl = ebl;
+ ctx->elf = elf;
+ ctx->symcb = symcb;
+
+ return ctx;
+}
diff --git a/libasm/disasm_cb.c b/libasm/disasm_cb.c
new file mode 100644
index 00000000..56101258
--- /dev/null
+++ b/libasm/disasm_cb.c
@@ -0,0 +1,176 @@
+/* Copyright (C) 2005, 2007, 2008 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
+ 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 "libasmP.h"
+#include "../libebl/libeblP.h"
+
+
+struct symtoken
+{
+ DisasmCtx_t *ctx;
+ void *symcbarg;
+};
+
+
+static int
+default_elf_getsym (GElf_Addr addr, Elf32_Word scnndx, GElf_Addr value,
+ char **buf, size_t *buflen, void *arg)
+{
+ struct symtoken *symtoken = (struct symtoken *) arg;
+
+ /* First try the user provided function. */
+ if (symtoken->ctx->symcb != NULL)
+ {
+ int res = symtoken->ctx->symcb (addr, scnndx, value, buf, buflen,
+ symtoken->symcbarg);
+ if (res >= 0)
+ return res;
+ }
+
+ // XXX Look up in ELF file.
+
+ return -1;
+}
+
+
+struct symaddrpair
+{
+ GElf_Addr addr;
+ const char *name;
+};
+
+
+static void
+read_symtab_exec (DisasmCtx_t *ctx)
+{
+ /* We simply use all we can get our hands on. This will produce
+ some duplicate information but this is no problem, we simply
+ ignore the latter definitions. */
+ Elf_Scn *scn= NULL;
+ while ((scn = elf_nextscn (ctx->elf, scn)) != NULL)
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ Elf_Data *data;
+ if (shdr == NULL || shdr->sh_type != SHT_SYMTAB
+ || (data = elf_getdata (scn, NULL)) == NULL)
+ continue;
+
+ int xndxscnidx = elf_scnshndx (scn);
+ Elf_Data *xndxdata = NULL;
+ if (xndxscnidx > 0)
+ xndxdata = elf_getdata (elf_getscn (ctx->elf, xndxscnidx), NULL);
+
+ /* Iterate over all symbols. Add all defined symbols. */
+ int nsyms = shdr->sh_size / shdr->sh_entsize;
+ for (int cnt = 1; cnt < nsyms; ++cnt)
+ {
+ Elf32_Word xshndx;
+ GElf_Sym sym_mem;
+ GElf_Sym *sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem,
+ &xshndx);
+ if (sym == NULL)
+ continue;
+
+ /* Undefined symbols are useless here. */
+ if (sym->st_shndx == SHN_UNDEF)
+ continue;
+
+
+ }
+ }
+}
+
+
+static void
+read_symtab (DisasmCtx_t *ctx)
+{
+ /* Find the symbol table(s). */
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr = gelf_getehdr (ctx->elf, &ehdr_mem);
+ if (ehdr == NULL)
+ return;
+
+ switch (ehdr->e_type)
+ {
+ case ET_EXEC:
+ case ET_DYN:
+ read_symtab_exec (ctx);
+ break;
+
+ case ET_REL:
+ // XXX Handle
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+static int
+null_elf_getsym (GElf_Addr addr __attribute__ ((unused)),
+ Elf32_Word scnndx __attribute__ ((unused)),
+ GElf_Addr value __attribute__ ((unused)),
+ char **buf __attribute__ ((unused)),
+ size_t *buflen __attribute__ ((unused)),
+ void *arg __attribute__ ((unused)))
+{
+ return -1;
+}
+
+
+int
+disasm_cb (DisasmCtx_t *ctx, const uint8_t **startp, const uint8_t *end,
+ GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb,
+ void *outcbarg, void *symcbarg)
+{
+ struct symtoken symtoken;
+ DisasmGetSymCB_t getsym = ctx->symcb ?: null_elf_getsym;
+
+ if (ctx->elf != NULL)
+ {
+ /* Read all symbols of the ELF file and stuff them into a hash
+ table. The key is the address and the section index. */
+ read_symtab (ctx);
+
+ symtoken.ctx = ctx;
+ symtoken.symcbarg = symcbarg;
+
+ symcbarg = &symtoken;
+
+ getsym = default_elf_getsym;
+ }
+
+ return ctx->ebl->disasm (startp, end, addr, fmt, outcb, getsym, outcbarg,
+ symcbarg);
+}
+INTDEF (disasm_cb)
diff --git a/libasm/disasm_end.c b/libasm/disasm_end.c
new file mode 100644
index 00000000..ee8b2f98
--- /dev/null
+++ b/libasm/disasm_end.c
@@ -0,0 +1,42 @@
+/* Release descriptor for disassembler.
+ Copyright (C) 2005, 2008 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
+ 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 <stdlib.h>
+
+#include "libasmP.h"
+
+
+int
+disasm_end (DisasmCtx_t *ctx)
+{
+ free (ctx);
+
+ return 0;
+}
diff --git a/libasm/disasm_str.c b/libasm/disasm_str.c
new file mode 100644
index 00000000..856fd11d
--- /dev/null
+++ b/libasm/disasm_str.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2005, 2008 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@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>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include "libasmP.h"
+
+
+struct buffer
+{
+ char *buf;
+ size_t len;
+};
+
+
+static int
+buffer_cb (char *str, size_t len, void *arg)
+{
+ struct buffer *buffer = (struct buffer *) arg;
+
+ if (len > buffer->len)
+ /* Return additional needed space. */
+ return len - buffer->len;
+
+ buffer->buf = mempcpy (buffer->buf, str, len);
+ buffer->len = len;
+
+ return 0;
+}
+
+
+int
+disasm_str (DisasmCtx_t *ctx, const uint8_t **startp, const uint8_t *end,
+ GElf_Addr addr, const char *fmt, char **bufp, size_t len,
+ void *symcbarg)
+{
+ struct buffer buffer = { .buf = *bufp, .len = len };
+
+ int res = INTUSE(disasm_cb) (ctx, startp, end, addr, fmt, buffer_cb, &buffer,
+ symcbarg);
+ *bufp = buffer.buf;
+ return res;
+}
diff --git a/libasm/libasm.h b/libasm/libasm.h
index dbdd6fc2..307c7349 100644
--- a/libasm/libasm.h
+++ b/libasm/libasm.h
@@ -1,15 +1,27 @@
/* Interface for libasm.
- Copyright (C) 2002 Red Hat, Inc.
-
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ Copyright (C) 2002, 2005, 2008 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>. */
#ifndef _LIBASM_H
#define _LIBASM_H 1
@@ -17,7 +29,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include <gelf.h>
+#include <libebl.h>
/* Opaque type for the assembler context descriptor. */
@@ -33,6 +45,20 @@ typedef struct AsmScnGrp AsmScnGrp_t;
typedef struct AsmSym AsmSym_t;
+/* Opaque type for the disassembler context descriptor. */
+typedef struct DisasmCtx DisasmCtx_t;
+
+/* Type used for callback functions to retrieve symbol name. The
+ symbol reference is in the section designated by the second parameter
+ at an offset described by the first parameter. The value is the
+ third parameter. */
+typedef int (*DisasmGetSymCB_t) (GElf_Addr, Elf32_Word, GElf_Addr, char **,
+ size_t *, void *);
+
+/* Output function callback. */
+typedef int (*DisasmOutputCB_t) (char *, size_t, void *);
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -43,8 +69,7 @@ extern "C" {
corresponds to an EM_ constant from <elf.h>, KLASS specifies the
class (32- or 64-bit), and DATA specifies the byte order (little or
big endian). */
-extern AsmCtx_t *asm_begin (const char *fname, bool textp, int machine,
- int klass, int data);
+extern AsmCtx_t *asm_begin (const char *fname, Ebl *ebl, bool textp);
/* Abort the operation on the assembler context and free all resources. */
extern int asm_abort (AsmCtx_t *ctx);
@@ -148,6 +173,25 @@ extern int asm_errno (void);
string is returned. */
extern const char *asm_errmsg (int __error);
+
+/* Create context descriptor for disassembler. */
+extern DisasmCtx_t *disasm_begin (Ebl *ebl, Elf *elf, DisasmGetSymCB_t symcb);
+
+/* Release descriptor for disassembler. */
+extern int disasm_end (DisasmCtx_t *ctx);
+
+/* Produce of disassembly output for given memory, store text in
+ provided buffer. */
+extern int disasm_str (DisasmCtx_t *ctx, const uint8_t **startp,
+ const uint8_t *end, GElf_Addr addr, const char *fmt,
+ char **bufp, size_t len, void *symcbarg);
+
+/* Produce disassembly output for given memory and output it using the
+ given callback functions. */
+extern int disasm_cb (DisasmCtx_t *ctx, const uint8_t **startp,
+ const uint8_t *end, GElf_Addr addr, const char *fmt,
+ DisasmOutputCB_t outcb, void *outcbarg, void *symcbarg);
+
#ifdef __cplusplus
}
#endif
diff --git a/libasm/libasm.map b/libasm/libasm.map
index b0b5b5b7..a36cdbfe 100644
--- a/libasm/libasm.map
+++ b/libasm/libasm.map
@@ -28,6 +28,11 @@ ELFUTILS_1.0 {
asm_newsym;
asm_scngrp_newsignature;
+ disasm_begin;
+ disasm_cb;
+ disasm_end;
+ disasm_str;
+
local:
*;
};
diff --git a/libasm/libasmP.h b/libasm/libasmP.h
index 2e4954f6..ee7005f5 100644
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -1,15 +1,27 @@
/* Internal definitions for libasm.
- Copyright (C) 2002, 2004 Red Hat, Inc.
-
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ Copyright (C) 2002, 2004, 2005 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>. */
#ifndef _LIBASMP_H
#define _LIBASMP_H 1
@@ -17,7 +29,6 @@
#include <stdio.h>
#include <libasm.h>
-#include <libebl.h>
/* gettext helper macros. */
#define _(Str) dgettext ("elfutils", Str)
@@ -35,6 +46,8 @@ enum
ASM_E_DUPLSYM, /* Duplicate symbol definition. */
ASM_E_LIBELF, /* Refer to error in libelf. */
ASM_E_TYPE, /* Invalid section type for operation. */
+ ASM_E_IOERROR, /* Error during output of data. */
+ ASM_E_ENOSUP, /* No backend support. */
ASM_E_NUM /* Keep this entry as the last. */
};
@@ -223,6 +236,21 @@ struct AsmScnGrp
};
+/* Descriptor for disassembler. */
+struct DisasmCtx
+{
+ /* Handle for the backend library with the disassembler routine. */
+ Ebl *ebl;
+
+ /* ELF file containing all the data passed to the function. This
+ allows to look up symbols. */
+ Elf *elf;
+
+ /* Callback function to determine symbol names. */
+ DisasmGetSymCB_t symcb;
+};
+
+
/* The default fill pattern: one zero byte. */
extern const struct FillPattern *__libasm_default_pattern
attribute_hidden;
@@ -257,6 +285,14 @@ extern int __asm_addint64_internal (AsmScn_t *asmscn, int64_t num)
attribute_hidden;
+/* Produce disassembly output for given memory and output it using the
+ given callback functions. */
+extern int __disasm_cb_internal (DisasmCtx_t *ctx, const uint8_t **startp,
+ const uint8_t *end, GElf_Addr addr,
+ const char *fmt, DisasmOutputCB_t outcb,
+ void *outcbarp, void *symcbarg)
+ attribute_hidden;
+
/* Test whether given symbol is an internal symbol and if yes, whether
we should nevertheless emit it in the symbol table. */
diff --git a/libasm/symbolhash.c b/libasm/symbolhash.c
index 62d2c852..e3aa5dda 100644
--- a/libasm/symbolhash.c
+++ b/libasm/symbolhash.c
@@ -1,16 +1,28 @@
/* Symbol hash table implementation.
Copyright (C) 2001, 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
-
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>
diff --git a/libasm/symbolhash.h b/libasm/symbolhash.h
index 4377b4b5..28768da7 100644
--- a/libasm/symbolhash.h
+++ b/libasm/symbolhash.h
@@ -1,15 +1,27 @@
/* Copyright (C) 2001, 2002 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
- This program is Open Source software; you can redistribute it and/or
- modify it under the terms of the Open Software License version 1.0 as
- published by the Open Source Initiative.
+ 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.
- You should have received a copy of the Open Software License along
- with this program; if not, you may obtain a copy of the Open Software
- License version 1.0 from http://www.opensource.org/licenses/osl.php or
- by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
- 3001 King Ranch Road, Ukiah, CA 95482. */
+ 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>. */
#ifndef SYMBOLHASH_H
#define SYMBOLHASH_H 1