Resolve conflicts.
authorjbj <devnull@localhost>
Thu, 7 Nov 2002 13:18:27 +0000 (13:18 +0000)
committerjbj <devnull@localhost>
Thu, 7 Nov 2002 13:18:27 +0000 (13:18 +0000)
CVS patchset: 5837
CVS date: 2002/11/07 13:18:27

elfutils/Makefile.am
elfutils/configure.ac
elfutils/libdwarf/dwarf_srcfiles.c
elfutils/libdwarf/dwarf_srclines.c
elfutils/libebl/Makefile.am
elfutils/libelf/elf32_getphdr.c
elfutils/libelf/elf_end.c
elfutils/libelf/elf_update.c
elfutils/libelf/gelf.h
elfutils/libelf/gelf_update_versym.c

index bf408ee..afbdef5 100644 (file)
@@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = m4 doc lib libltdl libelf libebl libdwarf libelf-po libebl-po libdwarf-po po
 
-EXTRA_DIST = splint.rc elfutils.spec.in GPG-KEY NOTES
+EXTRA_DIST = config.rpath splint.rc elfutils.spec GPG-KEY NOTES
 
 distcheck-hook:
        chmod -R u+w $(distdir)
index 0cfce4a..ea118a0 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl
-AC_INIT([elfutils],[0.53],[drepper@redhat.com],[elfutils])
+AC_INIT([elfutils],[0.54],[drepper@redhat.com],[elfutils])
 AM_INIT_AUTOMAKE([gnits 1.6.3 dist-bzip2])
 AC_COPYRIGHT([Copyright (C) 1996-2001, 2002 Red Hat, Inc.])
 AC_CONFIG_SRCDIR([libelf/elf_begin.c])
index 43b6259..85f4174 100644 (file)
@@ -318,7 +318,10 @@ dwarf_srcfiles (Dwarf_Die die, char ***srcfiles, Dwarf_Signed *srcfilecount,
   /* Next the include directories and the file names.  */
   if (unlikely (read_file_names (dbg, comp_dir, &linep, srcfiles, srcfilecount,
                                 error) != DW_DLV_OK))
-    return DW_DLV_ERROR;
+    {
+      dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
+      return DW_DLV_ERROR;
+    }
 
   /* Consistency check.  */
   if (unlikely (linep != header_start + header_length))
@@ -329,9 +332,12 @@ dwarf_srcfiles (Dwarf_Die die, char ***srcfiles, Dwarf_Signed *srcfilecount,
        dwarf_dealloc (dbg, (*srcfiles)[i], DW_DLA_STRING);
       dwarf_dealloc (dbg, *srcfiles, DW_DLA_LIST);
 
+      dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
       __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
       return DW_DLV_ERROR;
     }
 
+  dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
+
   return DW_DLV_OK;
 }
index 8db6dc1..4fa3805 100644 (file)
@@ -311,6 +311,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
       get_uleb128 (diridx, linep);
       if (unlikely (diridx >= ndirlist))
        {
+         dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
          __libdwarf_error (dbg, error, DW_E_INVALID_DIR_IDX);
          return DW_DLV_ERROR;
        }
@@ -339,6 +340,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
       if (new_file->name == NULL)
        {
          /* XXX Should we bother to free all the memory?  */
+         dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
          __libdwarf_error (dbg, error, DW_E_NOMEM);
          return DW_DLV_ERROR;
        }
@@ -358,6 +360,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
   /* Consistency check.  */
   if (unlikely (linep != header_start + header_length))
     {
+      dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
       __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
       return DW_DLV_ERROR;
     }
@@ -491,6 +494,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
                  }
                if (new_file->name == NULL)
                  {
+                   dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                    __libdwarf_error (dbg, error, DW_E_NOMEM);
                    return DW_DLV_ERROR;
                  }
@@ -519,6 +523,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -541,6 +546,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 1))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -554,6 +560,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 1))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -567,6 +574,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 1))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -580,6 +588,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 1))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -593,6 +602,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -605,6 +615,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -617,6 +628,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -630,6 +642,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 1))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -643,6 +656,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -655,6 +669,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
              if (unlikely (standard_opcode_lengths[opcode] != 0))
                {
                  /* XXX Free memory.  */
+                 dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
                  __libdwarf_error (dbg, error, DW_E_INVALID_DWARF);
                  return DW_DLV_ERROR;
                }
@@ -688,6 +703,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
   if (files == NULL)
     {
       /* XXX Should we bother to free all the memory?  */
+      dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
       __libdwarf_error (dbg, error, DW_E_NOMEM);
       return DW_DLV_ERROR;
     }
@@ -708,6 +724,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
   lines = (Dwarf_Line *) malloc (nlinelist * sizeof (Dwarf_Line));
   if (lines == NULL)
     {
+      dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
       __libdwarf_error (dbg, error, DW_E_NOMEM);
       return DW_DLV_ERROR;
     }
@@ -722,5 +739,7 @@ dwarf_srclines (Dwarf_Die die, Dwarf_Line **linebuf, Dwarf_Signed *linecount,
       linelist = linelist->next;
     }
 
+  dwarf_dealloc (dbg, stmt_list, DW_DLA_ATTR);
+
   return DW_DLV_OK;
 }
