← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2632: update libdwarf

 

Merge authors:
  poy (poy)
------------------------------------------------------------
revno: 2632 [merge]
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2011-10-10 22:39:31 +0200
message:
  update libdwarf
removed:
  dwarf/stdafx.h
added:
  dwarf/patches/
  dwarf/patches/faulty_aranges.patch
modified:
  dwarf/ChangeLog
  dwarf/config.h.in
  dwarf/dwarf_arange.c
  dwarf/dwarf_die_deliv.c
  dwarf/dwarf_error.c
  dwarf/dwarf_form.c
  dwarf/dwarf_frame.c
  dwarf/dwarf_frame2.c
  dwarf/dwarf_harmless.c
  dwarf/dwarf_incl.h
  dwarf/dwarf_init_finish.c
  dwarf/dwarf_line.c
  dwarf/dwarf_opaque.h
  dwarf/libdwarf.h
  dwarf/readme.txt
  win32/MainWindow.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwarf/ChangeLog'
--- dwarf/ChangeLog	2011-06-24 15:48:34 +0000
+++ dwarf/ChangeLog	2011-10-10 20:34:10 +0000
@@ -1,3 +1,84 @@
+2011-10-09  DavidAnderson <davea42@xxxxxxxxxxxxx> .
+     * dwarf_die_deliv.c, dwarf_elf_access.c: Fix bad indentation.
+2011-10-05  DavidAnderson <davea42@xxxxxxxxxxxxx> .
+     * dwarf_die_deliv.c: When relocations fail, record
+       a 'harmless error' and continue the CU loading.
+       No way to be sure the error is really harmless, of course.
+       But it seems to often be harmless.
+       For some if() tests add {} to make the clause extent clear.
+     * dwarf_harmless.c: Add a comment prefix to dwarf_harmless_init().
+2011-10-03  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * dwarf_line.c: Introduce {} in a test to avoid future mistakes.
+2011-09-23  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * dwarf_arange.c: Test for a zero address-size: that indicates
+       broken dwarf generation.
+     * dwarf_line.c: Test for irrational line number header data and
+       error off with DW_DLE_LINE_NUMBER_HEADER_ERROR if we find it.
+       Add accidentally-omitted check for version 4.
+     * dwarf_error.c, libdwarf.h: New error code 
+       DW_DLE_LINE_NUMBER_HEADER_ERROR.
+2011-09-16  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * dwarf_elf_access.c: Give up relocating if the Elf symtab 
+       header sh_entrysize is zero, and refine the test for 
+       invalid symbol index to be a >= test.
+     * dwarf_error.c: Define text message for 
+       DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO.
+     * libdwarf.h: New error code DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO.
+2011-09-15  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * dwarf_elf_access.c: Adding fields to the object
+       structs dwarf uses and using them for error checks
+       when processing relocations.  
+     * dwarf_error.c: Adding descriptions of new error messages
+       for Elf object file interpretation problems.
+     * dwarf_init_finish.c: Adding 'entrysize' field about objects
+       do dwarf_elf_access.c can check for object and relocation  
+       data errors and avoid a coredump.  And we memset() a struct
+       to ensure there are no uninitialized contents.
+     * dwarf_opaque.h: Adding new dss_entrysize and
+       dss_reloc_entrysize fields so elf error
+       checks can be added to dwarf_elf_access.c.  These changes mean
+       you must recompile all of libdwarf source, not 
+       just a subset, when rebuilding (the first time one sees this change).
+     * libdwarf.h: Adding entrysize element to Dwarf_Obj_Access_Section_s.
+       Non-elf object formats can just set this field zero and ignore it.
+       Added new elf-specific error codes for the new checks in
+       dwarf_elf_access.c.
+2011-09-14  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * BLDLIBDWARFTAR: Moved a local disk file. Irrelevant
+       to everyone but DA.
+     * dwarf_arange.c: check that the address_size and segment 
+       selector size fields are sensible.
+     * dwarf_die_deliv.c,dwarf_frame2.c: Give
+       DW_DLE_ADDRESS_SIZE_ERROR or DW_DLE_CU_ADDRESS_SIZE_BAD 
+       if the address size read from a section is obviously wrong.
+       Similarly for a bad segment-selector-size give
+       DW_DLE_SEGMENT_SIZE_BAD.
+     * dwarf_error.c: Added text for the DW_DLE_SEGMENT_SIZE_BAD
+       error.
+     * dwarf_frame.c: If dwarf_set_default_address_size() is handed
+       an address_size that we cannot handle, ignore the input so
+       we don't wind up coredumping the library or consumer code.
+     * libdwarf2.1.mm: Updated list of error codes a little bit. Rev 1.99
+     * libdwarf2.1.pdf: Regenerated.
+2011-09-08  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * dwarf_frame.c: Fixed bad indents.
+2011-09-02  DavidAnderson <davea42@xxxxxxxxxxxxx>
+     * libdwarf2.1.mm: Document the new function 
+       dwarf_set_default_address_size(). Updated revision to 1.97.
+     * libdwarf2.1.pdf: Regenerated.
+     * dwarf_frame.c: Implement dwarf_set_default_address_size().
+     * libdwarf.h: Declare the new function dwarf_set_default_address_size().
+     * dwarf_form.c(dwarf_formref): Removed c99-ish
+       declaration so C90 can compile the code. 
+     * Makefile.in, configure.in: If building shared lib
+       CFLAGS gets -fPIC  added in.
+     * configure: Fegenerated.
+     * dwarf_loc.c: New test returns DW_DLE_LOC_BAD_TERMINATION
+       in case of compiler bug in location expression.
+     * dwarf_error.c, libdwarf.h: Define and document the new
+       error.
+     * pro_opaque.h: Fixed a bad indent.
+
 2011-06-12  DavidAnderson <davea42@xxxxxxxxxxxxx>
      * libdwarf.h: Added dwarf_producer_init_c() and its
        callback functions. Adds a user_data void* to the

