rebase: Update to 4.4.4

This commit is contained in:
Alexey Pavlov 2018-07-27 11:19:31 +03:00
parent 6e4a9d7621
commit 02b52dbc1f
7 changed files with 168 additions and 19 deletions

View File

@ -32,8 +32,8 @@ diff -urN rebase-4.4.1.orig/configure.ac rebase-4.4.1/configure.ac
# configure.ac for rebase # configure.ac for rebase
AC_PREREQ([2.64]) AC_PREREQ([2.64])
-AC_INIT([rebase], [4.4.2], [cygwin@cygwin.com]) -AC_INIT([rebase], [4.4.4], [cygwin@cygwin.com])
+AC_INIT([rebase], [4.4.2], [msys2-users@lists.sourceforge.net]) +AC_INIT([rebase], [4.4.4], [msys2-users@lists.sourceforge.net])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([peflags.c]) AC_CONFIG_SRCDIR([peflags.c])
AC_PREFIX_DEFAULT([/usr]) AC_PREFIX_DEFAULT([/usr])

View File

@ -0,0 +1,101 @@
X-Git-Url: https://cygwin.com/git/gitweb.cgi?p=cygwin-apps%2Frebase.git;a=blobdiff_plain;f=rebase.c;h=0cf66451cc62ebe6f96ccd5d9ab51aacf16e315f;hp=6f98d37f5dc8caaf4e2c1e920308edb2da054e10;hb=f2091d130b7bc09f90fa63494e72da5d50f957f0;hpb=2b306dafb760311b04633e611e9931ed638ad15b
diff --git a/rebase.c b/rebase.c
index 6f98d37..0cf6645 100644
--- a/rebase.c
+++ b/rebase.c
@@ -649,7 +649,14 @@ merge_image_info ()
{
/* Reuse the old address if possible. */
if (match->slot_size < img_info_list[i].slot_size)
- match->base = 0;
+ {
+ match->base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because it won't fit in it's old slot size\n", img_info_list[i].name);
+ }
+ else if (verbose)
+ fprintf (stderr, "rebasing %s because it's not located at it's old slot\n", img_info_list[i].name);
+
match->flag.needs_rebasing = 1;
}
/* Unconditionally overwrite old with new size. */
@@ -668,8 +675,12 @@ merge_image_info ()
img_info_list[i--] = img_info_list[--img_info_size];
}
else if (!img_info_list[i].flag.cannot_rebase)
- /* Not in database yet. Set base to 0 to choose a new one. */
- img_info_list[i].base = 0;
+ {
+ /* Not in database yet. Set base to 0 to choose a new one. */
+ img_info_list[i].base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because not in database yet\n", img_info_list[i].name);
+ }
}
}
if (!img_info_rebase_start || force_rebase_flag)
@@ -682,7 +693,11 @@ merge_image_info ()
if (i < img_info_rebase_start)
set_cannot_rebase (&img_info_list[i]);
if (!img_info_list[i].flag.cannot_rebase)
- img_info_list[i].base = 0;
+ {
+ img_info_list[i].base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because forced or database missing\n", img_info_list[i].name);
+ }
}
img_info_rebase_start = 0;
}
@@ -726,6 +741,8 @@ merge_image_info ()
if (cur_base != img_info_list[i].base)
{
img_info_list[i].flag.needs_rebasing = 1;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because it's base has changed (due to being reinstalled?)\n", img_info_list[i].name);
/* Set cur_base to the old base to simplify subsequent tests. */
cur_base = img_info_list[i].base;
}
@@ -733,17 +750,29 @@ merge_image_info ()
anymore, rebase this DLL from scratch. */
if (i + 1 < img_info_rebase_start
&& cur_base + slot_size + offset >= img_info_list[i + 1].base)
- img_info_list[i].base = 0;
+ {
+ img_info_list[i].base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because it won't fit in it's old slot without overlapping next DLL\n", img_info_list[i].name);
+ }
/* Does the previous DLL reach into the address space of this
DLL? This happens if the previous DLL is not rebaseable. */
else if (i > 0 && cur_base < img_info_list[i - 1].base
+ img_info_list[i + 1].slot_size)
- img_info_list[i].base = 0;
+ {
+ img_info_list[i].base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because previous DLL now overlaps\n", img_info_list[i].name);
+ }
/* Does the file match the base address requirements? If not,
rebase from scratch. */
else if ((down_flag && cur_base + slot_size + offset >= image_base)
|| (!down_flag && cur_base < image_base))
- img_info_list[i].base = 0;
+ {
+ img_info_list[i].base = 0;
+ if (verbose)
+ fprintf (stderr, "rebasing %s because it's base address is outside the expected area\n", img_info_list[i].name);
+ }
}
/* Unconditionally overwrite old with new size. */
img_info_list[i].size = cur_size;
@@ -940,6 +969,8 @@ collect_image_info (const char *pathname)
img_info_list[img_info_size].name_size = strlen (full_path) + 1;
}
#endif
+ if (verbose)
+ fprintf (stderr, "rebasing %s because filename given on command line\n", img_info_list[img_info_size].name);
++img_info_size;
return TRUE;
}

View File

