Commit Graph

60 Commits

Author SHA1 Message Date
dfc381d732 debugedit: Fix 'canonicalization unexpectedly shrank by one character'
Do not let canonicalization shrink directory name by 1 character. Or else
that would prevent (in-place) changing of Directory Table entries in
.debug_line section, causing following error in brp-debuginfo:

  /usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character

Fixes: https://bugzilla.altlinux.org/show_bug.cgi?id=39184
2020-11-06 15:16:45 +03:00
1f2ad272a1 debugedit: Add -n to avoid recomputing of build-id
Avoid `DWARF version 0 unhandled' for compressed ELFs in
find-debuginfo-files.

Based on 6e9fd97f6 ("debugedit: Add -n, --no-recompute-build-id.")
by Mark Wielaard <mark@klomp.org>.
2020-07-05 01:06:16 +03:00
5133ad68aa setcmp: use 'm' instead of 'a' as the assignment-allocation modifier
Support for the 'm' modifier was added to glibc starting with version 2.7,
programs should use that modifier instead of 'a'.
2019-11-24 11:58:18 +00:00
0ea2deffe3 suggest_bpp: fix harmless off-by-one error in bpp estimation
Give detailed explanation of the formulae which makes the mistake obvious.

Also rewrite suggest_bpp from perl to C.
2019-01-20 23:40:39 +00:00
db62fbdc5a tools: build dump_ld_config and filesize with -D_FILE_OFFSET_BITS=64
... because they use stat().
2019-01-10 23:20:03 +00:00
e8c780c2b0 Disable build and install of unpackaged files
These are no longer packaged anyway, so no need to bother.
2017-01-14 13:42:53 +00:00
Gleb Fotengauer-Malinovskiy
03302d4963 relative.c: fix potential heap buffer overflow 2016-03-10 19:22:33 +03:00
4134fc39ac Fix automake warnings
Makefile.am:13: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
build/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
lib/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
python/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
rpmdb/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
rpmio/Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
tools/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2014-02-15 22:19:47 +00:00
f51a73c175 debugedit: enhance error diagnostics 2013-10-28 23:27:58 +00:00
Panu Matilainen
c14ca2efee Doh, its .debug_gdb_scripts, not _script (really fix SuseBug:818502) 2013-10-28 21:53:05 +00:00
Panu Matilainen
3ba57efca0 Teach debugedit about .debug_gdb_script section (SuseBug:818502) 2013-10-28 21:52:58 +00:00
Panu Matilainen
ec72fa893b Avoid breaking build on older systems which dont know AArch64 2013-10-28 21:52:49 +00:00
Kyle McMartin
220cc6770d debugedit: handle aarch64 debug_info relocations (RhBug:974860)
AArch64 generates a relocation which must be handled similar to other
architectures. Adding this patch allows debugedit to run against the
kernel debuginfo.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-10-28 21:52:41 +00:00
Panu Matilainen
3202ef8837 Plug segfault on NULL pointer dereference in debugedit (RhBug:929365)
- Not sure what the right thing to do would be here, ignoring seems
  like a better option than crashing though...
2013-10-28 21:52:25 +00:00
Panu Matilainen
ca9831743b Teach debugedit about .debug_macro dwarf section (RhBug:759272) 2012-08-17 16:36:15 +00:00
Jakub Jelinek
0bed5fc55d Add DWARF-4 support to debugedit (RhBug:707677)
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-08-17 16:34:56 +00:00
Panu Matilainen
be7b36d39b Warn but dont fail the build on STABS debuginfo (RhBug:725378, others)
- debugedit doesn't support STABS but there are some crazy cases
  like PPC Linux kernel which contains both STABS and DWARF debuginfo
  sections, manually added. A better fix would be erroring out
  if we didn't find any usable debuginfo and warning otherwise but
  this at least folks get their kernels built.
2012-08-17 16:32:02 +00:00
Panu Matilainen
a2b0166bb3 Bail out of debuginfo if stabs format encountered (RhBug:453506)
The previous "silently ignore" policy produces bogus debuginfo packages
on some architectures and fails with other mysterious errors on others,
better just fail hard until (if ever) somebody adds stabs support.
2012-08-17 16:31:18 +00:00
Panu Matilainen
f0df84e119 Remove unused variable in debugedit 2011-05-15 22:55:00 +00:00
Alexey Tourbin
d8fb5d17cb spec, tools/Makefile.am: enabled /usr/lib/rpm/debugedit 2011-01-30 03:06:17 +03:00
Alexey Tourbin
4334d6e700 debugedit.c: ported back to beecrypt API, based on rpm5.org 2011-01-30 03:06:03 +03:00
Alexey Tourbin
ce4f05af30 debugedit.c: imported from rpm.org
Recent changes:
7e7ca4b 2010-08-17 Anssi Hannula	debugedit: fix incorrect error messages regarding -b and -d
e6a0b0e 2010-05-10 Roland McGrath	Make debugedit -i recompute build ID only when any DWARF was actually changed.
c4b6362 2010-05-10 Roland McGrath	Whitespace fixups for tools/debugedit.c
71a7dd8 2009-06-16 Panu Matilainen	Add debugedit support for DWARF-3 (RhBug:505774)
2011-01-30 03:05:59 +03:00
Alexey Tourbin
9380d2ec53 tools/Makefile.am: compile setcmp.static, for profiling 2011-01-04 09:31:52 +03:00
Alexey Tourbin
afe9677742 tools/setcmp.c: with argc==1, read versions from stdin 2011-01-04 09:05:29 +03:00
Alexey Tourbin
5e8118e213 tools/mkset.c, tools/setcmp.c: command-line helpers 2010-09-11 02:09:55 +04:00
Alexey Tourbin
f68c71a2d5 4.0.4-alt97.M50.18
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:30:39 +04:00
Alexey Tourbin
6795a36bb1 great removal 2009-09-29 15:29:52 +04:00
aad1a695b5 tools/rpmevrcmp.c: Use rpmVersionCompare
Replace rpmEVRcmp() with rpmVersionCompare() which is more suitable.
Idea and original patch by Alexey Tourbin.
2009-04-14 16:50:00 +00:00
71ba99f754 tools/rpm*cmp.c: Reindent 2009-04-14 16:43:52 +00:00
Alexey Tourbin
ffb79de5d1 4.0.4-alt96.10
- improved install/upgrade package reordering (in tsort algorithm,
  changed "presentation order" to "chainsaw order")
2008-11-10 05:46:39 +03:00
Alexey Tourbin
b8767dceb1 depends.c: disabled tsort presentation order
This should facilitate library upgrades, e.g. glibc-prthread.
Consider that we upgrade gcc-* and glibc-* packages; and glibc
has new subpackage glibc-pthread (with libpthread and librt
shared libraries).

Old order was:
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0   14    0    0  glibc-preinstall-2.8.90-alt3
D:     1    1   21    0    1    glibc-core-2.8.90-alt3
D:     2    1    9    0    2      cpp4.3-4.3.2-alt5
D:     3    1    5    0    2      libgcc4.3-4.3.2-alt5
D:     4    2   13    0    3        glibc-pthread-2.8.90-alt3
D:     5    2   20    0    4          glibc-core-debug-2.8.90-alt3
D:     6    2   17    0    4          glibc-gconv-modules-2.8.90-alt3
D:     7    2   16    0    4          glibc-locales-2.8.90-alt3
D:     8    2   15    0    4          glibc-nss-2.8.90-alt3
D:     9    2   12    0    4          glibc-timezones-2.8.90-alt3
D:    10    2   11    0    4          glibc-utils-2.8.90-alt3
D:    11    2   10    0    5            iconv-2.8.90-alt3
D:    12    8   22    0    6              glibc-2.8.90-alt3
D:    13    4   19    0    7                glibc-devel-2.8.90-alt3
D:    14    1   18    0    8                  glibc-devel-static-2.8.90-alt3
D:    15    4    8    0    8                  gcc4.3-4.3.2-alt5
D:    16    1    4    0    2      libgfortran4.3-4.3.2-alt5
D:    17    2    3    0    3        libgfortran4.3-devel-4.3.2-alt5
D:    18    3    6    0    4          gcc4.3-fortran-4.3.2-alt5
D:    19    2    2    0    3        libstdc++4.3-4.3.2-alt5
D:    20    2    1    0    4          libstdc++4.3-devel-4.3.2-alt5
D: ========== successors only (presentation order)
D:    21    3    7    0    5            gcc4.3-c++-4.3.2-alt5

Note that #succesors value is actually changed using the package index
in the input list of packages (on the command line): earlier packages
have higher values.  This is called "successors from tsort are processed
in presentation order".  E.g. when choosing to upgrade between cpp4.3,
libgcc4.3, and libgfortran4.3, cpp4.3 gets upgraded first.  (The
collation is probably due to using shell glob on the command line.)

The problem is that, in cpp4.3 %post-script, some pthread-dependent
code might be called, and pthread shared library is simply mssing
at that point (after glibc-core upgrade and before glibc-pthread
install).

New order is:
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    1    0    0  glibc-preinstall-2.8.90-alt3
D:     1    1   17    0    1    glibc-core-2.8.90-alt3
D:     2    1    3    0    2      libgcc4.3-4.3.2-alt5
D:     3    2    8    0    3        glibc-pthread-2.8.90-alt3
D:     4    2    2    0    4          glibc-gconv-modules-2.8.90-alt3
D:     5    2    2    0    4          glibc-nss-2.8.90-alt3
D:     6    2    1    0    5            iconv-2.8.90-alt3
D:     7    2    1    0    4          glibc-locales-2.8.90-alt3
D:     8    2    1    0    4          glibc-timezones-2.8.90-alt3
D:     9    2    1    0    4          glibc-utils-2.8.90-alt3
D:    10    8    1    0    5            glibc-2.8.90-alt3
D:    11    4    4    0    6              glibc-devel-2.8.90-alt3
D:    12    2    1    0    3        libstdc++4.3-4.3.2-alt5
D:    13    2    1    0    4          libstdc++4.3-devel-4.3.2-alt5
D:    14    1    1    0    2      cpp4.3-4.3.2-alt5
D:    15    4    2    0    3        gcc4.3-4.3.2-alt5
D:    16    1    1    0    2      libgfortran4.3-4.3.2-alt5
D:    17    2    1    0    3        libgfortran4.3-devel-4.3.2-alt5
D: ========== successors only (presentation order)
D:    18    2    0    0    4          glibc-core-debug-2.8.90-alt3
D:    19    1    0    0    7                glibc-devel-static-2.8.90-alt3
D:    20    3    0    0    4          gcc4.3-fortran-4.3.2-alt5
D:    21    3    0    0    4          gcc4.3-c++-4.3.2-alt5

Note that #succesors now indicates the number of immediate successors;
libgcc4.3 now has 3 immediate successors (glibc-pthread, gcc4.3, and
libstdc++4.3), while cpp4.3 and libgfortran4.3 have only one immediate
successor.

Also removed tools/rpmsort.c.

> The are various serial representations of a partially ordered set.
>
> The default is what I call "chainsaw", always emit the node that has
> the most children.  The "chainsaw" heuristic tries to emit nodes that
> are depended upon as early as possible to localize interactions
> amongst packages, but really should be
>     Always emit the node of the largest sub-tree.
> rather than the number of immediate children. I call this "buzzsaw".
>
> Anaconda has the constraint of changing cd's during install. So
> "presentation" ordering preserves the arrival ordering into a
> transaction set. Too bad that "presentation" ordering is often
> incorrect because of no loop analysis first.

https://lists.dulug.duke.edu/pipermail/rpm-devel/2005-June/000468.html
2008-11-10 05:21:23 +03:00
ba75c265e9 Import rpm*cmp utilities from rpm-utils (ALT#13627) 2008-10-28 00:28:56 +00:00
Alexey Tourbin
c23e7c1c58 pdeath_execute.c: remove X_OK check, use execvp(3)
Both (F_OK|X_OK) cannot be tested at the same time, which means that
X_OK is X_OK for directories, too.  And anyway there's a huge period
of time between X_OK test and exec.  So I remove the test which cannot
be performed reliably.  As a bonus, I also replace execv() with execvp().
2008-07-08 14:39:01 +00:00
Alexey Tourbin
312c51d845 pdeath_execute.c: remove X_OK check, use execvp(3)
Both (F_OK|X_OK) cannot be tested at the same time, which means that
X_OK is X_OK for directories, too.  And anyway there's a huge period
of time between X_OK test and exec.  So I remove the test which cannot
be performed reliably.  As a bonus, I also replace execv() with execvp().
2008-07-07 05:33:00 +04:00
d534994b4e relative: Fix potential NULL dereference (ALT#14067) 2008-01-17 18:12:23 +00:00
b21c2f85da relative.c: Reindent 2007-12-13 23:17:31 +00:00
d013b49984 relative.c: Use heap for memory allocation
Stack allocation is unsafe:
$ ulimit -s 64; relative /b `perl -e 'print "/a" x 32768'`
2007-12-13 23:17:31 +00:00
986ef530f3 relative.c: Introduce xstrdup(), reindent 2007-12-13 23:17:30 +00:00
c97667fad5 relative.c: Fix normalize()
Testcase:
$ relative //a/. /
a/
2007-12-13 23:17:30 +00:00
afed4d2da9 relative.c: Reindent 2007-12-13 23:17:30 +00:00
2949819ce6 relative.c: s/__progname/program_invocation_short_name/ 2007-12-13 23:17:30 +00:00
4c5f7e154d relative.c: Reindent 2007-12-13 23:17:30 +00:00
Alex V. Myltsev
9a21fe32e7 relative.c: fix an off-by-one (kind of) error.
Test:
 $ relative /a/b/ /ax/
should print "../a/b/".
2007-12-13 23:17:30 +00:00
5416277102 Removed cvsid tags. 2006-05-14 17:05:34 +04:00
122bb298a3 Update call to dump_ld_config. 2006-01-12 11:58:59 +00:00
f76cb49ae0 Strip prefix from output. 2006-01-11 00:50:33 +00:00
0cf1e74e0c Add dump_ld_config. 2006-01-09 20:55:49 +00:00
fd1778bbee fixed options processing 2005-10-16 16:52:49 +00:00
5070a1d354 makefiles cleanup3 2003-11-24 21:00:45 +00:00
1cff6d97bc makefiles cleanup1 2003-11-24 20:44:29 +00:00