=== modified file 'dwarf/config.h.in'
--- dwarf/config.h.in	2011-06-24 15:48:34 +0000
+++ dwarf/config.h.in	2011-10-10 20:34:10 +0000
@@ -58,6 +58,9 @@
 /* Define 1 if want producer to build with IRIX offset sizes */
 #undef HAVE_SGI_IRIX_OFFSETS
 
+/* Define 1 if we have the Windows specific header stdafx.h */
+#undef HAVE_STDAFX_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 

=== modified file 'dwarf/dwarf_arange.c'
--- dwarf/dwarf_arange.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_arange.c	2011-10-10 20:39:31 +0000
@@ -147,18 +147,29 @@
         }
 
         address_size = *(Dwarf_Small *) arange_ptr;
+        if(address_size  > sizeof(Dwarf_Addr)) {
+            _dwarf_error(dbg, error, DW_DLE_ADDRESS_SIZE_ERROR);
+            return DW_DLV_ERROR;
+        }
+        if(address_size  ==  0) {
+            _dwarf_error(dbg, error, DW_DLE_ADDRESS_SIZE_ERROR);
+            return DW_DLV_ERROR;
+        }
         /*  It is not an error if the sizes differ.
             Unusual, but not an error. */
         arange_ptr = arange_ptr + sizeof(Dwarf_Small);
         length = length - sizeof(Dwarf_Small);
 
+        /*  Even DWARF2 had a segment_size field here, meaning
+            size in bytes of a segment descriptor on the target
+            system. */
         segment_size = *(Dwarf_Small *) arange_ptr;
