From 19a54498cfec5e69e857f5d0c051c00adc7f00e2 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Thu, 25 Jun 2026 19:49:32 -0700 Subject: [PATCH 1/7] tools-interface: Remove project DLL base address information * sources/project-manager/tools-interface/project-files.dylan (): Remove the project-information-base-address slot definition. (write-project-to-stream): Do not write the project base address when saving a project. (read-project-from-stream): Do not interpret the base-address: keyword from project sources. --- .../tools-interface/library.dylan | 3 +-- .../tools-interface/project-files.dylan | 19 +------------------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/sources/project-manager/tools-interface/library.dylan b/sources/project-manager/tools-interface/library.dylan index 9bb5aa9a8..6e7a62a01 100644 --- a/sources/project-manager/tools-interface/library.dylan +++ b/sources/project-manager/tools-interface/library.dylan @@ -45,7 +45,7 @@ define module tools-interface project-information-target-type, project-information-executable, project-information-compilation-mode, project-information-major-version, project-information-minor-version, - project-information-base-address, project-information-remaining-keys, + project-information-remaining-keys, project-information-files-setter, project-information-subprojects-setter, project-information-library-setter, @@ -54,7 +54,6 @@ define module tools-interface project-information-compilation-mode-setter, project-information-major-version-setter, project-information-minor-version-setter, - project-information-base-address-setter, project-information-remaining-keys-setter; export read-keyword-pair-file, read-keyword-pair-stream; diff --git a/sources/project-manager/tools-interface/project-files.dylan b/sources/project-manager/tools-interface/project-files.dylan index 744f0c34b..68a3ab208 100644 --- a/sources/project-manager/tools-interface/project-files.dylan +++ b/sources/project-manager/tools-interface/project-files.dylan @@ -34,8 +34,6 @@ define class () init-keyword: major-version:; slot project-information-minor-version :: = 0, init-keyword: minor-version:; - slot project-information-base-address :: false-or() = #f, - init-keyword: base-address:; slot project-information-remaining-keys :: false-or() = #f, init-keyword: remaining-keys:; end class ; @@ -100,12 +98,7 @@ define function write-project-to-stream t[compilation-mode:] := as(, p.project-information-compilation-mode); t[major-version:] := integer-to-string(p.project-information-major-version); t[minor-version:] := integer-to-string(p.project-information-minor-version); - if (p.project-information-base-address) - t[base-address:] - := machine-word-to-string(p.project-information-base-address, prefix: "0x"); - else - remove-key!(t, base-address:); - end if; + remove-key!(t, base-address:); if (version ~= 1 & version ~= 2) error("attempt to write unknown project version: %d", version); @@ -233,16 +226,6 @@ define function read-project-from-stream end if; end if; - let (base-address, line) = single-key((base-address:).key, base-address:); - if (base-address) - let i = string-to-machine-word(base-address, default: #f); - if (i) - p.project-information-base-address := i; - else - err("base-address \"%s\" is not a hex number", list(base-address), line: line); - end if; - end if; - if (error?) tool-error("an error occurred reading project file, halting", serious?: #t); end if; From 4c159135a184efe4da653cb9f3e2ebefcc145424 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Thu, 25 Jun 2026 20:09:49 -0700 Subject: [PATCH 2/7] project-manager: Do not default project DLL base addresses Previously the project-manager would attempt to compute a base address that would allow Windows to load the full set of DLLs in a project without relocations. However, current versions of Windows (starting with Windows Vista and Windows Server 2008) implement Address Space Layout Randomization for improved security, so that the link-time base addresses are no longer meaningful. * sources/project-manager/user-projects/save-project.dylan (save-lid-info): Do not compute a default base address when saving. ($top-for-user-libraries, $allowance-for-user-libraries, library-base, compute-base-address): Remove. --- .../user-projects/save-project.dylan | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/sources/project-manager/user-projects/save-project.dylan b/sources/project-manager/user-projects/save-project.dylan index f70c2e8f8..ad38d954e 100644 --- a/sources/project-manager/user-projects/save-project.dylan +++ b/sources/project-manager/user-projects/save-project.dylan @@ -152,8 +152,7 @@ define function save-lid-info p.project-lid-location.locator-directory)) end; save-single-value(stream, #"executable", executable); - save-single-value(stream, #"base-address", - base-address-string | compute-base-address(p, #f)); + save-single-value(stream, #"base-address", base-address-string); save-single-value(stream, #"debug-command", debug-command); save-single-value(stream, #"debug-arguments", debug-arguments-string); save-single-value(stream, #"debug-machine", debug-machine); @@ -385,41 +384,3 @@ define method destructure-flat-assoc-list (list-seq :: , rank == 3, table end; - - -/// All Functional Developer DLLs that may be used by user libraries reside above -/// this address. Consequently, it's an upper bound for the base for user -/// libraries including our private libraries (e.g., the compiler and environment) -define constant $top-for-user-libraries = #x64000; - -/// Presume that user libraries fit into 32 pages (128K) -define constant $allowance-for-user-libraries = #x20; -define method library-base (#key base-address = #f, #all-keys) - => (base :: false-or()) - base-address -end method; - -define method compute-base-address (project :: , explicit-base :: false-or()) - => (computed-base :: ) - let base-address = - explicit-base - | begin - let baseless-libraries = 1; - let top = $top-for-user-libraries; - let projects = all-used-projects(project); - for (p in projects) - let base = apply(library-base, project-build-settings(p)); - if (base) - let base :: = base; - top := min(top, - as(, machine-word-unsigned-shift-right(base, 12))) - else - baseless-libraries := baseless-libraries + 1 - end - end; - let machine-word :: = - as(, top - baseless-libraries * $allowance-for-user-libraries); - machine-word-unsigned-shift-left(machine-word, 12) - end begin; - machine-word-to-string(base-address, prefix: "0x") -end method compute-base-address; From d1fe8096b987637ae8383ad2bcda165a00886191 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Thu, 25 Jun 2026 20:48:54 -0700 Subject: [PATCH 3/7] environment-tools: Remove the base address from project settings The DLL base address is no longer a useful project setting, so it can be removed from the IDE project link settings page. * sources/environment/tools/project-settings.dylan (): Remove %base-address slot. Remove %base-address-pane pane definition. Remove Base address grouping from layout. (): Remove base-address initializer from the construction. (update-project-settings): Remove update of project-base-address from the . (valid-project-settings?): Remove validation of the base-address. --- .../environment/tools/project-settings.dylan | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/sources/environment/tools/project-settings.dylan b/sources/environment/tools/project-settings.dylan index db4af4582..9388c775a 100644 --- a/sources/environment/tools/project-settings.dylan +++ b/sources/environment/tools/project-settings.dylan @@ -85,8 +85,6 @@ define pane () required-init-keyword: target-type:; sealed slot %interface-type :: , required-init-keyword: interface-type:; - sealed slot %base-address :: false-or(), - required-init-keyword: base-address:; sealed slot %major-version :: false-or(), required-init-keyword: major-version:; sealed slot %minor-version :: false-or(), @@ -140,14 +138,6 @@ define pane () value-changed-callback: method (gadget) pane.%interface-type := gadget.gadget-value end); - pane %base-address-pane (pane) - make(, - enabled?: pane.%enabled?, - value-type: , - value: pane.%base-address, - value-changing-callback: method (gadget) - pane.%base-address := gadget.gadget-value - end); pane %major-version-pane (pane) make(, enabled?: pane.%enabled?, @@ -175,13 +165,6 @@ define pane () vector(make(