]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Lock down libelf and elflint a bit more after import of Roland's changes.
authorUlrich Drepper <drepper@redhat.com>
Mon, 18 Dec 2006 22:38:08 +0000 (22:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 18 Dec 2006 22:38:08 +0000 (22:38 +0000)
NEWS
config/elfutils.spec.in
configure.ac
libdw/dwarf_getlocation.c
libelf/ChangeLog
libelf/elf32_updatenull.c
libelf/elf_error.c
src/ChangeLog
src/elflint.c
tests/Makefile.am
tests/msg_tst.c

diff --git a/NEWS b/NEWS
index d8fce7785bac2f5fc510942b40d304c44f08cce8..095bebb3055cd01c530e90602612437a74cc88e9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Version 0.125:
+
+elflint: Compare DT_GNU_HASH tests.
+
+move archives into -static RPMs
+
+libelf, elflint: better support for core file handling
+
 Version 0.124:
 
 libebl: sparc backend support for return value location
index 5775615852f3987aa068fc43608d03935585c23d..770ea8849cdd5e8bd5f08e2e7ebcf843aa6e0155 100644 (file)
@@ -43,6 +43,15 @@ higher-level ELF access functionality.  libdw provides access to
 the DWARF debugging information.  libasm provides a programmable
 assembler interface.
 
+%package devel-static
+Summary: Static archives to handle compiled objects.
+Group: Development/Tools
+Requires: elfutils-devel = %{version}-%{release}
+
+%description devel-static
+The elfutils-devel-static archive contains the static archives
+with the code the handle compiled objects.
+
 %package libelf
 Summary: Library to read and write ELF files.
 Group: Development/Tools
@@ -65,6 +74,16 @@ applications for handling compiled objects.  libelf allows you to
 access the internals of the ELF object file format, so you can see the
 different sections of an ELF file.
 
+%package libelf-devel-static
+Summary: Static archive of libelf
+Group: Development/Tools
+Requires: elfutils-libelf-devel = %{version}-%{release}
+Conflicts: libelf-devel
+
+%description libelf-devel-static
+The elfutils-libelf-static package contains the static archive
+for libelf.
+
 %prep
 %setup -q
 
@@ -118,6 +137,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_bindir}/eu-elfcmp
 %{_bindir}/eu-ranlib
 %{_bindir}/eu-strings
+%{_bindir}/eu-objdump
 #%{_bindir}/eu-ld
 #%{_libdir}/libasm-%{version}.so
 %{_libdir}/libdw-%{version}.so
@@ -134,12 +154,14 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_includedir}/elfutils/libebl.h
 %{_includedir}/elfutils/libdw.h
 %{_includedir}/elfutils/libdwfl.h
-#%{_libdir}/libasm.a
 %{_libdir}/libebl.a
-%{_libdir}/libdw.a
 #%{_libdir}/libasm.so
 %{_libdir}/libdw.so
 
+%files devel-static
+%{_libdir}/libdw.a
+#%{_libdir}/libasm.a
+
 %files libelf
 %defattr(-,root,root)
 %{_libdir}/libelf-%{version}.so
@@ -150,10 +172,16 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_includedir}/libelf.h
 %{_includedir}/gelf.h
 %{_includedir}/nlist.h
-%{_libdir}/libelf.a
 %{_libdir}/libelf.so
 
+%files libelf-devel-static
+%{_libdir}/libelf.a
+
 %changelog
+* Mon Dec 18 2006 Ulrich Drepper <drepper@redhat.com> 0.125-1
+- elflint: Compare DT_GNU_HASH tests.
+- move archives into -static RPMs
+
 * Tue Oct 10 2006 Ulrich Drepper <drepper@redhat.com> 0.124-1
 - libebl: sparc backend support for return value location
 - libebl, libdwfl: backend register name support extended with more info
index f3644f362eca965831b86124832698e2a1661954..4c4ade1e1967bbf9eb69f5e7a7c1f17cb5f629f8 100644 (file)
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software Foundation,
 dnl Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 dnl
-AC_INIT([Red Hat elfutils],[0.124],[http://bugzilla.redhat.com/bugzilla/],
+AC_INIT([Red Hat elfutils],[0.125],[http://bugzilla.redhat.com/bugzilla/],
        [elfutils])
 
 AC_CONFIG_AUX_DIR([config])
index cefd052b3cc2e0ef6ec6a5b1f8e1cf4883ac34ba..f680aa9692e3673c66935c763be0f9186834d226 100644 (file)
@@ -471,13 +471,13 @@ dwarf_getlocation_addr (attr, address, llbufs, listlens, maxlocs)
                                                             &attr_mem),
                                         &base) != 0)
            {
-             if (INTUSE(dwarf_errno) () == 0)
-               /* The compiler provided no base address when it should
-                  have.  Buggy GCC does this when it used absolute
-                  addresses in the location list and no DW_AT_ranges.  */
-               base = 0;
-             else
+             if (INTUSE(dwarf_errno) () != 0)
                return -1;
+
+             /* The compiler provided no base address when it should
+                have.  Buggy GCC does this when it used absolute
+                addresses in the location list and no DW_AT_ranges.  */
+             base = 0;
            }
        }
 
