From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 26D253858439; Tue, 19 Jul 2022 12:34:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26D253858439 To: cygwin-apps-cvs@sourceware.org Subject: [rebase - The rebase tool, core of the automatic rebase facility during postinstall] branch master, updated. 06def3bdcc38d61bf607a040ecc084eae06cbedf X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: b3d56e7ba1baf49b2ce71e858e7386037c4b4124 X-Git-Newrev: 06def3bdcc38d61bf607a040ecc084eae06cbedf Message-Id: <20220719123417.26D253858439@sourceware.org> Date: Tue, 19 Jul 2022 12:34:17 +0000 (GMT) From: Corinna Vinschen X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 12:34:17 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/rebase.git;h=06def3bdcc38d61bf607a040ecc084eae06cbedf commit 06def3bdcc38d61bf607a040ecc084eae06cbedf Author: Corinna Vinschen Date: Tue Jul 19 14:30:14 2022 +0200 Bump to version 4.6.0 Signed-off-by: Corinna Vinschen https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/rebase.git;h=06832109cadd01dd1889a41cf777bac356818d13 commit 06832109cadd01dd1889a41cf777bac356818d13 Author: Christian Franke Date: Tue Jul 19 10:40:55 2022 +0200 Fix index after removing missing DLL from list https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/rebase.git;h=40c1886f024becc9a246c4ddd109a0bec7b6e914 commit 40c1886f024becc9a246c4ddd109a0bec7b6e914 Author: Christian Franke Date: Tue Jul 19 10:36:20 2022 +0200 Print list of DLLs which still overlap after rebasing Diff: --- configure.ac | 2 +- rebase.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8bdffa2..91415d5 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # configure.ac for rebase AC_PREREQ([2.64]) -AC_INIT([rebase], [4.5.0], [cygwin@cygwin.com]) +AC_INIT([rebase], [4.6.0], [cygwin@cygwin.com]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([peflags.c]) AC_PREFIX_DEFAULT([/usr]) diff --git a/rebase.c b/rebase.c index 1f9f74b..7417d4d 100644 --- a/rebase.c +++ b/rebase.c @@ -47,6 +47,7 @@ BOOL load_image_info (); BOOL merge_image_info (); BOOL collect_image_info (const char *pathname); void print_image_info (); +static void print_overlapped (); BOOL rebase (const char *pathname, ULONG64 *new_image_base, BOOL down_flag); void parse_args (int argc, char *argv[]); unsigned long long string_to_ulonglong (const char *string); @@ -323,6 +324,10 @@ main (int argc, char *argv[]) } fprintf (stderr, " %s\n", img_info_list[i].name); } + /* Print list of DLLs which still overlap. This could occur if DLLs are + not rebaseable or if --merge-files is used incorrectly. */ + if (img_info_size) + print_overlapped (); if (save_image_info () < 0) return 2; } @@ -794,6 +799,7 @@ merge_image_info () memmove (overlaps + i, overlaps + i + 1, img_info_size - i - 1); --img_info_rebase_start; --img_info_size; + --i; continue; } slot_size = roundup2 (cur_size, ALLOCATION_SLOT); @@ -1149,6 +1155,39 @@ print_image_info () } } +static void +print_overlapped () +{ + BOOL header; + int i; + char overlaps[img_info_size]; + memset (overlaps, 0, img_info_size); + qsort (img_info_list, img_info_size, sizeof (img_info_t), img_info_cmp); + for (header = FALSE, i = 0; i < img_info_size; ++i) + { + int j; + if (img_info_list[i].flag.needs_rebasing) + continue; /* Rebase failed. */ + for (j = i + 1; j < img_info_size; ++j) + { + if (img_info_list[j].flag.needs_rebasing) + continue; /* Rebase failed. */ + if (img_info_list[i].base + img_info_list[i].slot_size + offset + <= img_info_list[j].base) + break; + overlaps[i] = overlaps[j] = 1; + } + if (!overlaps[i]) + continue; + if (!header) + { + fputs ("\nThe following DLLs still overlap:\n", stderr); + header = TRUE; + } + fprintf (stderr, " %s\n", img_info_list[i].name); + } +} + BOOL rebase (const char *pathname, ULONG64 *new_image_base, BOOL down_flag) {