forked from pool/elfutils
This commit is contained in:
commit
78153ce6bd
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.osc
|
23
build.diff
Normal file
23
build.diff
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
libelf/Makefile.am | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
Index: b/libelf/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- a/libelf/Makefile.am
|
||||||
|
+++ b/libelf/Makefile.am
|
||||||
|
@@ -125,11 +125,12 @@ libelf.so: libelf_pic.a libelf.map
|
||||||
|
else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
-install: install-am libelf.so
|
||||||
|
+install: install-am libelf.so libelf_pic.a
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||||
|
- $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
|
||||||
|
+ $(INSTALL) -m644 libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
|
||||||
|
ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
|
||||||
|
ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so
|
||||||
|
+ $(INSTALL) -m644 libelf_pic.a $(DESTDIR)$(libdir)/libelf_pic.a
|
||||||
|
|
||||||
|
uninstall: uninstall-am
|
||||||
|
rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
|
118
elfutils-0.137-fixes.patch
Normal file
118
elfutils-0.137-fixes.patch
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
--- elfutils-0.137/libdwfl/ChangeLog
|
||||||
|
+++ elfutils-0.137/libdwfl/ChangeLog
|
||||||
|
@@ -1,3 +1,12 @@
|
||||||
|
+2008-08-28 Roland McGrath <roland@redhat.com>
|
||||||
|
+
|
||||||
|
+ * segment.c (reify_segments): Fix last change.
|
||||||
|
+
|
||||||
|
+2008-08-27 Roland McGrath <roland@redhat.com>
|
||||||
|
+
|
||||||
|
+ * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
|
||||||
|
+ failure from pread64.
|
||||||
|
+
|
||||||
|
2008-08-26 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* segment.c (reify_segments): Insert a trailing segment for a module
|
||||||
|
--- elfutils-0.137/libdwfl/linux-proc-maps.c
|
||||||
|
+++ elfutils-0.137/libdwfl/linux-proc-maps.c
|
||||||
|
@@ -267,6 +267,9 @@ read_proc_memory (void *arg, void *data,
|
||||||
|
{
|
||||||
|
const int fd = *(const int *) arg;
|
||||||
|
ssize_t nread = pread64 (fd, data, maxread, (off64_t) address);
|
||||||
|
+ /* Some kernels don't actually let us do this read, ignore those errors. */
|
||||||
|
+ if (nread < 0 && (errno == EINVAL || errno == EPERM))
|
||||||
|
+ return 0;
|
||||||
|
if (nread > 0 && (size_t) nread < minread)
|
||||||
|
nread = 0;
|
||||||
|
return nread;
|
||||||
|
--- elfutils-0.137/libdwfl/segment.c
|
||||||
|
+++ elfutils-0.137/libdwfl/segment.c
|
||||||
|
@@ -175,9 +175,17 @@ reify_segments (Dwfl *dwfl)
|
||||||
|
return true;
|
||||||
|
++idx;
|
||||||
|
}
|
||||||
|
+ else if (dwfl->lookup_addr[idx] < start)
|
||||||
|
+ {
|
||||||
|
+ /* The module starts past the end of this segment.
|
||||||
|
+ Add a new one. */
|
||||||
|
+ if (unlikely (insert (dwfl, idx + 1, start, end, -1)))
|
||||||
|
+ return true;
|
||||||
|
+ ++idx;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (((size_t) idx + 1 == dwfl->lookup_elts
|
||||||
|
- || end < dwfl->lookup_addr[idx + 1])
|
||||||
|
+ if ((size_t) idx + 1 < dwfl->lookup_elts
|
||||||
|
+ && end < dwfl->lookup_addr[idx + 1]
|
||||||
|
/* The module ends in the middle of this segment. Split it. */
|
||||||
|
&& unlikely (insert (dwfl, idx + 1,
|
||||||
|
end, dwfl->lookup_addr[idx + 1], -1)))
|
||||||
|
--- elfutils-0.137/libelf/ChangeLog
|
||||||
|
+++ elfutils-0.137/libelf/ChangeLog
|
||||||
|
@@ -1,3 +1,9 @@
|
||||||
|
+2008-08-27 Roland McGrath <roland@redhat.com>
|
||||||
|
+
|
||||||
|
+ * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
|
||||||
|
+
|
||||||
|
+ * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
|
||||||
|
+
|
||||||
|
2008-08-25 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* Makefile.am (libelf_so_LDLIBS): New variable.
|
||||||
|
--- elfutils-0.137/libelf/elf_begin.c
|
||||||
|
+++ elfutils-0.137/libelf/elf_begin.c
|
||||||
|
@@ -110,8 +110,14 @@ get_shnum (void *map_address, unsigned c
|
||||||
|
} ehdr_mem;
|
||||||
|
bool is32 = e_ident[EI_CLASS] == ELFCLASS32;
|
||||||
|
|
||||||
|
+ // e_shnum shoff
|
||||||
|
+
|
||||||
|
/* Make the ELF header available. */
|
||||||
|
- if (e_ident[EI_DATA] == MY_ELFDATA)
|
||||||
|
+ if (e_ident[EI_DATA] == MY_ELFDATA
|
||||||
|
+ && (ALLOW_UNALIGNED
|
||||||
|
+ || (((size_t) e_ident
|
||||||
|
+ & ((is32 ? __alignof__ (Elf32_Ehdr) : __alignof__ (Elf64_Ehdr))
|
||||||
|
+ - 1)) == 0)))
|
||||||
|
ehdr.p = e_ident;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -130,8 +136,11 @@ get_shnum (void *map_address, unsigned c
|
||||||
|
else
|
||||||
|
memcpy (&ehdr_mem, e_ident, sizeof (Elf32_Ehdr));
|
||||||
|
|
||||||
|
- CONVERT (ehdr_mem.e32.e_shnum);
|
||||||
|
- CONVERT (ehdr_mem.e32.e_shoff);
|
||||||
|
+ if (e_ident[EI_DATA] != MY_ELFDATA)
|
||||||
|
+ {
|
||||||
|
+ CONVERT (ehdr_mem.e32.e_shnum);
|
||||||
|
+ CONVERT (ehdr_mem.e32.e_shoff);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -143,8 +152,11 @@ get_shnum (void *map_address, unsigned c
|
||||||
|
else
|
||||||
|
memcpy (&ehdr_mem, e_ident, sizeof (Elf64_Ehdr));
|
||||||
|
|
||||||
|
- CONVERT (ehdr_mem.e64.e_shnum);
|
||||||
|
- CONVERT (ehdr_mem.e64.e_shoff);
|
||||||
|
+ if (e_ident[EI_DATA] != MY_ELFDATA)
|
||||||
|
+ {
|
||||||
|
+ CONVERT (ehdr_mem.e64.e_shnum);
|
||||||
|
+ CONVERT (ehdr_mem.e64.e_shoff);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--- elfutils-0.137/libelf/libelfP.h
|
||||||
|
+++ elfutils-0.137/libelf/libelfP.h
|
||||||
|
@@ -460,7 +460,7 @@ extern const uint_fast8_t __libelf_type_
|
||||||
|
version, binary class, and type. */
|
||||||
|
extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden;
|
||||||
|
# define __libelf_type_align(class, type) \
|
||||||
|
- (__libelf_type_aligns[LIBELF_EV_IDX][class][type] ?: 1)
|
||||||
|
+ (__libelf_type_aligns[LIBELF_EV_IDX][class - 1][type] ?: 1)
|
||||||
|
#else
|
||||||
|
# define __libelf_type_align(class, type) 1
|
||||||
|
#endif
|
3
elfutils-0.137-no-osl.tar.bz2
Normal file
3
elfutils-0.137-no-osl.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:31018476df6ebcb9b52af698c62c6e626992555fa3e81e24d9b8c59400225d88
|
||||||
|
size 1436096
|
83
elfutils-0.97-ftruncate-mmap-fix.diff
Normal file
83
elfutils-0.97-ftruncate-mmap-fix.diff
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
---
|
||||||
|
libelf/elf_update.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 54 insertions(+)
|
||||||
|
|
||||||
|
Index: b/libelf/elf_update.c
|
||||||
|
===================================================================
|
||||||
|
--- a/libelf/elf_update.c
|
||||||
|
+++ b/libelf/elf_update.c
|
||||||
|
@@ -53,6 +53,7 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <libelf.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
@@ -100,6 +101,33 @@ write_file (Elf *elf, off_t size, int ch
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * We may have truncated the file so lets update the mapping before
|
||||||
|
+ * actually writing to the file.
|
||||||
|
+ */
|
||||||
|
+ /*
|
||||||
|
+ else if (elf->map_address != NULL && elf->parent == NULL
|
||||||
|
+ && (elf->maximum_size != ~((size_t) 0)
|
||||||
|
+ && size != elf->maximum_size))
|
||||||
|
+ {
|
||||||
|
+ void *new_address;
|
||||||
|
+ int ret;
|
||||||
|
+ fprintf(stderr, "sync old: %p\n", elf->map_address);
|
||||||
|
+ ret = msync(elf->map_address, elf->maximum_size, MS_SYNC);
|
||||||
|
+ if (ret)
|
||||||
|
+ perror("msync failed");
|
||||||
|
+ new_address = mremap (elf->map_address, elf->maximum_size,
|
||||||
|
+ size, MREMAP_MAYMOVE);
|
||||||
|
+ if (unlikely (new_address == MAP_FAILED)) {
|
||||||
|
+ __libelf_seterrno (ELF_E_WRITE_ERROR);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fprintf(stderr, "old: %p, new: %p\n", elf->map_address, new_address);
|
||||||
|
+ elf->map_address = new_address;
|
||||||
|
+ }
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
if (elf->map_address != NULL)
|
||||||
|
{
|
||||||
|
/* The file is mmaped. */
|
||||||
|
@@ -141,6 +169,32 @@ write_file (Elf *elf, off_t size, int ch
|
||||||
|
size = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (elf->map_address != NULL && elf->parent == NULL
|
||||||
|
+ && (elf->maximum_size != ~((size_t) 0)
|
||||||
|
+ && (size > 0 && (size_t)size != elf->maximum_size)))
|
||||||
|
+ {
|
||||||
|
+ /*
|
||||||
|
+ * We may have truncated the file so lets update the mapping before
|
||||||
|
+ * actually writing to the file.
|
||||||
|
+ */
|
||||||
|
+ void *new_address;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ fprintf(stderr, "sync old: %p\n", elf->map_address);
|
||||||
|
+ ret = msync(elf->map_address, elf->maximum_size, MS_SYNC);
|
||||||
|
+ if (ret)
|
||||||
|
+ perror("msync failed");
|
||||||
|
+ new_address = mremap (elf->map_address, elf->maximum_size,
|
||||||
|
+ size, MREMAP_MAYMOVE);
|
||||||
|
+ if (unlikely (new_address == MAP_FAILED)) {
|
||||||
|
+ __libelf_seterrno (ELF_E_WRITE_ERROR);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fprintf(stderr, "old: %p, new: %p\n", elf->map_address, new_address);
|
||||||
|
+ elf->map_address = new_address;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (size != -1 && elf->parent == NULL)
|
||||||
|
elf->maximum_size = size;
|
||||||
|
|
11
elfutils-no-po-test-build.diff
Normal file
11
elfutils-no-po-test-build.diff
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- Makefile.am-dist 2007-07-04 12:05:20.000000000 +0200
|
||||||
|
+++ Makefile.am 2007-07-04 12:05:25.000000000 +0200
|
||||||
|
@@ -29,7 +29,7 @@
|
||||||
|
|
||||||
|
# Add doc back when we have some real content.
|
||||||
|
SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
|
||||||
|
- src po tests
|
||||||
|
+ src
|
||||||
|
|
||||||
|
EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
|
||||||
|
|
1099
elfutils-portability.patch
Normal file
1099
elfutils-portability.patch
Normal file
File diff suppressed because it is too large
Load Diff
1544
elfutils-robustify.patch
Normal file
1544
elfutils-robustify.patch
Normal file
File diff suppressed because it is too large
Load Diff
99
elfutils.changes
Normal file
99
elfutils.changes
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 7 15:07:28 CEST 2008 - tiwai@suse.de
|
||||||
|
|
||||||
|
- renamed to libebl1
|
||||||
|
- provides libasm1 package
|
||||||
|
- fix provides and obsolets of libebl1
|
||||||
|
- updated to version 0.137:
|
||||||
|
* libdwfl: bug fixes
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 26 17:52:21 CEST 2008 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to version 0.135:
|
||||||
|
* libdwfl: bug fixes
|
||||||
|
- updated to version 0.134:
|
||||||
|
* libdwfl, libelf: bug fixes
|
||||||
|
- updated to version 0.133:
|
||||||
|
* readelf, elflint, libebl: SHT_GNU_ATTRIBUTE section handling
|
||||||
|
(readelf -A)
|
||||||
|
* libdwfl: bug fixes and optimization in relocation handling
|
||||||
|
- updated to version 0.132:
|
||||||
|
* libcpu: Implement x86 and x86-64 disassembler.
|
||||||
|
* libasm: Add interface for disassembler.
|
||||||
|
- fixed post scripts
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 29 19:17:35 CET 2008 - dmueller@suse.de
|
||||||
|
|
||||||
|
- fix build for older distributions
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jan 28 14:24:36 CET 2008 - tiwai@suse.de
|
||||||
|
|
||||||
|
- fix compile errors regarding missing prototypes.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 20 14:47:20 CET 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- fix off64_t in libelf.h again...
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 20 10:36:32 CET 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to version 0.131
|
||||||
|
* libdw: DW_FORM_ref_addr support
|
||||||
|
dwarf_formref entry point now deprecated
|
||||||
|
bug fixes for oddly-formatted DWARF
|
||||||
|
* libdwfl: bug fixes in offline archive support
|
||||||
|
apply partial relocations for dwfl_module_address_section
|
||||||
|
on ET_REL
|
||||||
|
* libebl: powerpc backend support for Altivec registers
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 22 18:40:18 CEST 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- fix comiple errors regarding missing off64_t definitions
|
||||||
|
in libelf.h
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 22 15:18:07 CEST 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to version 0.129:
|
||||||
|
readelf: new options --hex-dump (or -x), --strings (or -p)
|
||||||
|
- updated to version 0.130
|
||||||
|
* readelf: -p option can take an argument like -x for one
|
||||||
|
section
|
||||||
|
* libelf: new function elf_getdata_rawchunk, replaces
|
||||||
|
gelf_rawchunk;
|
||||||
|
new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
|
||||||
|
* libdwfl: new functions dwfl_build_id_find_elf,
|
||||||
|
dwfl_build_id_find_debuginfo, dwfl_module_build_id,
|
||||||
|
dwfl_module_report_build_id;
|
||||||
|
support dynamic symbol tables found via phdrs;
|
||||||
|
dwfl_standard_find_debuginfo now uses build IDs when available
|
||||||
|
* libebl: backend improvements for sparc, alpha, powerpc
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 4 15:28:43 CEST 2007 - rguenther@suse.de
|
||||||
|
|
||||||
|
- fix build with gcc-4.3, same patch as for the copy in rpm
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 4 12:20:22 CEST 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to version 0.128
|
||||||
|
* auto-tool fixes
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jun 11 01:05:12 CEST 2007 - ro@suse.de
|
||||||
|
|
||||||
|
- use __attribute__ ((gnu_inline)) to fix build with gcc-4.2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon May 21 12:19:46 CEST 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- initial packages, built from elfutils-0.127.
|
||||||
|
A problematic file regarding the license is removed from the
|
||||||
|
tarball.
|
||||||
|
|
354
elfutils.spec
Normal file
354
elfutils.spec
Normal file
@ -0,0 +1,354 @@
|
|||||||
|
#
|
||||||
|
# spec file for package elfutils (Version 0.137)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
# norootforbuild
|
||||||
|
|
||||||
|
|
||||||
|
Name: elfutils
|
||||||
|
License: GPL v2 or later
|
||||||
|
Version: 0.137
|
||||||
|
Release: 1
|
||||||
|
Summary: A collection of utilities and DSOs to handle compiled objects
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
Url: http://elfutils.fedorahosted.org
|
||||||
|
Source: elfutils-%{version}-no-osl.tar.bz2
|
||||||
|
Patch: elfutils-portability.patch
|
||||||
|
Patch1: elfutils-robustify.patch
|
||||||
|
Patch3: elfutils-no-po-test-build.diff
|
||||||
|
Patch7: libebl-prototype-fix.diff
|
||||||
|
Patch8: elfutils-0.97-ftruncate-mmap-fix.diff
|
||||||
|
Patch9: libelf-ignore-NOBITS-sh_offset.patch
|
||||||
|
Patch10: test.diff
|
||||||
|
Patch11: build.diff
|
||||||
|
Patch20: elfutils-0.137-fixes.patch
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
|
%description
|
||||||
|
Elfutils is a collection of utilities, including ld (a linker), nm (for
|
||||||
|
listing symbols from object files), size (for listing the section sizes
|
||||||
|
of an object or archive file), strip (for discarding symbols), readline
|
||||||
|
(the see the raw ELF file structures), and elflint (to check for
|
||||||
|
well-formed ELF files). Also included are numerous helper libraries
|
||||||
|
which implement DWARF, ELF, and machine-specific ELF handling.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Jeff Johnson <jbj@redhat.com>
|
||||||
|
Jakub Jelinek <jakub@redhat.com>
|
||||||
|
Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
%package -n libasm1
|
||||||
|
Summary: A collection of utilities and DSOs to handle compiled objects
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
License: GPL v2 only; GPL v2 or later; LGPL v2.1 or later
|
||||||
|
|
||||||
|
%description -n libasm1
|
||||||
|
Elfutils is a collection of utilities, including ld (a linker), nm (for
|
||||||
|
listing symbols from object files), size (for listing the section sizes
|
||||||
|
of an object or archive file), strip (for discarding symbols), readline
|
||||||
|
(the see the raw ELF file structures), and elflint (to check for
|
||||||
|
well-formed ELF files). Also included are numerous helper libraries
|
||||||
|
which implement DWARF, ELF, and machine-specific ELF handling.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Jeff Johnson <jbj@redhat.com>
|
||||||
|
Jakub Jelinek <jakub@redhat.com>
|
||||||
|
Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
%package -n libasm-devel
|
||||||
|
Summary: A collection of utilities and DSOs to handle compiled objects
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
License: GPL v2 or later
|
||||||
|
Requires: glibc-devel, libasm1 = %{version}
|
||||||
|
|
||||||
|
%description -n libasm-devel
|
||||||
|
Elfutils is a collection of utilities, including ld (a linker), nm (for
|
||||||
|
listing symbols from object files), size (for listing the section sizes
|
||||||
|
of an object or archive file), strip (for discarding symbols), readline
|
||||||
|
(the see the raw ELF file structures), and elflint (to check for
|
||||||
|
well-formed ELF files). Also included are numerous helper libraries
|
||||||
|
which implement DWARF, ELF, and machine-specific ELF handling.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Jeff Johnson <jbj@redhat.com>
|
||||||
|
Jakub Jelinek <jakub@redhat.com>
|
||||||
|
Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
%package -n libebl1
|
||||||
|
Summary: A collection of utilities and DSOs to handle compiled objects
|
||||||
|
Group: Development/Tools/Other
|
||||||
|
License: GPL v2 or later
|
||||||
|
Provides: libebl = %{version}
|
||||||
|
Obsoletes: libebl < %{version}
|
||||||
|
|
||||||
|
%description -n libebl1
|
||||||
|
Elfutils is a collection of utilities, including ld (a linker), nm (for
|
||||||
|
listing symbols from object files), size (for listing the section sizes
|
||||||
|
of an object or archive file), strip (for discarding symbols), readline
|
||||||
|
(the see the raw ELF file structures), and elflint (to check for
|
||||||
|
well-formed ELF files). Also included are numerous helper libraries
|
||||||
|
which implement DWARF, ELF, and machine-specific ELF handling.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Jeff Johnson <jbj@redhat.com>
|
||||||
|
Jakub Jelinek <jakub@redhat.com>
|
||||||
|
Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
%package -n libebl-devel
|
||||||
|
Summary: Include Files and Libraries mandatory for Development
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
License: GPL v2 or later
|
||||||
|
Requires: glibc-devel, libebl1 = %{version}, libdw-devel = %{version}
|
||||||
|
|
||||||
|
%description -n libebl-devel
|
||||||
|
This package contains all necessary include files and libraries needed
|
||||||
|
to develop applications that require these.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ulrich Drepper
|
||||||
|
|
||||||
|
%package -n libelf1
|
||||||
|
Summary: Library to read and write ELF files
|
||||||
|
Group: System/Libraries
|
||||||
|
License: GPL v2 or later
|
||||||
|
|
||||||
|
%description -n libelf1
|
||||||
|
This package provide a high-level library to read and write ELF files.
|
||||||
|
This is a part of elfutils package.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ulrich Drepper
|
||||||
|
|
||||||
|
%package -n libelf-devel
|
||||||
|
Summary: Include Files and Libraries mandatory for Development
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
License: GPL v2 or later
|
||||||
|
Requires: glibc-devel, libelf1 = %{version}
|
||||||
|
Conflicts: libelf0-devel
|
||||||
|
|
||||||
|
%description -n libelf-devel
|
||||||
|
This package contains all necessary include files and libraries needed
|
||||||
|
to develop applications that require these.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%package -n libdw1
|
||||||
|
Summary: Library to access DWARF debugging information
|
||||||
|
Group: System/Libraries
|
||||||
|
License: GPL v2 or later
|
||||||
|
|
||||||
|
%description -n libdw1
|
||||||
|
This package provide a high-level library to access the DWARF debugging
|
||||||
|
information. This is a part of elfutils package.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ulrich Drepper
|
||||||
|
|
||||||
|
%package -n libdw-devel
|
||||||
|
Summary: Include Files and Libraries mandatory for Development.
|
||||||
|
Group: Development/Libraries/C and C++
|
||||||
|
License: GPL v2 or later
|
||||||
|
Requires: glibc-devel, libdw1 = %{version}, libelf-devel = %{version}
|
||||||
|
|
||||||
|
%description -n libdw-devel
|
||||||
|
This package contains all necessary include files and libraries needed
|
||||||
|
to develop applications that require these.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ulrich Drepper
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n elfutils-%{version}
|
||||||
|
%patch -p1
|
||||||
|
%patch1 -p1
|
||||||
|
%patch3
|
||||||
|
%patch7
|
||||||
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
|
#%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
|
%patch20 -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -fi
|
||||||
|
%configure --program-prefix=eu-
|
||||||
|
make
|
||||||
|
|
||||||
|
%install
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
# remove unneeded files
|
||||||
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||||
|
|
||||||
|
%post -n libebl1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%post -n libelf1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%post -n libdw1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -n libebl1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -n libelf1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -n libdw1 -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc AUTHORS ChangeLog COPYING EXCEPTION NEWS NOTES README THANKS TODO
|
||||||
|
%{_bindir}/*
|
||||||
|
|
||||||
|
%files -n libasm1
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libasm.so.*
|
||||||
|
%{_libdir}/libasm-%{version}.so
|
||||||
|
|
||||||
|
%files -n libasm-devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libasm.so
|
||||||
|
%{_libdir}/libasm.a
|
||||||
|
%dir %{_includedir}/elfutils
|
||||||
|
%{_includedir}/elfutils/libasm.h
|
||||||
|
|
||||||
|
%files -n libebl1
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/elfutils
|
||||||
|
|
||||||
|
%files -n libebl-devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libebl.a
|
||||||
|
%dir %{_includedir}/elfutils
|
||||||
|
%{_includedir}/elfutils/libebl.h
|
||||||
|
|
||||||
|
%files -n libelf1
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libelf.so.*
|
||||||
|
%{_libdir}/libelf-%{version}.so
|
||||||
|
|
||||||
|
%files -n libelf-devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libelf.so
|
||||||
|
%{_libdir}/libelf.a
|
||||||
|
%{_libdir}/libelf_pic.a
|
||||||
|
%{_includedir}/libelf.h
|
||||||
|
%{_includedir}/gelf.h
|
||||||
|
%{_includedir}/nlist.h
|
||||||
|
%dir %{_includedir}/elfutils
|
||||||
|
%{_includedir}/elfutils/elf-knowledge.h
|
||||||
|
|
||||||
|
%files -n libdw1
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libdw.so.*
|
||||||
|
%{_libdir}/libdw-%{version}.so
|
||||||
|
|
||||||
|
%files -n libdw-devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_libdir}/libdw.a
|
||||||
|
%{_libdir}/libdw.so
|
||||||
|
%{_includedir}/dwarf.h
|
||||||
|
%dir %{_includedir}/elfutils
|
||||||
|
%{_includedir}/elfutils/libdw.h
|
||||||
|
%{_includedir}/elfutils/libdwfl.h
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Tue Oct 07 2008 tiwai@suse.de
|
||||||
|
- renamed to libebl1
|
||||||
|
- provides libasm1 package
|
||||||
|
- fix provides and obsolets of libebl1
|
||||||
|
- updated to version 0.137:
|
||||||
|
* libdwfl: bug fixes
|
||||||
|
* Tue Aug 26 2008 tiwai@suse.de
|
||||||
|
- updated to version 0.135:
|
||||||
|
* libdwfl: bug fixes
|
||||||
|
- updated to version 0.134:
|
||||||
|
* libdwfl, libelf: bug fixes
|
||||||
|
- updated to version 0.133:
|
||||||
|
* readelf, elflint, libebl: SHT_GNU_ATTRIBUTE section handling
|
||||||
|
(readelf -A)
|
||||||
|
* libdwfl: bug fixes and optimization in relocation handling
|
||||||
|
- updated to version 0.132:
|
||||||
|
* libcpu: Implement x86 and x86-64 disassembler.
|
||||||
|
* libasm: Add interface for disassembler.
|
||||||
|
- fixed post scripts
|
||||||
|
* Fri Feb 29 2008 dmueller@suse.de
|
||||||
|
- fix build for older distributions
|
||||||
|
* Mon Jan 28 2008 tiwai@suse.de
|
||||||
|
- fix compile errors regarding missing prototypes.
|
||||||
|
* Tue Nov 20 2007 tiwai@suse.de
|
||||||
|
- fix off64_t in libelf.h again...
|
||||||
|
* Tue Nov 20 2007 tiwai@suse.de
|
||||||
|
- updated to version 0.131
|
||||||
|
* libdw: DW_FORM_ref_addr support
|
||||||
|
dwarf_formref entry point now deprecated
|
||||||
|
bug fixes for oddly-formatted DWARF
|
||||||
|
* libdwfl: bug fixes in offline archive support
|
||||||
|
apply partial relocations for dwfl_module_address_section
|
||||||
|
on ET_REL
|
||||||
|
* libebl: powerpc backend support for Altivec registers
|
||||||
|
* Mon Oct 22 2007 tiwai@suse.de
|
||||||
|
- fix comiple errors regarding missing off64_t definitions
|
||||||
|
in libelf.h
|
||||||
|
* Mon Oct 22 2007 tiwai@suse.de
|
||||||
|
- updated to version 0.129:
|
||||||
|
readelf: new options --hex-dump (or -x), --strings (or -p)
|
||||||
|
- updated to version 0.130
|
||||||
|
* readelf: -p option can take an argument like -x for one
|
||||||
|
section
|
||||||
|
* libelf: new function elf_getdata_rawchunk, replaces
|
||||||
|
gelf_rawchunk;
|
||||||
|
new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
|
||||||
|
* libdwfl: new functions dwfl_build_id_find_elf,
|
||||||
|
dwfl_build_id_find_debuginfo, dwfl_module_build_id,
|
||||||
|
dwfl_module_report_build_id;
|
||||||
|
support dynamic symbol tables found via phdrs;
|
||||||
|
dwfl_standard_find_debuginfo now uses build IDs when available
|
||||||
|
* libebl: backend improvements for sparc, alpha, powerpc
|
||||||
|
* Thu Oct 04 2007 rguenther@suse.de
|
||||||
|
- fix build with gcc-4.3, same patch as for the copy in rpm
|
||||||
|
* Wed Jul 04 2007 tiwai@suse.de
|
||||||
|
- updated to version 0.128
|
||||||
|
* auto-tool fixes
|
||||||
|
* Mon Jun 11 2007 ro@suse.de
|
||||||
|
- use __attribute__ ((gnu_inline)) to fix build with gcc-4.2
|
||||||
|
* Mon May 21 2007 tiwai@suse.de
|
||||||
|
- initial packages, built from elfutils-0.127.
|
||||||
|
A problematic file regarding the license is removed from the
|
||||||
|
tarball.
|
28
libebl-prototype-fix.diff
Normal file
28
libebl-prototype-fix.diff
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
--- libebl/eblopenbackend.c-dist 2008-01-28 14:21:23.000000000 +0100
|
||||||
|
+++ libebl/eblopenbackend.c 2008-01-28 14:21:39.000000000 +0100
|
||||||
|
@@ -253,10 +253,7 @@ fill_defaults (Ebl *result)
|
||||||
|
|
||||||
|
/* Find an appropriate backend for the file associated with ELF. */
|
||||||
|
static Ebl *
|
||||||
|
-openbackend (elf, emulation, machine)
|
||||||
|
- Elf *elf;
|
||||||
|
- const char *emulation;
|
||||||
|
- GElf_Half machine;
|
||||||
|
+openbackend (Elf *elf, const char *emulation, GElf_Half machine)
|
||||||
|
{
|
||||||
|
Ebl *result;
|
||||||
|
size_t cnt;
|
||||||
|
--- lib/dynamicsizehash.c-dist 2008-01-28 14:25:32.000000000 +0100
|
||||||
|
+++ lib/dynamicsizehash.c 2008-01-28 14:25:52.000000000 +0100
|
||||||
|
@@ -65,10 +65,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
static size_t
|
||||||
|
-lookup (htab, hval, val)
|
||||||
|
- NAME *htab;
|
||||||
|
- unsigned long int hval;
|
||||||
|
- TYPE val __attribute__ ((unused));
|
||||||
|
+lookup (NAME *htab, unsigned long int hval, TYPE val __attribute__((unused)))
|
||||||
|
{
|
||||||
|
/* First hash function: simply take the modul but prevent zero. */
|
||||||
|
size_t idx = 1 + hval % htab->size;
|
24
libelf-ignore-NOBITS-sh_offset.patch
Normal file
24
libelf-ignore-NOBITS-sh_offset.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
libelf/elf32_updatenull.c | 9 +++++----
|
||||||
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
Index: b/libelf/elf32_updatenull.c
|
||||||
|
===================================================================
|
||||||
|
--- a/libelf/elf32_updatenull.c
|
||||||
|
+++ b/libelf/elf32_updatenull.c
|
||||||
|
@@ -331,10 +331,11 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
|
||||||
|
if (elf->flags & ELF_F_LAYOUT)
|
||||||
|
{
|
||||||
|
- size = MAX ((GElf_Word) size,
|
||||||
|
- shdr->sh_offset
|
||||||
|
- + (shdr->sh_type != SHT_NOBITS
|
||||||
|
- ? shdr->sh_size : 0));
|
||||||
|
+ /* Even the sh_offset is only the "conceptual" possition
|
||||||
|
+ in the file. So completely ignore NOBITS sections. */
|
||||||
|
+ if (shdr->sh_type != SHT_NOBITS)
|
||||||
|
+ size = MAX ((GElf_Word) size,
|
||||||
|
+ shdr->sh_offset + shdr->sh_size);
|
||||||
|
|
||||||
|
/* The alignment must be a power of two. This is a
|
||||||
|
requirement from the ELF specification. Additionally
|
126
test.diff
Normal file
126
test.diff
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
---
|
||||||
|
libelf/elf32_updatenull.c | 35 +++++++++++++++++++++++++++++++----
|
||||||
|
1 file changed, 31 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
Index: b/libelf/elf32_updatenull.c
|
||||||
|
===================================================================
|
||||||
|
--- a/libelf/elf32_updatenull.c
|
||||||
|
+++ b/libelf/elf32_updatenull.c
|
||||||
|
@@ -55,6 +55,7 @@
|
||||||
|
#include <assert.h>
|
||||||
|
#include <endian.h>
|
||||||
|
#include <libelf.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
@@ -144,7 +145,7 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* At least the ELF header is there. */
|
||||||
|
- off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
|
||||||
|
+ off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1), old_size;
|
||||||
|
|
||||||
|
/* Set the program header position. */
|
||||||
|
if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL
|
||||||
|
@@ -166,9 +167,12 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
{
|
||||||
|
/* The user is supposed to fill out e_phoff. Use it and
|
||||||
|
e_phnum to determine the maximum extend. */
|
||||||
|
+ old_size = size;
|
||||||
|
size = MAX ((size_t) size,
|
||||||
|
ehdr->e_phoff
|
||||||
|
+ elf_typesize (LIBELFBITS, ELF_T_PHDR, ehdr->e_phnum));
|
||||||
|
+ fprintf(stderr, "e_phoff: old=%ld, new=%ld\n", (long) old_size,
|
||||||
|
+ (long) size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -176,8 +180,11 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
elf_typesize (LIBELFBITS, ELF_T_EHDR, 1),
|
||||||
|
ehdr_flags);
|
||||||
|
|
||||||
|
+ old_size = size;
|
||||||
|
/* We need no alignment here. */
|
||||||
|
size += elf_typesize (LIBELFBITS, ELF_T_PHDR, ehdr->e_phnum);
|
||||||
|
+ fprintf(stderr, "e_phnum: old=%ld, new=%ld\n", (long) old_size,
|
||||||
|
+ (long) size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -334,9 +341,13 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
/* Even the sh_offset is only the "conceptual" possition
|
||||||
|
in the file. So completely ignore NOBITS sections. */
|
||||||
|
if (shdr->sh_type != SHT_NOBITS)
|
||||||
|
- size = MAX ((GElf_Word) size,
|
||||||
|
- shdr->sh_offset + shdr->sh_size);
|
||||||
|
-
|
||||||
|
+ {
|
||||||
|
+ old_size = size;
|
||||||
|
+ size = MAX ((GElf_Word) size,
|
||||||
|
+ shdr->sh_offset + shdr->sh_size);
|
||||||
|
+ fprintf(stderr, "sh_offset: old=%ld, new=%ld\n",
|
||||||
|
+ (long) old_size, (long) size);
|
||||||
|
+ }
|
||||||
|
/* The alignment must be a power of two. This is a
|
||||||
|
requirement from the ELF specification. Additionally
|
||||||
|
we test for the alignment of the section being large
|
||||||
|
@@ -355,7 +366,11 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
update_if_changed (shdr->sh_addralign, sh_align,
|
||||||
|
scn->shdr_flags);
|
||||||
|
|
||||||
|
+ old_size = size;
|
||||||
|
size = (size + sh_align - 1) & ~(sh_align - 1);
|
||||||
|
+ fprintf(stderr, "sh_align: old=%ld, new=%ld\n",
|
||||||
|
+ (long) old_size, (long) size);
|
||||||
|
+
|
||||||
|
int offset_changed = 0;
|
||||||
|
update_if_changed (shdr->sh_offset, (GElf_Word) size,
|
||||||
|
offset_changed);
|
||||||
|
@@ -373,8 +388,11 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
update_if_changed (shdr->sh_size, (GElf_Word) offset,
|
||||||
|
changed);
|
||||||
|
|
||||||
|
+ old_size = size;
|
||||||
|
if (shdr->sh_type != SHT_NOBITS)
|
||||||
|
size += offset;
|
||||||
|
+ fprintf(stderr, "sh_size: old=%ld, new=%ld\n",
|
||||||
|
+ (long) old_size, (long) size);
|
||||||
|
|
||||||
|
scn->flags |= changed;
|
||||||
|
}
|
||||||
|
@@ -401,9 +419,12 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
{
|
||||||
|
/* The user is supposed to fill out e_phoff. Use it and
|
||||||
|
e_phnum to determine the maximum extend. */
|
||||||
|
+ old_size = size;
|
||||||
|
size = MAX ((GElf_Word) size,
|
||||||
|
(ehdr->e_shoff
|
||||||
|
+ (elf_typesize (LIBELFBITS, ELF_T_SHDR, shnum))));
|
||||||
|
+ fprintf(stderr, "e_shoff: old=%ld, new=%ld\n", (long) old_size,
|
||||||
|
+ (long) size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -413,7 +434,10 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
want to be surprised by architectures with less strict
|
||||||
|
alignment rules. */
|
||||||
|
#define SHDR_ALIGN sizeof (ElfW2(LIBELFBITS,Off))
|
||||||
|
+ old_size = size;
|
||||||
|
size = (size + SHDR_ALIGN - 1) & ~(SHDR_ALIGN - 1);
|
||||||
|
+ fprintf(stderr, "e_shoff(align): old=%ld, new=%ld\n",
|
||||||
|
+ (long) old_size, (long) size);
|
||||||
|
|
||||||
|
update_if_changed (ehdr->e_shoff, (GElf_Word) size, elf->flags);
|
||||||
|
update_if_changed (ehdr->e_shentsize,
|
||||||
|
@@ -421,7 +445,10 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf
|
||||||
|
ehdr_flags);
|
||||||
|
|
||||||
|
/* Account for the section header size. */
|
||||||
|
+ old_size = size;
|
||||||
|
size += elf_typesize (LIBELFBITS, ELF_T_SHDR, shnum);
|
||||||
|
+ fprintf(stderr, "shnum: old=%ld, new=%ld\n", (long) old_size,
|
||||||
|
+ (long) size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user