index 9ff24df2d056a34672fade54a6f10a2b10d7c79f..f3cf689723eeccdfeec5dfccfd66c7732bf8fa07 100644 (file)
@@ -1,8 +1,6 @@
 2006-10-13  Roland McGrath  <roland@redhat.com>
 
-       * elf32_updatenull.c: Look for phdr if e_phnum nonzero, regardless of
-       e_type.  Diagnose ELF_E_INVALID_PHDR only for ET_REL, and not
-       if ELF_F_PERMISSIVE.
+       * elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
        * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
 
 2006-08-29  Roland McGrath  <roland@redhat.com>
index 0de48beaf3942e05572b5a772f41e7170bc44035..b3299fe41f45879e65f7741d01b27fbfff82b4d7 100644 (file)
@@ -147,13 +147,16 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf, int *change_bop, size_t shnum)
   off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
 
   /* Set the program header position.  */
-  if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL && ehdr->e_phnum != 0)
+  if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL
+      && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN
+         || ehdr->e_type == ET_CORE))
     (void) INTUSE(elfw2(LIBELFBITS,getphdr)) (elf);
   if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL)
     {
-      /* Only executables or shared objects have a program header.  */
-      if (unlikely (ehdr->e_type == ET_REL)
-         && (elf->flags & ELF_F_PERMISSIVE) == 0)
+      /* Only executables, shared objects, and core files have a program
+        header.  */
+      if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
+         && unlikely (ehdr->e_type != ET_CORE))
        {
          __libelf_seterrno (ELF_E_INVALID_PHDR);
          return -1;
index 3161b8b8bb4aacb573e5d0143488dde22ce6e432..5e00372aa2661f5e7c2adf8885da1576bf428adf 100644 (file)
@@ -270,11 +270,13 @@ static const char msgstr[] =
 #define ELF_E_INVALID_PHDR_IDX \
   (ELF_E_GROUP_NOT_REL_IDX \
    + sizeof "only relocatable files can contain section groups")
-  N_("program header not allowed in relocatable files")
+  N_("program header only allowed in executables, shared objects, and \
+core files")
   "\0"
 #define ELF_E_NO_PHDR_IDX \
   (ELF_E_INVALID_PHDR_IDX \
-   + sizeof "program header not allowed in relocatable files")
+   + sizeof "program header only allowed in executables, shared objects, and \
+core files")
   N_("file has no program header")
   "\0"
 #define ELF_E_INVALID_OFFSET_IDX \
index 190c673266de18dd69aa6ea5cf42f6cebba86eeb..58db2243fa9c2c8295f818cbc47dc5a32a3ecaaa 100644 (file)
@@ -7,7 +7,7 @@
 2006-10-31  Roland McGrath  <roland@redhat.com>
 
        * elflint.c (check_program_header): Don't complain about
-       p_filesz > p_memsz if p_memsz is zero and p_type is not PT_LOAD.
+       p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
 
 2006-09-19  Jakub Jelinek  <jakub@redhat.com>
 
index 06930ca8f5de23c249aac820f85352998a370d9a..7a50a21ba6ba00432bfac64948ef3a52c182e2ea 100644 (file)
@@ -3830,7 +3830,7 @@ program header offset in ELF header and PHDR entry do not match"));
        }
 
       if (phdr->p_filesz > phdr->p_memsz
-         && (phdr->p_memsz != 0 || phdr->p_type == PT_LOAD))
+         && (phdr->p_memsz != 0 || phdr->p_type != PT_NOTE))
        ERROR (gettext ("\
 program header entry %d: file size greater than memory size\n"),
               cnt);
index ab17761adba4bbcb9190e6511e006e26041fba86..bc46c42e5695efeb5792f06af97d5736f1baca07 100644 (file)
@@ -34,6 +34,7 @@ AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
            $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
 BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
 endif
+CFLAGS := $(filter-out -Wall,$(CFLAGS))
 
 AM_LDFLAGS =
 
index 36debbe4a12a9d9942e52c7dbc4e57b206fa874e..db078533fdf419eba4ef8ba2b4777ef1964b6035 100644 (file)
@@ -79,7 +79,8 @@ static struct
     { ELF_E_GROUP_NOT_REL,
       "only relocatable files can contain section groups" },
     { ELF_E_INVALID_PHDR,
-      "program header not allowed in relocatable files" },
+      "program header only allowed in executables, shared objects, \
+and core files" },
     { ELF_E_NO_PHDR, "file has no program header" },
     { ELF_E_INVALID_OFFSET, "invalid offset" }
   };