@ -0,0 +1,42 @@
From 1def5794ab48d0eae1589378df79714d8ff755d7 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Thu, 8 Feb 2018 22:34:43 +0000
Subject: [PATCH 1/1] Fix some errors which cause unnecessary rebases
---
rebase.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rebase.c b/rebase.c
index 0cf6645..ca3c59d 100644
--- a/rebase.c
+++ b/rebase.c
@@ -749,7 +749,7 @@ merge_image_info ()
/* However, if the DLL got bigger and doesn't fit into its slot
anymore, rebase this DLL from scratch. */
if (i + 1 < img_info_rebase_start
- && cur_base + slot_size + offset >= img_info_list[i + 1].base)
+ && cur_base + slot_size + offset > img_info_list[i + 1].base)
{
img_info_list[i].base = 0;
if (verbose)
@@ -758,7 +758,7 @@ merge_image_info ()
/* Does the previous DLL reach into the address space of this
DLL? This happens if the previous DLL is not rebaseable. */
else if (i > 0 && cur_base < img_info_list[i - 1].base
- + img_info_list[i + 1].slot_size)
+ + img_info_list[i - 1].slot_size)
{
img_info_list[i].base = 0;
if (verbose)
@@ -766,7 +766,7 @@ merge_image_info ()
}
/* Does the file match the base address requirements? If not,
rebase from scratch. */
- else if ((down_flag && cur_base + slot_size + offset >= image_base)
+ else if ((down_flag && cur_base + slot_size + offset > image_base)
|| (!down_flag && cur_base < image_base))
{
img_info_list[i].base = 0;
--
2.9.3

View File

@ -1,9 +1,9 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com> # Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=rebase pkgname=rebase
pkgver=4.4.2 pkgver=4.4.4
pkgrel=2 pkgrel=1
pkgdesc="The Cygwin rebase distribution contains four utilities, rebase, rebaseall, peflags, and peflagsall." pkgdesc="The Cygwin rebase distribution contains four utilities, rebase, rebaseall, peflags, and peflagsall"
groups=('base') groups=('base')
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
license=('custom') license=('custom')
@ -12,29 +12,35 @@ depends=('msys2-runtime' 'dash')
makedepends=('coreutils' 'git' 'grep' 'gzip' 'sed') makedepends=('coreutils' 'git' 'grep' 'gzip' 'sed')
# options=('debug' '!strip') # options=('debug' '!strip')
source=(${pkgname}-${pkgver}::git://sourceware.org/git/cygwin-apps/rebase.git#tag=${pkgname}-${pkgver//./-} source=(${pkgname}-${pkgver}::git://sourceware.org/git/cygwin-apps/rebase.git#tag=${pkgname}-${pkgver//./-}
'rebase-4.4.1-msys2.patch' '001-rebase-4.4.1-msys2.patch'
'002-rebaseall-add-python-exts.patch'
'003-allow-non-database-mode-when-__CYGWIN__-__MSYS__.patch'
'004-msys2-usr.patch'
'005-make-verbose-give-a-reason.patch'
'006-fix-some-errors.patch'
'autorebase.bat' 'autorebase.bat'
'autorebasebase1st.bat' 'autorebasebase1st.bat'
'rebaseall-add-python-exts.patch' 'pacman-rec-filename-grep')
'pacman-rec-filename-grep'
'allow-non-database-mode-when-__CYGWIN__-__MSYS__.patch'
'msys2-usr.patch')
sha256sums=('SKIP' sha256sums=('SKIP'
'261921df1e581f74751c6dbc5a83c475a57c42bdfef62bdbc9fe8e1f5c648c47' '6e25bfaae229062b20bed52b79824cfd1145de10c2ce50cd72b5a82fff9fbacf'
'b06d561d82e7c32573082cf0207ca80275bab241c61debf2d3d8cc10cf79e31b'
'b4823bfdc169744e05b9c71d513ef570b580ffc9dded4fa482ec644a557de56b'
'825b24888bdf0e5e51691cda8a160905c6e40e991a6098664e2f892e56f87742'
'01bc185bebc0bd8f4ac04207b0c07ee9f8da035eacf0e2ec8019150253597ee7'
'a8b1b5cc6ab188d17dc9f353fa9c6593e2f82e998ce45a8662ff5f3294cb5f7c'
'8e4099a29107a1d03031b198c3d142bbc31a40ff19298d6e099d9bcffd31b1b0' '8e4099a29107a1d03031b198c3d142bbc31a40ff19298d6e099d9bcffd31b1b0'
'0aed2c3a36e1926af4b0c914d208d4846bb0082d2f4886e6bb17d4b8b7fb42d5' '0aed2c3a36e1926af4b0c914d208d4846bb0082d2f4886e6bb17d4b8b7fb42d5'
'b06d561d82e7c32573082cf0207ca80275bab241c61debf2d3d8cc10cf79e31b' '2ca1e58fb1d2625e93224d0d1ca3b86944030ef2572289222b42ccc2387033fd')
'2ca1e58fb1d2625e93224d0d1ca3b86944030ef2572289222b42ccc2387033fd'
'b4823bfdc169744e05b9c71d513ef570b580ffc9dded4fa482ec644a557de56b'
'825b24888bdf0e5e51691cda8a160905c6e40e991a6098664e2f892e56f87742')
prepare() { prepare() {
cd "${srcdir}/${pkgname}-${pkgver}" cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ${srcdir}/rebase-4.4.1-msys2.patch patch -p1 -i ${srcdir}/001-rebase-4.4.1-msys2.patch
patch -p1 -i ${srcdir}/rebaseall-add-python-exts.patch patch -p1 -i ${srcdir}/002-rebaseall-add-python-exts.patch
patch -p1 -i ${srcdir}/allow-non-database-mode-when-__CYGWIN__-__MSYS__.patch patch -p1 -i ${srcdir}/003-allow-non-database-mode-when-__CYGWIN__-__MSYS__.patch
patch -p1 -i ${srcdir}/msys2-usr.patch patch -p1 -i ${srcdir}/004-msys2-usr.patch
patch -p1 -i ${srcdir}/005-make-verbose-give-a-reason.patch
patch -p1 -i ${srcdir}/006-fix-some-errors.patch
if check_option "strip" "n"; then if check_option "strip" "n"; then
sed -i "s/ -s//g" Makefile.in sed -i "s/ -s//g" Makefile.in