index df654fd..12ed504 100644 (file)
@@ -21,20 +21,16 @@ AM_CFLAGS = -Wall -Werror -DOBJDIR=\"$(shell pwd)\"
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. \
           $(INCLTDL)
 
-LINT = splint
+lib_LTLIBRARIES = libebl.la
+pkglib_LTLIBRARIES = libebl_i386.la libebl_sh.la libebl_mips.la \
+                    libebl_x86_64.la
 
-#lib_LTLIBRARIES = libebl.la
-#pkglib_LTLIBRARIES = libebl_i386.la libebl_sh.la libebl_mips.la
-noinst_LTLIBRARIES = libebl.la \
-               libebl_i386.la libebl_sh.la libebl_mips.la
+euincludedir = $(includedir)/elfutils
+euinclude_HEADERS = libebl.h elf-knowledge.h
 
-euincludedir = ${includedir}/elfutils
-#euinclude_HEADERS = libebl.h elf-knowledge.h
+noinst_HEADERS = libeblP.h $(pkglib_LTLIBRARIES:%.la=%.h)
 
-noinst_HEADERS = libeblP.h libebl_i386.h libebl_sh.h libebl_mips.h \
-               libebl.h elf-knowledge.h
-
-EXTRA_DIST = libebl.map libebl_i386.map libebl_sh.map libebl_mips.map
+EXTRA_DIST = libebl.map $(pkglib_LTLIBRARIES:%.la=%.map)
 
 libebl_la_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
                    eblreloctypename.c eblsegmenttypename.c \
@@ -62,7 +58,7 @@ libebl_mips_la_SOURCES = mips_init.c mips_destr.c mips_symbol.c
 libebl_mips_la_LDFLAGS = -module -Wl,--version-script,$(srcdir)/libebl_mips.map
 libebl_mips_la_DEPENDENCIES = libebl_mips.map
 
-.PSEUDO: lint
-lint:
-       $(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \
-               $(addprefix $(srcdir)/,$(libebl_la_SOURCES))
+libebl_x86_64_la_SOURCES = x86_64_init.c x86_64_destr.c x86_64_symbol.c
+libebl_x86_64_la_LDFLAGS = -module \
+                          -Wl,--version-script,$(srcdir)/libebl_x86_64.map
+libebl_x86_64_la_DEPENDENCIES = libebl_x86_64.map
index 0ac3076..b38f41a 100644 (file)
@@ -51,7 +51,7 @@ elfw2(LIBELFBITS,getphdr) (Elf *elf)
 
   if (elf->class == 0)
     elf->class = ELFW(ELFCLASS,LIBELFBITS);
-  else if (elf->class == ELFW(ELFCLASS,LIBELFBITS))
+  else if (elf->class != ELFW(ELFCLASS,LIBELFBITS))
     {
       __libelf_seterrno (ELF_E_INVALID_CLASS);
       result = NULL;
index 424b4de..123cb07 100644 (file)
@@ -47,7 +47,7 @@ elf_end (Elf *elf)
       return result;
     }
 
-  if (elf->kind == ELF_K_AR && elf->state.ar.children != NULL)
+  if (elf->kind == ELF_K_AR)
     {
       /* We cannot remove the descriptor now since we still have some
         descriptors which depend on it.  But we can free the archive
@@ -57,7 +57,9 @@ elf_end (Elf *elf)
         into this array.  */
       free (elf->state.ar.ar_sym);
       elf->state.ar.ar_sym = NULL;
-      return 0;
+
+      if (elf->state.ar.children != NULL)
+       return 0;
     }
 
   /* Remove this structure from the children list.  */
index 1cb6602..62c760a 100644 (file)
@@ -158,7 +158,7 @@ elf_update (Elf *elf, Elf_Cmd cmd)
     }
 
  out:
-  rwlock_rdlock (elf->unlock);
+  rwlock_unlock (elf->unlock);
 
   return size;
 }
index cc838fa..2117b67 100644 (file)
@@ -284,8 +284,8 @@ extern GElf_Versym *gelf_getversym (Elf_Data *__data, int __ndx,
        /*@modifies dst @*/;
 
 /* Update symbol version information.  */
-extern int gelf_update_versym (Elf_Data *__data, int __ndx, GElf_Versym __src)
-       /*@*/;
+extern int gelf_update_versym (Elf_Data *__data, int __ndx, GElf_Versym *src)
+       /*@modifies *src @*/;
 
 
 /* Retrieve required symbol version information at given offset.  */
index 3c15188..09d05e9 100644 (file)
@@ -27,7 +27,7 @@
 
 
 int
-gelf_update_versym (Elf_Data *data, int ndx, GElf_Versym src)
+gelf_update_versym (Elf_Data *data, int ndx, GElf_Versym *src)
 {
   Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
 
@@ -55,7 +55,7 @@ gelf_update_versym (Elf_Data *data, int ndx, GElf_Versym src)
 
   rwlock_wrlock (data_scn->s->elf->lock);
 
-  ((GElf_Versym *) data_scn->d.d_buf)[ndx] = src;
+  ((GElf_Versym *) data_scn->d.d_buf)[ndx] = *src;
 
   /* Mark the section as modified.  */
   data_scn->s->flags |= ELF_F_DIRTY;