-        arange_ptr = arange_ptr + sizeof(Dwarf_Small);
-        length = length - sizeof(Dwarf_Small);
-        if (segment_size != 0) {
+        if(segment_size > sizeof(Dwarf_Addr)) {
             _dwarf_error(dbg, error, DW_DLE_SEGMENT_SIZE_BAD);
             return (DW_DLV_ERROR);
         }
+        arange_ptr = arange_ptr + sizeof(Dwarf_Small);
+        length = length - sizeof(Dwarf_Small);
 
         range_entry_size = 2*address_size + segment_size;
         /* Round arange_ptr offset to next multiple of address_size. */
@@ -173,7 +184,9 @@
             Dwarf_Unsigned segment_selector = 0;
             Dwarf_Unsigned range_length = 0;
             /*  For segmented address spaces, the first field to
-                read is a segment selector (new in DWARF4) */
+                read is a segment selector (new in DWARF4).
+                Surprising since the segment_size was always there
+                in the table header! */
             if(version == 4 && segment_size != 0) {
                 READ_UNALIGNED(dbg, segment_selector, Dwarf_Unsigned,
                     arange_ptr, segment_size);

=== modified file 'dwarf/dwarf_die_deliv.c'
--- dwarf/dwarf_die_deliv.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_die_deliv.c	2011-10-10 20:34:10 +0000
@@ -186,6 +186,11 @@
 
     cu_context->cc_address_size = *(Dwarf_Small *) cu_ptr;
 
+    if(cu_context->cc_address_size  > sizeof(Dwarf_Addr)) {
+        _dwarf_error(dbg, error, DW_DLE_CU_ADDRESS_SIZE_BAD);
+        return (NULL);
+    }
+
     if ((length < CU_VERSION_STAMP_SIZE + local_length_size +
         CU_ADDRESS_SIZE_SIZE) ||
         (offset + length + local_length_size +
@@ -233,6 +238,25 @@
     return (cu_context);
 }
 
+static int
+reloc_incomplete(Dwarf_Error err)
+{
+    int e = dwarf_errno(err);
+    if( e == DW_DLE_RELOC_MISMATCH_INDEX       ||
+        e == DW_DLE_RELOC_MISMATCH_RELOC_INDEX  ||
+        e == DW_DLE_RELOC_MISMATCH_STRTAB_INDEX ||
+        e == DW_DLE_RELOC_SECTION_MISMATCH      ||
+        e == DW_DLE_RELOC_SECTION_MISSING_INDEX  ||
+        e == DW_DLE_RELOC_SECTION_LENGTH_ODD     ||
+        e == DW_DLE_RELOC_SECTION_PTR_NULL        ||
+        e == DW_DLE_RELOC_SECTION_MALLOC_FAIL      ||
+        e == DW_DLE_RELOC_SECTION_SYMBOL_INDEX_BAD  ) {
+        return 1;
+    }
+    return 0;
+}
+
+
 
 /*  Returns offset of next compilation-unit thru next_cu_offset
     pointer.
@@ -287,10 +311,26 @@
     if (dbg->de_cu_context == NULL) {
         new_offset = 0;
         if (!dbg->de_debug_info.dss_data) {
-            int res = _dwarf_load_debug_info(dbg, error);
+            Dwarf_Error err2= 0;
+            int res = _dwarf_load_debug_info(dbg, &err2);
 
             if (res != DW_DLV_OK) {
-                return res;
+                if(reloc_incomplete(err2)) {
+                    /*  We will assume all is ok, though it is not. 
+                        Relocation errors need not be fatal.  */
+                    char msg_buf[200];
+                    snprintf(msg_buf,sizeof(msg_buf),
+                        "Relocations did not complete successfully, but we are "
+                        " ignoring error: %s",dwarf_errmsg(err2));
+                    dwarf_insert_harmless_error(dbg,msg_buf);
+                    res = DW_DLV_OK;
+                } else {
+                    if( error) {
+                        *error = err2;
+                    }
+                    return res;
+                }
+              
             }
         }
 
@@ -328,21 +368,26 @@
 
     dbg->de_cu_context = cu_context;
 
-    if (cu_header_length != NULL)
+    if (cu_header_length != NULL) {
         *cu_header_length = cu_context->cc_length;
+    }
 
-    if (version_stamp != NULL)
+    if (version_stamp != NULL) {
         *version_stamp = cu_context->cc_version_stamp;
-
-    if (abbrev_offset != NULL)
+    }
+    if (abbrev_offset != NULL) {
         *abbrev_offset = cu_context->cc_abbrev_offset;
+    }
 
-    if (address_size != NULL)
+    if (address_size != NULL) {
         *address_size = cu_context->cc_address_size;
-    if (offset_size != NULL)
+    }
+    if (offset_size != NULL) {
         *offset_size = cu_context->cc_length_size;
-    if (extension_size != NULL)
+    }
+    if (extension_size != NULL) {
         *extension_size = cu_context->cc_extension_size;
+    }
 
     new_offset = new_offset + cu_context->cc_length +
         cu_context->cc_length_size + cu_context->cc_extension_size;

