From cf96cbd0e26916ae287206e24752f8c47ab908ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Sat, 23 Jun 2012 19:05:32 +0000 Subject: [PATCH] - add dwarf-4 support for debugedit, release 68. https://bugzilla.redhat.com/show_bug.cgi?id=707677 Changed files: rpm-debugedit-dwarf4.patch -> 1.1.2.1 rpm.spec -> 1.837.2.42.2.49.2.125 --- rpm-debugedit-dwarf4.patch | 124 +++++++++++++++++++++++++++++++++++++ rpm.spec | 4 +- 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 rpm-debugedit-dwarf4.patch diff --git a/rpm-debugedit-dwarf4.patch b/rpm-debugedit-dwarf4.patch new file mode 100644 index 0000000..66045e9 --- /dev/null +++ b/rpm-debugedit-dwarf4.patch @@ -0,0 +1,124 @@ +--- rpm-4.5/tools/debugedit.c.orig 2012-06-23 20:54:51.748542754 +0200 ++++ rpm-4.5/tools/debugedit.c 2012-06-23 20:56:12.045612104 +0200 +@@ -70,6 +70,10 @@ + #include "hashtab.h" + + #define DW_TAG_partial_unit 0x3c ++#define DW_FORM_sec_offset 0x17 ++#define DW_FORM_exprloc 0x18 ++#define DW_FORM_flag_present 0x19 ++#define DW_FORM_ref_sig8 0x20 + + char *base_dir = NULL; + char *dest_dir = NULL; +@@ -250,6 +254,7 @@ static struct + #define DEBUG_STR 8 + #define DEBUG_FRAME 9 + #define DEBUG_RANGES 10 ++#define DEBUG_TYPES 11 + { ".debug_info", NULL, NULL, 0, 0, 0 }, + { ".debug_abbrev", NULL, NULL, 0, 0, 0 }, + { ".debug_line", NULL, NULL, 0, 0, 0 }, +@@ -261,6 +266,7 @@ static struct + { ".debug_str", NULL, NULL, 0, 0, 0 }, + { ".debug_frame", NULL, NULL, 0, 0, 0 }, + { ".debug_ranges", NULL, NULL, 0, 0, 0 }, ++ { ".debug_types", NULL, NULL, 0, 0, 0 }, + { NULL, NULL, NULL, 0, 0, 0 } + }; + +@@ -353,7 +359,8 @@ no_memory: + goto no_memory; + } + form = read_uleb128 (ptr); +- if (form == 2 || form > DW_FORM_indirect) ++ if (form == 2 ++ || (form > DW_FORM_flag_present && form != DW_FORM_ref_sig8)) + { + error (0, 0, "%s: Unknown DWARF DW_FORM_%d", dso->filename, form); + htab_delete (h); +@@ -382,7 +389,6 @@ static char * + canonicalize_path (const char *s, char *d) + { + char *rv = d; +- const char *sroot; + char *droot; + + if (IS_DIR_SEPARATOR (*s)) +@@ -398,7 +404,6 @@ canonicalize_path (const char *s, char * + s++; + } + droot = d; +- sroot = s; + + while (*s) + { +@@ -517,7 +522,7 @@ edit_dwarf2_line (DSO *dso, rpmuint32_t + } + + value = read_16 (ptr); +- if (value != 2 && value != 3) ++ if (value != 2 && value != 3 && value != 4) + { + error (0, 0, "%s: DWARF version %d unhandled", dso->filename, + value); +@@ -533,8 +538,8 @@ edit_dwarf2_line (DSO *dso, rpmuint32_t + return 1; + } + +- opcode_base = ptr[4]; +- ptr = dir = ptr + 4 + opcode_base; ++ opcode_base = ptr[4 + (value >= 4)]; ++ ptr = dir = ptr + 4 + (value >= 4) + opcode_base; + + /* dir table: */ + value = 1; +@@ -762,7 +767,8 @@ edit_attributes (DSO *dso, unsigned char + { + if (t->attr[i].attr == DW_AT_stmt_list) + { +- if (form == DW_FORM_data4) ++ if (form == DW_FORM_data4 ++ || form == DW_FORM_sec_offset) + { + list_offs = do_read_32_relocated (ptr); + found_list_offs = 1; +@@ -868,6 +874,8 @@ edit_attributes (DSO *dso, unsigned char + else + ptr += 4; + break; ++ case DW_FORM_flag_present: ++ break; + case DW_FORM_addr: + ptr += ptr_size; + break; +@@ -882,10 +890,12 @@ edit_attributes (DSO *dso, unsigned char + break; + case DW_FORM_ref4: + case DW_FORM_data4: ++ case DW_FORM_sec_offset: + ptr += 4; + break; + case DW_FORM_ref8: + case DW_FORM_data8: ++ case DW_FORM_ref_sig8: + ptr += 8; + break; + case DW_FORM_sdata: +@@ -914,6 +924,7 @@ edit_attributes (DSO *dso, unsigned char + form = DW_FORM_block1; + break; + case DW_FORM_block: ++ case DW_FORM_exprloc: + len = read_uleb128 (ptr); + form = DW_FORM_block1; + assert (len < UINT_MAX); +@@ -1217,7 +1228,7 @@ edit_dwarf2 (DSO *dso) + } + + cu_version = read_16 (ptr); +- if (cu_version != 2 && cu_version != 3) ++ if (cu_version != 2 && cu_version != 3 && cu_version != 4) + { + error (0, 0, "%s: DWARF version %d unhandled", dso->filename, + cu_version); diff --git a/rpm.spec b/rpm.spec index 3c8a044..661b7bc 100644 --- a/rpm.spec +++ b/rpm.spec @@ -57,7 +57,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM Summary(uk.UTF-8): Менеджер пакетів від RPM Name: rpm Version: 4.5 -Release: 67 +Release: 68 License: LGPL Group: Base Source0: %{name}-%{version}.tar.gz @@ -187,6 +187,7 @@ Patch103: %{name}-lua-exit-chroot-correctly.patch Patch104: %{name}-glob.patch Patch105: %{name}-am.patch Patch106: %{name}-automake_1.12.patch +Patch107: %{name}-debugedit-dwarf4.patch URL: http://rpm5.org/ BuildRequires: autoconf >= 2.57 BuildRequires: automake >= 1.4 @@ -821,6 +822,7 @@ install %{SOURCE13} scripts/perl.prov %patch104 -p1 %patch105 -p1 %patch106 -p1 +%patch107 -p1 mv -f po/{sr,sr@Latn}.po rm -rf sqlite zlib popt -- 2.44.0