summaryrefslogtreecommitdiffstats
path: root/patches/prelink-0.0.20071009/generic/dso.c.dpatch
blob: f6b3fa7c1190f0997225c534a114e06b560e30cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh -e
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Changed optimization level.

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0
@DPATCH@

--- prelink-0.0.20030902.orig/src/dso.c	2003-08-11 11:55:11.000000000 +0000
+++ prelink-0.0.20030902/src/dso.c	2003-09-16 23:26:16.000000000 +0000
@@ -334,7 +334,13 @@
       }
     else
       sections[--k] = i;
+/* this fails for the statically linked upx executable
   assert (j == k);
+*/
+  if (j != k) {
+      printf("assert(j == k) at dso.c:311 has failed for file %s\n", name);
+      goto error_out;
+  }
 
   section_cmp_dso = dso;
   qsort (sections + k, dso->ehdr.e_shnum - k, sizeof (*sections), section_cmp);