=== modified file 'dwarf/dwarf_error.c'
--- dwarf/dwarf_error.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_error.c	2011-10-10 20:34:10 +0000
@@ -216,7 +216,7 @@
     "DW_DLE_MAKE_CU_CONTEXT_FAIL",
     "DW_DLE_REL_ALLOC",
     "DW_DLE_ARANGE_OFFSET_BAD",
-    "DW_DLE_SEGMENT_SIZE_BAD",
+    "DW_DLE_SEGMENT_SIZE_BAD (135) Size of a segment selector should usually be less than 8 (bytes).",
     "DW_DLE_ARANGE_LENGTH_BAD",
     "DW_DLE_ARANGE_DECODE_ERROR",
     "DW_DLE_ARANGES_NULL",
@@ -315,7 +315,13 @@
     "DW_DLE_NOT_REF_FORM(226)",
     "DW_DLE_DEBUG_FRAME_LENGTH_NOT_MULTIPLE(227)",
     "DW_DLE_REF_SIG8_NOT_HANDLED (228)",
-    "DW_DLE_DEBUG_FRAME_POSSIBLE_ADDRESS_BOTCH (229)"
+    "DW_DLE_DEBUG_FRAME_POSSIBLE_ADDRESS_BOTCH (229)",
+    "DW_DLE_LOC_BAD_TERMINATION (230) the last location operator in an expression is missing some associated data, an operator ended too soon",
+    "DW_DLE_SYMTAB_SECTION_LENGTH_ODD (231) so doing relocations seems unsafe",
+    "DW_DLE_RELOC_SECTION_SYMBOL_INDEX_BAD (232) so doing a relocation seems unsafe",
+    "DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN (233) so doing a relocation is unsafe",
+    "DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO(234)",
+    "DW_DLE_LINE_NUMBER_HEADER_ERROR (235), a line number program header seems incomplete (perhaps the header_length is wrong?).",
 };
 
 

=== modified file 'dwarf/dwarf_form.c'
--- dwarf/dwarf_form.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_form.c	2011-10-10 20:34:10 +0000
@@ -315,10 +315,11 @@
     Dwarf_Unsigned offset = 0;
     Dwarf_CU_Context cu_context = 0;
     Dwarf_Unsigned maximumoffset = 0; 
+    int res = DW_DLV_ERROR;
 
 
     *ret_offset = 0;
-    int res  = get_attr_dbg(&dbg,&cu_context,attr,error);
+    res  = get_attr_dbg(&dbg,&cu_context,attr,error);
     if(res != DW_DLV_OK) { 
         return res;
     } 

=== modified file 'dwarf/dwarf_frame.c'
--- dwarf/dwarf_frame.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_frame.c	2011-10-10 20:34:10 +0000
@@ -2317,9 +2317,17 @@
     return orig;
 }
 
-
-
-
+/*  Does something only if value passed in is greater than 0 and
+    a size than we can handle (in number of bytes).  */
+Dwarf_Small dwarf_set_default_address_size(Dwarf_Debug dbg,
+    Dwarf_Small value  )
+{
+    Dwarf_Small orig = dbg->de_pointer_size;
+    if (value > 0 && value <= sizeof(Dwarf_Addr)) {
+        dbg->de_pointer_size = value;
+    }
+    return orig;
+}
 
 static int 
 init_reg_rules_alloc(Dwarf_Debug dbg,struct Dwarf_Frame_s *f,

=== modified file 'dwarf/dwarf_frame2.c'
--- dwarf/dwarf_frame2.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_frame2.c	2011-10-10 20:34:10 +0000
@@ -566,9 +566,17 @@
 
         if( version == DW_CIE_VERSION4) {
             address_size = *((unsigned char *)frame_ptr);
+            if(address_size  > sizeof(Dwarf_Addr)) {
+                _dwarf_error(dbg, error, DW_DLE_ADDRESS_SIZE_ERROR);
+                return (DW_DLV_ERROR);
+            }
             ++frame_ptr;
             segment_size = *((unsigned char *)frame_ptr);
             ++frame_ptr;
+            if(segment_size  > sizeof(Dwarf_Addr)) {
+                _dwarf_error(dbg, error, DW_DLE_SEGMENT_SIZE_BAD);
+                return (DW_DLV_ERROR);
+            }
         }
 
         DECODE_LEB128_UWORD(frame_ptr, lreg);

=== modified file 'dwarf/dwarf_harmless.c'
--- dwarf/dwarf_harmless.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_harmless.c	2011-10-10 20:34:10 +0000
@@ -179,6 +179,8 @@
     return prevcount-1;
 }
 
