diff --git a/linker.notes b/linker.notes index 184c7be..a2e96c7 100644 --- a/linker.notes +++ b/linker.notes @@ -10,8 +10,15 @@ Updated 2021 calculation for BRL wraps around within the program bank, it can branch forward or backward by up to 64 KB (to any location in the program bank), and the linker now allows this. - - (Stephen Heumann) + + 2. The linker can now link together multiple object segments with + different alignment requirements into a single load segment, + regardless of the order of the object segments. The alignment + of the load segment will be the most restrictive alignment + of any of the object segments, and the alignment requirements + of each object segment will be obeyed. (Previously, an error + would be produced if an object segment processed later had a + more restrictive alignment requirement than an earlier one.) 2.0.5 1. On case-sensitive filesystems (which are not normally used natively on the Apple IIGS, but may be used through emulation diff --git a/out.asm b/out.asm index 4d31441..a818fcd 100644 --- a/out.asm +++ b/out.asm @@ -385,10 +385,13 @@ or4 anop ora loadAlign+2 bne la1 move4 segAlign,loadAlign loadAlign = segAlign - bra la2 else -la1 move4 segAlign,r0 PrepareAlign(segAlign) + bra la3 else +la1 cmpl loadAlign,segAlign if loadAlign < segAlign then + bge la2 + move4 segAlign,loadAlign loadAlign = segAlign +la2 move4 segAlign,r0 PrepareAlign(segAlign) jsr PrepareAlign -la2 anop endif +la3 anop endif bra sa4 ; ; Set the load segment alignment (pass 2) @@ -408,13 +411,9 @@ sa0 lda segAlign skip if alignment is 0 bra sa3 else sa1 cmpl loadAlign,segAlign if loadAlign < segAlign then bge sa2 - ph4 #0 Error(NULL,22) - ph2 #22 - jsr Error - bra sa3 else -sa2 move4 segAlign,r0 DefineAlign(segAlign) + move4 segAlign,loadAlign loadAlign = segAlign +sa2 move4 segAlign,r0 DefineAlign(segAlign) jsr DefineAlign -! anop endif sa3 anop endif jsr CheckAlignOrg check for conflicts between align,org sa4 anop