diff -urN elfutils-0.95.orig/Makefile.am elfutils-0.95/Makefile.am --- elfutils-0.95.orig/Makefile.am Mon Jan 19 00:24:16 2004 +++ elfutils-0.95/Makefile.am Sat Jun 19 16:55:19 2004 @@ -19,7 +19,7 @@ ACLOCAL_AMFLAGS = -I m4 mini_SUBDIRS = config m4 lib libelf libelf-po -all_SUBDIRS = doc libebl libdw libcpu libasm src po tests +all_SUBDIRS = doc libebl libdw libcpu libasm po -SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS) +SUBDIRS = lincompat $(mini_SUBDIRS) $(all_SUBDIRS) EXTRA_DIST = splint.rc elfutils.spec GPG-KEY NOTES COPYING.GPL diff -urN elfutils-0.95.orig/lib/Makefile.am elfutils-0.95/lib/Makefile.am --- elfutils-0.95.orig/lib/Makefile.am Sat Jan 17 09:55:35 2004 +++ elfutils-0.95/lib/Makefile.am Sat Jun 19 16:55:19 2004 @@ -21,7 +21,7 @@ if !MUDFLAP picflag = -fpic endif -INCLUDES = -I$(srcdir)/../libelf -I.. +INCLUDES = -I$(srcdir)/../libelf -I.. -I../lincompat -include lincompat.h noinst_LIBRARIES = libeu.a diff -urN elfutils-0.95.orig/libasm/Makefile.am elfutils-0.95/libasm/Makefile.am --- elfutils-0.95.orig/libasm/Makefile.am Wed Jan 21 07:01:53 2004 +++ elfutils-0.95/libasm/Makefile.am Sat Jun 19 16:55:19 2004 @@ -20,7 +20,7 @@ AM_CFLAGS = -Wall -Werror endif INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \ - -I$(top_srcdir)/lib + -I$(top_srcdir)/lib -I../lincompat -include lincompat.h GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) VERSION = 1 @@ -56,7 +56,7 @@ $(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 + ../libebl/libebl.a ../libelf/libelf.so -lc ../lincompat/lincompat.o -lintl ln -fs $@ $@.$(VERSION) diff -urN elfutils-0.95.orig/libdw/Makefile.am elfutils-0.95/libdw/Makefile.am --- elfutils-0.95.orig/libdw/Makefile.am Wed Jan 21 05:20:42 2004 +++ elfutils-0.95/libdw/Makefile.am Sat Jun 19 16:55:19 2004 @@ -19,7 +19,7 @@ else AM_CFLAGS = -Wall -Werror -Wshadow -std=gnu99 endif -INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib +INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib -I../lincompat -include lincompat.h VERSION = 1 lib_LIBRARIES = libdw.a @@ -68,7 +68,7 @@ $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \ -Wl,--soname,$@.$(VERSION),-z,defs \ - ../libelf/libelf.so + ../libelf/libelf.so -lc ../lincompat/lincompat.o -lintl ln -fs $@ $@.$(VERSION) diff -urN elfutils-0.95.orig/libebl/Makefile.am elfutils-0.95/libebl/Makefile.am --- elfutils-0.95.orig/libebl/Makefile.am Fri Apr 2 00:37:14 2004 +++ elfutils-0.95/libebl/Makefile.am Sat Jun 19 16:55:19 2004 @@ -19,7 +19,7 @@ else AM_CFLAGS = -Wall -Werror -Wshadow -fpic endif -INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. +INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. -I../lincompat -include lincompat.h VERSION = 1 PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -69,7 +69,7 @@ libebl_i386.so: libebl_i386_pic.a libebl_i386.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_i386.map \ - -Wl,-z,defs $(libelf) $(libmudflap) + -Wl,-z,defs $(libelf) $(libmudflap) -lc sh_SRCS = sh_init.c sh_destr.c sh_symbol.c @@ -102,7 +102,7 @@ libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) + -Wl,-z,defs $(libelf) $(libmudflap) -lc ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c @@ -157,7 +157,7 @@ libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc.map \ - -Wl,-z,defs $(libelf) $(libmudflap) + -Wl,-z,defs $(libelf) $(libmudflap) -lc ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c @@ -168,7 +168,7 @@ libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ - -Wl,-z,defs $(libelf) $(libmudflap) + -Wl,-z,defs $(libelf) $(libmudflap) -lc %.os: %.c %.o diff -urN elfutils-0.95.orig/libelf/Makefile.am elfutils-0.95/libelf/Makefile.am --- elfutils-0.95.orig/libelf/Makefile.am Fri Jan 23 11:38:49 2004 +++ elfutils-0.95/libelf/Makefile.am Sat Jun 19 16:55:19 2004 @@ -24,7 +24,7 @@ else AM_CFLAGS = -Wall -Werror -Wshadow endif -INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. +INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. -I../lincompat -include lincompat.h GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) VERSION = 1 PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -92,7 +93,8 @@ libelf.so: libelf_pic.a libelf.map $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ - -Wl,--soname,$@.$(VERSION),-z-defs + -Wl,--soname,$@.$(VERSION),-z-defs -lc ../lincompat/lincompat.o \ + -lintl ln -fs $@ $@.$(VERSION) %.os: %.c %.o diff -urN elfutils-0.95.orig/libelf/libelf.h elfutils-0.95/libelf/libelf.h --- elfutils-0.95.orig/libelf/libelf.h Fri Jan 23 11:20:31 2004 +++ elfutils-0.95/libelf/libelf.h Sat Jun 19 16:55:19 2004 @@ -317,7 +317,7 @@ for most recent error or NULL is none occurred. If ERROR is -1 the behaviour is similar to the last case except that not NULL but a legal string is returned. */ -extern const char *elf_errmsg (int __error); +extern const char *elf_errmsg (int); /* Coordinate ELF library and application versions. */ diff -urN elfutils-0.95.orig/lincompat/byteswap.h elfutils-0.95/lincompat/byteswap.h --- elfutils-0.95.orig/lincompat/byteswap.h Thu Jan 1 01:00:00 1970 +++ elfutils-0.95/lincompat/byteswap.h Wed Jun 30 17:07:44 2004 @@ -0,0 +1,9 @@ +#define __bswap_16(x) __bswap16 (x) +#define __bswap_32(x) __bswap32 (x) +#define __bswap_64(x) __bswap64 (x) + +#define bswap_16(x) __bswap16 (x) +#define bswap_32(x) __bswap32 (x) +#define bswap_64(x) __bswap64 (x) + + diff -urN elfutils-0.95.orig/lincompat/endian.h elfutils-0.95/lincompat/endian.h --- elfutils-0.95.orig/lincompat/endian.h Thu Jan 1 01:00:00 1970 +++ elfutils-0.95/lincompat/endian.h Wed Jun 30 17:07:44 2004 @@ -0,0 +1,7 @@ +#include + +# define __LITTLE_ENDIAN LITTLE_ENDIAN +# define __BIG_ENDIAN BIG_ENDIAN +# define __PDP_ENDIAN PDP_ENDIAN +# define __BYTE_ORDER BYTE_ORDER + diff -urN elfutils-0.95.orig/lincompat/error.h elfutils-0.95/lincompat/error.h --- elfutils-0.95.orig/lincompat/error.h Thu Jan 1 01:00:00 1970 +++ elfutils-0.95/lincompat/error.h Wed Jun 30 23:47:33 2004 @@ -0,0 +1,4 @@ +#include + +#define error(x,y,z...) fprintf(stderr, z) + diff -urN elfutils-0.95.orig/lincompat/features.h elfutils-0.95/lincompat/features.h --- elfutils-0.95.orig/lincompat/features.h Thu Jan 1 01:00:00 1970 +++ elfutils-0.95/lincompat/features.h Wed Jun 30 17:07:44 2004 @@ -0,0 +1,2 @@ +/* Nothing */ + diff -urN elfutils-0.95.orig/lincompat/lincompat.c elfutils-0.95/lincompat/lincompat.c --- elfutils-0.95.orig/lincompat/lincompat.c Thu Jan 1 01:00:00 1970 +++ elfutils-0.95/lincompat/lincompat.c Thu Jul 1 00:34:36 2004 @@ -0,0 +1,71 @@ +#include +#include +#include + + + +size_t strnlen(const char *s, size_t maxlen) +{ + size_t i; + for(i=0; i +#include +#include + +wchar_t *wmempcpy(wchar_t *dest, const wchar_t *src, size_t n); +#define __mempcpy(x,y,z) mempcpy(x,y,z) +void *mempcpy(void *dest, const void *src, size_t n); + +size_t strnlen(const char *s, size_t maxlen); + +void tdestroy (void *root, void (*free_node)(void *nodep)); + + +void *rawmemchr (const void *__s, int __c); + +typedef __int64_t off64_t; +#define fstat64 fstat +#define stat64 stat + --- elfutils-0.95/lincompat/Makefile.orig Sun Jul 4 02:44:49 2004 +++ elfutils-0.95/lincompat/Makefile Sun Jul 4 02:37:07 2004 @@ -0,0 +1,5 @@ +all: + gcc -c lincompat.c +install: + + --- elfutils-0.95.orig/libelf/Makefile.am Sun Jul 4 15:32:46 2004 +++ elfutils-0.95/libelf/Makefile.am Sun Jul 4 15:26:23 2004 @@ -36,7 +36,7 @@ noinst_LIBRARIES = libelf_pic.a noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) endif -include_HEADERS = libelf.h gelf.h nlist.h +include_HEADERS = libelf.h nlist.h euincludedir = $(includedir)/elfutils euinclude_HEADERS = elf-knowledge.h @@ -107,6 +107,7 @@ install: install-am libelf.so $(mkinstalldirs) $(DESTDIR)$(libdir) $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so + $(INSTALL_HEADER) patched-gelf.h $(DESTDIR)$(includedir)/gelf.h ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION) ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so @@ -122,7 +123,7 @@ $(addprefix $(srcdir)/,$(libelf_a_SOURCES)) noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ - version_xlate.h dl-hash.h + version_xlate.h dl-hash.h gelf.h EXTRA_DIST = libelf.map CLEANFILES = $(am_libelf_pic_a_OBJECTS) --- elfutils-0.95.orig/libelf/patched-gelf.h Sun Jul 4 15:35:20 2004 +++ elfutils-0.95/libelf/patched-gelf.h Sun Jul 4 15:28:58 2004 @@ -0,0 +1,304 @@ +/* This file defines generic ELF types, structures, and macros. + Copyright (C) 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _GELF_H +#define _GELF_H 1 + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Class independent type definitions. Correctly speaking this is not + true. We assume that 64-bit binaries are the largest class and + therefore all other classes can be represented without loss. */ + +/* Type for a 16-bit quantity. */ +typedef Elf64_Half GElf_Half; + +/* Types for signed and unsigned 32-bit quantities. */ +typedef Elf64_Word GElf_Word; +typedef Elf64_Sword GElf_Sword; + +/* Types for signed and unsigned 64-bit quantities. */ +//typedef Elf64_Xword GElf_Xword; +//typedef Elf64_Sxword GElf_Sxword; + +/* Type of addresses. */ +typedef Elf64_Addr GElf_Addr; + +/* Type of file offsets. */ +typedef Elf64_Off GElf_Off; + + +/* The ELF file header. This appears at the start of every ELF file. */ +typedef Elf64_Ehdr GElf_Ehdr; + +/* Section header. */ +typedef Elf64_Shdr GElf_Shdr; + +/* Section index. */ +/* XXX This should probably be a larger type in preparation of times when + regular section indices can be larger. */ +//typedef Elf64_Section GElf_Section; + +/* Symbol table entry. */ +typedef Elf64_Sym GElf_Sym; + +/* The syminfo section if available contains additional information about + every dynamic symbol. */ +//typedef Elf64_Syminfo GElf_Syminfo; + +/* Relocation table entry without addend (in section of type SHT_REL). */ +//typedef Elf64_Rel GElf_Rel; + +/* Relocation table entry with addend (in section of type SHT_RELA). */ +typedef Elf64_Rela GElf_Rela; + +/* Program segment header. */ +typedef Elf64_Phdr GElf_Phdr; + +/* Dynamic section entry. */ +typedef Elf64_Dyn GElf_Dyn; + + +/* Version definition sections. */ +//typedef Elf64_Verdef GElf_Verdef; + +/* Auxialiary version information. */ +//typedef Elf64_Verdaux GElf_Verdaux; + +/* Version dependency section. */ +//typedef Elf64_Verneed GElf_Verneed; + +/* Auxiliary needed version information. */ +//typedef Elf64_Vernaux GElf_Vernaux; + + +/* Type for version symbol information. */ +//typedef Elf64_Versym GElf_Versym; + + +/* Auxiliary vector. */ +//typedef Elf64_auxv_t GElf_auxv_t; + + +/* Note section contents. */ +//typedef Elf64_Nhdr GElf_Nhdr; + + +/* Move structure. */ +//typedef Elf64_Move GElf_Move; + + +/* Library list structure. */ +//typedef Elf64_Lib GElf_Lib; + + +/* How to extract and insert information held in the st_info field. */ + +#define GELF_ST_BIND(val) ELF64_ST_BIND (val) +#define GELF_ST_TYPE(val) ELF64_ST_TYPE (val) +#define GELF_ST_INFO(bind, type) ELF64_ST_INFO (bind, type) + +/* How to extract information held in the st_other field. */ + +#define GELF_ST_VISIBILITY(val) ELF64_ST_VISIBILITY (val) + + +/* How to extract and insert information held in the r_info field. */ + +#define GELF_R_SYM(info) ELF64_R_SYM (info) +#define GELF_R_TYPE(info) ELF64_R_TYPE (info) +#define GELF_R_INFO(sym, type) ELF64_R_INFO (sym, type) + + +/* How to extract and insert information held in the m_info field. */ +#define GELF_M_SYM(info) ELF64_M_SYM (info) +#define GELF_M_SIZE(info) ELF64_M_SIZE (info) +#define GELF_M_INFO(sym, size) ELF64_M_INFO (sym, size) + + +/* Get class of the file associated with ELF. */ +extern int gelf_getclass (Elf *__elf); + + +/* Return size of array of COUNT elemeents of the type denoted by TYPE + in the external representation. The binary class is taken from ELF. + The result is based on version VERSION of the ELF standard. */ +extern size_t gelf_fsize (Elf *__elf, Elf_Type __type, size_t __count, + unsigned int __version); + +/* Retrieve object file header. */ +extern GElf_Ehdr *gelf_getehdr (Elf *__elf, GElf_Ehdr *__dest); + +/* Update the ELF header. */ +extern int gelf_update_ehdr (Elf *__elf, GElf_Ehdr *__src); + +/* Create new ELF header if none exists. */ +extern unsigned long int gelf_newehdr (Elf *__elf, int __class); + +/* Retrieve section header. */ +extern GElf_Shdr *gelf_getshdr (Elf_Scn *__scn, GElf_Shdr *__dst); + +/* Update section header. */ +extern int gelf_update_shdr (Elf_Scn *__scn, GElf_Shdr *__src); + +/* Retrieve program header table entry. */ +extern GElf_Phdr *gelf_getphdr (Elf *__elf, int __ndx, GElf_Phdr *__dst); + +/* Update the program header. */ +extern int gelf_update_phdr (Elf *__elf, int __ndx, GElf_Phdr *__src); + +/* Create new program header with PHNUM entries. */ +extern unsigned long int gelf_newphdr (Elf *__elf, size_t __phnum); + + +/* Convert data structure from the representation in the file represented + by ELF to their memory representation. */ +extern Elf_Data *gelf_xlatetom (Elf *__elf, Elf_Data *__dest, + const Elf_Data *__src, unsigned int __encode); + +/* Convert data structure from to the representation in memory + represented by ELF file representation. */ +extern Elf_Data *gelf_xlatetof (Elf *__elf, Elf_Data *__dest, + const Elf_Data *__src, unsigned int __encode); + + +/* Retrieve REL relocation info at the given index. */ +//extern GElf_Rel *gelf_getrel (Elf_Data *__data, int __ndx, GElf_Rel *__dst); + +/* Retrieve RELA relocation info at the given index. */ +extern GElf_Rela *gelf_getrela (Elf_Data *__data, int __ndx, GElf_Rela *__dst); + +/* Update REL relocation information at given index. */ +//extern int gelf_update_rel (Elf_Data *__dst, int __ndx, GElf_Rel *__src); + +/* Update RELA relocation information at given index. */ +extern int gelf_update_rela (Elf_Data *__dst, int __ndx, GElf_Rela *__src); + + +/* Retrieve symbol information from the symbol table at the given index. */ +extern GElf_Sym *gelf_getsym (Elf_Data *__data, int __ndx, GElf_Sym *__dst); + +/* Update symbol information in the symbol table at the given index. */ +extern int gelf_update_sym (Elf_Data *__data, int __ndx, GElf_Sym *__src); + + +/* Retrieve symbol information and separate section index from the + symbol table at the given index. */ +extern GElf_Sym *gelf_getsymshndx (Elf_Data *__symdata, Elf_Data *__shndxdata, + int __ndx, GElf_Sym *__sym, + Elf32_Word *__xshndx); + +/* Update symbol information and separate section index in the symbol + table at the given index. */ +extern int gelf_update_symshndx (Elf_Data *__symdata, Elf_Data *__shndxdata, + int __ndx, GElf_Sym *__sym, + Elf32_Word __xshndx); + + +/* Retrieve additional symbol information from the symbol table at the + given index. */ +//extern GElf_Syminfo *gelf_getsyminfo (Elf_Data *__data, int __ndx, +// GElf_Syminfo *__dst); + +/* Update additional symbol information in the symbol table at the + given index. */ +//extern int gelf_update_syminfo (Elf_Data *__data, int __ndx, +// GElf_Syminfo *__src); + + +/* Get information from dynamic table at the given index. */ +extern GElf_Dyn *gelf_getdyn (Elf_Data *__data, int __ndx, GElf_Dyn *__dst); + +/* Update information in dynamic table at the given index. */ +extern int gelf_update_dyn (Elf_Data *__dst, int __ndx, GElf_Dyn *__src); + + +/* Get move structure at the given index. */ +//extern GElf_Move *gelf_getmove (Elf_Data *__data, int __ndx, GElf_Move *__dst); + +/* Update move structure at the given index. */ +//extern int gelf_update_move (Elf_Data *__data, int __ndx, +// GElf_Move *__src); + + +/* Get library from table at the given index. */ +//extern GElf_Lib *gelf_getlib (Elf_Data *__data, int __ndx, GElf_Lib *__dst); + +/* Update library in table at the given index. */ +//extern int gelf_update_lib (Elf_Data *__data, int __ndx, GElf_Lib *__src); + + + +/* Retrieve symbol version information at given index. */ +//extern GElf_Versym *gelf_getversym (Elf_Data *__data, int __ndx, +// GElf_Versym *__dst); + +/* Update symbol version information. */ +//extern int gelf_update_versym (Elf_Data *__data, int __ndx, +// GElf_Versym *__src); + + +/* Retrieve required symbol version information at given offset. */ +//extern GElf_Verneed *gelf_getverneed (Elf_Data *__data, int __offset, +// GElf_Verneed *__dst); + +/* Update required symbol version information. */ +//extern int gelf_update_verneed (Elf_Data *__data, int __offset, +// GElf_Verneed *__src); + +/* Retrieve additional required symbol version information at given offset. */ +//extern GElf_Vernaux *gelf_getvernaux (Elf_Data *__data, int __offset, +// GElf_Vernaux *__dst); + +/* Update additional required symbol version information. */ +//extern int gelf_update_vernaux (Elf_Data *__data, int __offset, +// GElf_Vernaux *__src); + + +/* Retrieve symbol version definition information at given offset. */ +//extern GElf_Verdef *gelf_getverdef (Elf_Data *__data, int __offset, +// GElf_Verdef *__dst); + +/* Update symbol version definition information. */ +//extern int gelf_update_verdef (Elf_Data *__data, int __offset, +// GElf_Verdef *__src); + +/* Retrieve additional symbol version definition information at given + offset. */ +//extern GElf_Verdaux *gelf_getverdaux (Elf_Data *__data, int __offset, +// GElf_Verdaux *__dst); + +/* Update additional symbol version definition information. */ +//extern int gelf_update_verdaux (Elf_Data *__data, int __offset, +// GElf_Verdaux *__src); + + +/* Retrieve uninterpreted chunk of the file contents. */ +extern char *gelf_rawchunk (Elf *__elf, GElf_Off __offset, GElf_Word __size); + +/* Release uninterpreted chunk of the file contents. */ +extern void gelf_freechunk (Elf *__elf, char *__ptr); + +#ifdef __cplusplus +} +#endif + +#endif /* gelf.h */