+/*  Only callable from within libdwarf (as a practical matter)
+*/
 void 
 dwarf_harmless_init(struct Dwarf_Harmless_s *dhp,unsigned size)
 {

=== modified file 'dwarf/dwarf_incl.h'
--- dwarf/dwarf_incl.h	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_incl.h	2011-10-10 20:34:10 +0000
@@ -46,9 +46,9 @@
 #define _GNU_SOURCE 1
 #endif
 
-#ifdef WIN32 /* Windows specific. */
+#ifdef HAVE_STDAFX_H /* Windows specific. */
 #include "stdafx.h"
-#endif /* WIN32 */
+#endif /* HAVE_STDAFX_H */
 
 #include "libdwarfdefs.h"
 #include <string.h>

=== modified file 'dwarf/dwarf_init_finish.c'
--- dwarf/dwarf_init_finish.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_init_finish.c	2011-10-10 20:34:10 +0000
@@ -116,6 +116,7 @@
     secdata->dss_size = doas->size;
     secdata->dss_addr = doas->addr;
     secdata->dss_link = doas->link;
+    secdata->dss_entrysize = doas->entrysize;
     return DW_DLV_OK;
 }
 
@@ -127,6 +128,7 @@
 {
     secdata->dss_reloc_index = section_index;
     secdata->dss_reloc_size = doas->size;
+    secdata->dss_reloc_entrysize = doas->entrysize;
     secdata->dss_reloc_addr = doas->addr;
     secdata->dss_reloc_symtab = doas->link;
     secdata->dss_reloc_link = doas->link;
@@ -217,6 +219,7 @@
         int res = DW_DLV_ERROR;
         int err = 0;
 
+        memset(&doas,0,sizeof(doas));
         res = obj->methods->get_section_info(obj->object, 
             section_index, 
             &doas, &err);

=== modified file 'dwarf/dwarf_line.c'
--- dwarf/dwarf_line.c	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_line.c	2011-10-10 20:34:10 +0000
@@ -1,4 +1,4 @@
-/*
+/* .
    Copyright (C) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
    Portions Copyright (C) 2007-2011 David Anderson. All Rights Reserved.
    Portions Copyright (C) 2010 SN Systems Ltd. All Rights Reserved.
@@ -139,8 +139,9 @@
 
     /*  ***** BEGIN CODE ***** */
     /*  Reset error. */
-    if (error != NULL)
+    if (error != NULL) {
         *error = NULL;
+    }
 
     CHECK_DIE(die, DW_DLV_ERROR);
     dbg = die->di_cu_context->cc_dbg;
@@ -1672,7 +1673,8 @@
     prefix_out->pf_version = version;
     line_ptr += sizeof(Dwarf_Half);
     if (version != CURRENT_VERSION_STAMP &&
-        version != CURRENT_VERSION_STAMP3) {
+        version != CURRENT_VERSION_STAMP3 &&
+        version != CURRENT_VERSION_STAMP4) {
         _dwarf_error(dbg, err, DW_DLE_VERSION_STAMP_ERROR);
         return (DW_DLV_ERROR);
     }
@@ -1797,6 +1799,10 @@
     memset(prefix_out->pf_include_directories, 0,
         sizeof(Dwarf_Small *) * directories_malloc);
 
+    if (line_ptr >= line_ptr_end) {
+        _dwarf_error(dbg, err, DW_DLE_LINE_NUMBER_HEADER_ERROR);
+        return (DW_DLV_ERROR);
+    }
     while ((*(char *) line_ptr) != '\0') {
         if (directories_count >= directories_malloc) {
             Dwarf_Unsigned expand = 2 * directories_malloc;
@@ -1819,6 +1825,10 @@
             line_ptr;
         line_ptr = line_ptr + strlen((char *) line_ptr) + 1;
         directories_count++;
+        if (line_ptr >= line_ptr_end) {
+            _dwarf_error(dbg, err, DW_DLE_LINE_NUMBER_HEADER_ERROR);
+            return (DW_DLV_ERROR);
+        }
     }
     prefix_out->pf_include_directories_count = directories_count;
     line_ptr++;
@@ -1834,6 +1844,10 @@
     memset(prefix_out->pf_line_table_file_entries, 0,
         sizeof(struct Line_Table_File_Entry_s) * files_malloc);
 
+    if (line_ptr >= line_ptr_end) {
+        _dwarf_error(dbg, err, DW_DLE_LINE_NUMBER_HEADER_ERROR);
+        return (DW_DLV_ERROR);
+    }
     while (*(char *) line_ptr != '\0') {
         Dwarf_Unsigned utmp;
         Dwarf_Unsigned dir_index = 0;
@@ -1882,6 +1896,10 @@
         curline->lte_length_of_file = file_length;
 
         ++files_count;
+        if (line_ptr >= line_ptr_end) {
+            _dwarf_error(dbg, err, DW_DLE_LINE_NUMBER_HEADER_ERROR);
+            return (DW_DLV_ERROR);
+        }
 
     }
     prefix_out->pf_files_count = files_count;

=== modified file 'dwarf/dwarf_opaque.h'
--- dwarf/dwarf_opaque.h	2011-06-24 15:48:34 +0000
+++ dwarf/dwarf_opaque.h	2011-10-10 20:34:10 +0000
@@ -135,6 +135,12 @@
 struct Dwarf_Section_s {
     Dwarf_Small *  dss_data;
     Dwarf_Unsigned dss_size;
+    /*  Some Elf sections have a non-zero dss_entrysize which
+        is the size in bytes of a table entry in the section.
+        Relocations and symbols are both in tables, so have a
+        non-zero entrysize.  Object formats which do not care
+        about this should leave this field zero. */     
+    Dwarf_Unsigned dss_entrysize;
     Dwarf_Word     dss_index;
     /*  dss_addr is the 'section address' which is only
         non-zero for a GNU eh section.
@@ -154,6 +160,7 @@
     Dwarf_Half     dss_reloc_index; /* Zero means ignore the reloc fields. */
     Dwarf_Small *  dss_reloc_data;
     Dwarf_Unsigned dss_reloc_size;
+    Dwarf_Unsigned dss_reloc_entrysize;
     Dwarf_Addr     dss_reloc_addr;
     /*  dss_reloc_symtab is the sh_link of a .rela to its .symtab, leave
         it 0 if non-meaningful. */

=== modified file 'dwarf/libdwarf.h'
--- dwarf/libdwarf.h	2011-06-24 15:48:34 +0000
+++ dwarf/libdwarf.h	2011-10-10 20:34:10 +0000
@@ -554,13 +554,26 @@
     names in the 'name' field.  libdwarf does
     not free the strings in 'name'. */
 struct Dwarf_Obj_Access_Section_s {
+    /*  addr is the virtual address of the first byte of
+        the section data.  Usually zero when the address
+        makes no sense for a given section. */
     Dwarf_Addr     addr;
+
+    /* Size in bytes of the section. */
     Dwarf_Unsigned size;
+
+    /*  Having an accurate section name makes debugging of libdwarf easier. 
+        and is essential to find the .debug_ sections.  */
     const char*    name;
     /*  Set link to zero if it is meaningless.  If non-zero
         it should be a link to a rela section or from symtab
         to strtab.  In Elf it is sh_link. */
     Dwarf_Unsigned link;
+    /*  Elf sections that are tables have a non-zero entrysize so
+        the count of entries can be calculated even without
+        the right structure definition. If your object format
+        does not have this data leave this zero. */
+    Dwarf_Unsigned entrysize;
 };
 
 /*  Returned by the get_endianness function in 
@@ -1037,11 +1050,16 @@
 #define DW_DLE_DEBUG_FRAME_LENGTH_NOT_MULTIPLE 227
 #define DW_DLE_REF_SIG8_NOT_HANDLED            228
 #define DW_DLE_DEBUG_FRAME_POSSIBLE_ADDRESS_BOTCH 229
-
+#define DW_DLE_LOC_BAD_TERMINATION             230
+#define DW_DLE_SYMTAB_SECTION_LENGTH_ODD       231
+#define DW_DLE_RELOC_SECTION_SYMBOL_INDEX_BAD  232
+#define DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN  233
+#define DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO   234
+#define DW_DLE_LINE_NUMBER_HEADER_ERROR        235
 
 
     /* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */
-#define DW_DLE_LAST        229
+#define DW_DLE_LAST        235
 #define DW_DLE_LO_USER     0x10000
 
     /*  Taken as meaning 'undefined value', this is not
@@ -2639,12 +2657,14 @@
     Dwarf_Unsigned * /*debug_ranges_size*/,
     Dwarf_Unsigned * /*debug_pubtypes_size*/);
 
+/*  The 'set' calls here return the original (before any change
+    by these set routines) of the respective fields. */
 /*  Multiple releases spelled 'initial' as 'inital' . 
     The 'inital' spelling should not be used. */ 
 Dwarf_Half dwarf_set_frame_rule_inital_value(Dwarf_Debug /*dbg*/,
     Dwarf_Half /*value*/);
 /*  Additional interface with correct 'initial' spelling. */
-/*  It is likely you will want to call the following 5 functions
+/*  It is likely you will want to call the following 6 functions
     before accessing any frame information.  All are useful
     to tailor handling of pseudo-registers needed to turn
     frame operation references into simpler forms and to
@@ -2661,6 +2681,10 @@
     Dwarf_Half /*value*/);
 Dwarf_Half dwarf_set_frame_undefined_value(Dwarf_Debug /*dbg*/, 
     Dwarf_Half /*value*/);
+/*  dwarf_set_default_address_size only sets 'value' if value is 
+    greater than zero. */
+Dwarf_Small dwarf_set_default_address_size(Dwarf_Debug /*dbg*/, 
+    Dwarf_Small /* value */);
 
 /*  As of April 27, 2009, this version with no diepointer is
     obsolete though supported.  Use dwarf_get_ranges_a() instead. */

=== added directory 'dwarf/patches'
=== added file 'dwarf/patches/faulty_aranges.patch'
--- dwarf/patches/faulty_aranges.patch	1970-01-01 00:00:00 +0000
+++ dwarf/patches/faulty_aranges.patch	2011-10-10 20:39:31 +0000
@@ -0,0 +1,16 @@
+=== modified file 'dwarf/dwarf_arange.c'
+--- dwarf/dwarf_arange.c	2011-10-10 20:34:10 +0000
++++ dwarf/dwarf_arange.c	2011-10-10 20:35:13 +0000
+@@ -117,6 +117,11 @@
+             arange_ptr, local_length_size,
+             local_extension_size);
+         arange_ptr_past_end = arange_ptr + length;
++#ifdef WIN32
++		if (length == 0) {
++			continue;
++		}
++#endif
+ 
+ 
+         READ_UNALIGNED(dbg, version, Dwarf_Half,
+

=== modified file 'dwarf/readme.txt'
--- dwarf/readme.txt	2011-06-26 21:47:04 +0000
+++ dwarf/readme.txt	2011-10-10 20:39:31 +0000
@@ -1,1 +1,3 @@
 This folder contains useful parts of libdwarf <http://reality.sgiweb.org/davea/dwarf.html>.
+
+Patches in the "patches" directory have been applied.

=== removed file 'dwarf/stdafx.h'
=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2011-10-10 20:18:18 +0000
+++ win32/MainWindow.cpp	2011-10-10 20:34:10 +0000
@@ -1319,7 +1319,7 @@
 	// update when the database is non-existent or older than 16 days (GeoIP updates every month).
 	try {
 		File f(GeoManager::getDbPath(v6) + ".gz", File::READ, File::OPEN);
-		if(f.getSize() > 0 && f.getLastModified() > GET_TIME() - 3600 * 24 * 16) {
+		if(f.getSize() > 0 && static_cast<time_t>(f.getLastModified()) > GET_TIME() - 3600 * 24 * 16) {
 			return;
 		}
 	} catch(const FileException&) { }