From 4cab573997627bc9210a4c345da380a3ba83d2b8 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 27 Jan 2003 17:45:53 +0000 Subject: [PATCH] - fix: more debugedit.c problems. CVS patchset: 6029 CVS date: 2003/01/27 17:45:53 --- CHANGES | 1 + doc/rpmbuild.8 | 2 +- po/cs.po | 2 +- po/da.po | 2 +- po/de.po | 2 +- po/fi.po | 2 +- po/fr.po | 2 +- po/gl.po | 2 +- po/is.po | 2 +- po/ja.po | 2 +- po/ko.po | 2 +- po/no.po | 2 +- po/pl.po | 2 +- po/pt.po | 2 +- po/pt_BR.po | 2 +- po/ro.po | 2 +- po/rpm.pot | 2 +- po/ru.po | 2 +- po/sk.po | 2 +- po/sl.po | 4 +- po/sr.po | 2 +- po/sv.po | 2 +- po/tr.po | 2 +- rpm.spec.in | 7 ++- tools/debugedit.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++------ 25 files changed, 150 insertions(+), 40 deletions(-) diff --git a/CHANGES b/CHANGES index d4cc159..bb824ea 100644 --- a/CHANGES +++ b/CHANGES @@ -113,6 +113,7 @@ - file conflict checks with colors. - fix: debugedit.c problem. - permit anaconda to choose "presentation order". + - fix: more debugedit.c problems. 4.0.4 -> 4.1: - loosely wire beecrypt library into rpm. diff --git a/doc/rpmbuild.8 b/doc/rpmbuild.8 index cf39d73..e6aa18d 100644 --- a/doc/rpmbuild.8 +++ b/doc/rpmbuild.8 @@ -181,7 +181,7 @@ for configuration details. When building the package, interpret \fIPLATFORM\fR as \fBarch-vendor-os\fR and set the macros \fB%_target\fR, -\fB%_target_arch\fR, and +\fB%_target_cpu\fR, and \fB%_target_os\fR accordingly. .SS "REBUILD AND RECOMPILE OPTIONS" diff --git a/po/cs.po b/po/cs.po index c97c2bb..39b971f 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-07-24 10:02+0100\n" "Last-Translator: Milan Kerslager \n" "Language-Team: Czech \n" diff --git a/po/da.po b/po/da.po index cc144f0..a0630de 100644 --- a/po/da.po +++ b/po/da.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-04-05 23:03GMT\n" "Last-Translator: Claus Hindsgaul \n" "Language-Team: Danish \n" diff --git a/po/de.po b/po/de.po index 523099d..35eac41 100644 --- a/po/de.po +++ b/po/de.po @@ -37,7 +37,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 1998-08-03 18:02+02:00\n" "Last-Translator: Karl Eichwalder \n" "Language-Team: German \n" diff --git a/po/fi.po b/po/fi.po index 76a7324..00de6c0 100644 --- a/po/fi.po +++ b/po/fi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 1998-05-02 21:41:47-0400\n" "Last-Translator: Raimo Koski \n" "Language-Team: Finnish \n" diff --git a/po/fr.po b/po/fr.po index 6c29ebf..d153403 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/gl.po b/po/gl.po index 65dbc80..d3fcf65 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.1\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-01-13 22:31+0100\n" "Last-Translator: Jesús Bravo Álvarez \n" "Language-Team: Galician \n" diff --git a/po/is.po b/po/is.po index 978955a..0612f2e 100644 --- a/po/is.po +++ b/po/is.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-07-12 13:25+0000\n" "Last-Translator: Richard Allen \n" "Language-Team: is \n" diff --git a/po/ja.po b/po/ja.po index 54c6117..e6e5718 100644 --- a/po/ja.po +++ b/po/ja.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 1999-12-01 22:49 +JST\n" "Last-Translator: Kanda Mitsuru \n" "Language-Team: JRPM \n" diff --git a/po/ko.po b/po/ko.po index 1e589aa..8409919 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.4\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2002-03-04 17:17+0900\n" "Last-Translator: Jong-Hoon Ryu \n" "Language-Team: GNU Translation project \n" diff --git a/po/no.po b/po/no.po index 208585e..22c79b1 100644 --- a/po/no.po +++ b/po/no.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-06-27 12:24+0200\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian \n" diff --git a/po/pl.po b/po/pl.po index 01f1f67..7ed9f0f 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 1999-05-25 17:00+0100\n" "Last-Translator: Pawe³ Dziekoñski \n" "Language-Team: Polish \n" diff --git a/po/pt.po b/po/pt.po index c3f2a23..10ea0ad 100644 --- a/po/pt.po +++ b/po/pt.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2002-02-14 10:51+0000\n" "Last-Translator: José Nuno Coelho Sanarra Pires \n" "Language-Team: pt \n" "Language-Team: Romanian \n" diff --git a/po/rpm.pot b/po/rpm.pot index ae7034f..c9c1f52 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/ru.po b/po/ru.po index c7a2c7a..4435da4 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2002-08-27 13:36-0400\n" "Last-Translator: Eugene Kanter, \n" "Language-Team: Black Cat Linux Team \n" diff --git a/po/sk.po b/po/sk.po index 107b408..9cec33a 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 1999-04-08 21:37+02:00\n" "Last-Translator: Stanislav Meduna \n" "Language-Team: Slovak \n" diff --git a/po/sl.po b/po/sl.po index 9a7f5f5..a696677 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1,12 +1,12 @@ # -*- mode:po; coding:iso-latin-2; -*- Slovenian messages for Redhat pkg. mngr. # Copyright (C) 2000 Free Software Foundation, Inc. # Primo¾ Peterlin , 2000. -# $Id: sl.po,v 1.368 2003/01/25 21:00:01 jbj Exp $ +# $Id: sl.po,v 1.369 2003/01/27 17:46:37 jbj Exp $ # msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2000-10-08 19:05+0200\n" "Last-Translator: Grega Fajdiga \n" "Language-Team: Slovenian \n" diff --git a/po/sr.po b/po/sr.po index 22330cf..c3cd294 100644 --- a/po/sr.po +++ b/po/sr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/sv.po b/po/sv.po index 429acc8..77d90ab 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.1\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2002-08-19 22:26+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" diff --git a/po/tr.po b/po/tr.po index 78a17c9..0d77d87 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2003-01-25 15:52-0500\n" +"POT-Creation-Date: 2003-01-27 12:37-0500\n" "PO-Revision-Date: 2001-07-05 08:02+300\n" "Last-Translator: Nilgun Belma Buguner \n" "Language-Team: Turkish \n" diff --git a/rpm.spec.in b/rpm.spec.in index 953ae29..a2a4029 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -20,7 +20,7 @@ Name: rpm %define version @VERSION@ Version: %{version} %{expand: %%define rpm_version %{version}} -Release: 0.61 +Release: 0.62 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz Copyright: GPL @@ -470,7 +470,10 @@ exit 0 %{__includedir}/popt.h %changelog -* Wed Jan 22 2003 Jeff Johnson 4.2-0.61 +* Mon Jan 27 2003 Jeff Johnson 4.2-0.67 +- fix: more debugedit.c problems. + +* Sat Jan 25 2003 Jeff Johnson 4.2-0.61 - permit anaconda to choose "presentation order". * Wed Jan 22 2003 Jeff Johnson 4.2-0.60 diff --git a/tools/debugedit.c b/tools/debugedit.c index cea9712..26f4f54 100644 --- a/tools/debugedit.c +++ b/tools/debugedit.c @@ -38,6 +38,8 @@ #include "hashtab.h" +#define DW_TAG_partial_unit 0x3c + char *base_dir = NULL; char *dest_dir = NULL; char *list_file = NULL; @@ -424,6 +426,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase) unsigned char opcode_base; uint_32 value, dirt_cnt; size_t comp_dir_len = strlen (comp_dir); + size_t abs_file_cnt = 0, abs_dir_cnt = 0; if (phase != 0) return 0; @@ -509,7 +512,11 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase) return 1; } if (*file == '/') - memcpy (s, file, file_len + 1); + { + memcpy (s, file, file_len + 1); + if (dest_dir && has_prefix (file, base_dir)) + ++abs_file_cnt; + } else if (*dirt[value] == '/') { memcpy (s, dirt[value], dir_len); @@ -556,28 +563,90 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase) read_uleb128 (ptr); read_uleb128 (ptr); } + ++ptr; if (dest_dir) { - ptr = dir; - while (*ptr != 0) + unsigned char *srcptr, *buf = NULL; + size_t base_len = strlen (base_dir); + size_t dest_len = strlen (dest_dir); + + if (dest_len == base_len) + abs_file_cnt = 0; + if (abs_file_cnt) + { + srcptr = buf = malloc (ptr - dir); + memcpy (srcptr, dir, ptr - dir); + ptr = dir; + } + else + ptr = srcptr = dir; + while (*srcptr != 0) { - if (*ptr == '/' && has_prefix (ptr, base_dir)) + size_t len = strlen (srcptr) + 1; + + if (*srcptr == '/' && has_prefix (srcptr, base_dir)) { - size_t base_len = strlen (base_dir); - size_t dest_len = strlen (dest_dir); + memcpy (ptr, dest_dir, dest_len); + if (dest_len < base_len) + { + memmove (ptr + dest_len, srcptr + base_len, + len - base_len); + ptr += dest_len - base_len; + ++abs_dir_cnt; + } + elf_flagdata (debug_sections[DEBUG_STR].elf_data, + ELF_C_SET, ELF_F_DIRTY); + } + else if (ptr != srcptr) + memmove (ptr, srcptr, len); + srcptr += len; + ptr += len; + } + + if (abs_dir_cnt + abs_file_cnt != 0) + { + size_t len = (abs_dir_cnt + abs_file_cnt) * (base_len - dest_len); + if (len == 1) + error (EXIT_FAILURE, 0, "-b arg has to be either the same length as -d arg, or more than 1 char shorter"); + memset (ptr, 'X', len - 1); + ptr += len - 1; + *ptr++ = '\0'; + } + *ptr++ = '\0'; + ++srcptr; + + while (*srcptr != 0) + { + size_t len = strlen (srcptr) + 1; + + if (*srcptr == '/' && has_prefix (srcptr, base_dir)) + { memcpy (ptr, dest_dir, dest_len); if (dest_len < base_len) { - memmove (ptr + dest_len, ptr + base_len, - strlen (dir + base_len) + 1); + memmove (ptr + dest_len, srcptr + base_len, + len - base_len); + ptr += dest_len - base_len; } elf_flagdata (debug_sections[DEBUG_STR].elf_data, ELF_C_SET, ELF_F_DIRTY); } - ptr = strchr (ptr, 0) + 1; + else if (ptr != srcptr) + memmove (ptr, srcptr, len); + srcptr += len; + ptr += len; + dir = srcptr; + read_uleb128 (srcptr); + read_uleb128 (srcptr); + read_uleb128 (srcptr); + if (ptr != dir) + memmove (ptr, dir, srcptr - dir); + ptr += srcptr - dir; } + *ptr = '\0'; + free (buf); } return 0; } @@ -613,13 +682,14 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase) } } - if (debug_sections[DEBUG_STR].data && - t->attr[i].attr == DW_AT_comp_dir && - form == DW_FORM_strp) + if (t->attr[i].attr == DW_AT_comp_dir && + form == DW_FORM_strp && + debug_sections[DEBUG_STR].data) { char *dir; dir = debug_sections[DEBUG_STR].data + do_read_32 (ptr); + free (comp_dir); comp_dir = strdup (dir); if (phase == 1 && dest_dir && has_prefix (dir, base_dir)) @@ -637,7 +707,45 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase) ELF_C_SET, ELF_F_DIRTY); } } - + else if ((t->tag == DW_TAG_compile_unit + || t->tag == DW_TAG_partial_unit) + && t->attr[i].attr == DW_AT_name + && form == DW_FORM_strp + && debug_sections[DEBUG_STR].data) + { + char *name; + + name = debug_sections[DEBUG_STR].data + do_read_32 (ptr); + if (*name == '/' && comp_dir == NULL) + { + char *enddir = strrchr (name, '/'); + + if (enddir != name) + { + comp_dir = malloc (enddir - name + 1); + memcpy (comp_dir, name, enddir - name); + comp_dir [enddir - name] = '\0'; + } + else + comp_dir = strdup ("/"); + } + + if (phase == 1 && dest_dir && has_prefix (name, base_dir)) + { + base_len = strlen (base_dir); + dest_len = strlen (dest_dir); + + memcpy (name, dest_dir, dest_len); + if (dest_len < base_len) + { + memmove (name + dest_len, name + base_len, + strlen (name + base_len) + 1); + } + elf_flagdata (debug_sections[DEBUG_STR].elf_data, + ELF_C_SET, ELF_F_DIRTY); + } + } + switch (form) { case DW_FORM_addr: @@ -1115,5 +1223,3 @@ main (int argc, char *argv[]) return 0; } - - -- 2.7.4