From 0b275e5b22751fd62e6a5155dd1dde31353fb9a1 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 30 Aug 2022 19:39:58 -0500 Subject: [PATCH] Set position-independent flag only if it is set in all object segments. Previously, the position-independent attribute bit would be set in a load segment if it was set on the first constituent object segment. Now it is only set in the load segment if it is set in all the constituent object segments. This is consistent with the ORCA linker's general approach of conservatively combining the flags from the object segments. --- linker.notes | 3 +++ out.asm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/linker.notes b/linker.notes index 1cb0521..9f2c539 100644 --- a/linker.notes +++ b/linker.notes @@ -7,6 +7,9 @@ Updated 2022 2.1.0 B1 1. The linker can now automatically divide a large program into segments. See "Auto-Segmentation," below. + 2. A load segment is now flagged as position-independent only if + all the constituent object segments have that attribute set. + 2.0.6 1. The linker could give a spurious error about the relative address calculation for a BRL instruction if it branched forward or backward more than 32 KB. Since the address diff --git a/out.asm b/out.asm index 2f72780..4215695 100644 --- a/out.asm +++ b/out.asm @@ -268,7 +268,7 @@ st1 lda segType or in the or flags sta loadType lda segType mask out missing and flags and #$E200 - ora #$3DFF + ora #$1DFF and loadType sta loadType lda loadType get the type without flags