On Wed, 27 May 2026 15:11:19 GMT, George Adams <[email protected]> wrote:

> Building the JDK on macOS with the Xcode 26 linker (ld version 1267) produces:
> 
> 
> ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 
> 0x4000 because it exceeds segment maximum alignment
> 
> 
> This comes from libawt, specifically the tentative definitions of `mul8table` 
> and `div8table` in `AlphaMath.c`. These are 64KB uninitialized global arrays 
> that the compiler places in the __common section with 32KB alignment. The 
> Xcode 26 linker caps segment alignment at 16KB (the arm64 page size) and 
> warns when clamping.
> 
> The fix is to change the tentative definitions to explicit zero-initialized 
> definitions:
> 
> Before:
> 
> JNIEXPORT unsigned char mul8table[256][256];
> JNIEXPORT unsigned char div8table[256][256];
> 
> 
> After:
> 
> JNIEXPORT unsigned char mul8table[256][256] = { { 0 } };
> JNIEXPORT unsigned char div8table[256][256] = { { 0 } };
> 
> 
> This moves the symbols from __common to __bss, avoiding the alignment 
> warning. Both sections are zero-filled at load time, and `initAlphaTables()` 
> populates the actual values at runtime, so the change is functionally 
> identical. No impact on other platforms.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: a453a8bd
Author:    George Adams <[email protected]>
Committer: Phil Race <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/a453a8bd0c77885f35b9cf4d63737bd2436207cf
Stats:     3 lines in 1 file changed: 0 ins; 0 del; 3 mod

8385528: Fix linker alignment warning for libawt on macOS with Xcode 26

Reviewed-by: prr, kizune

-------------

PR: https://git.openjdk.org/jdk/pull/31294

Reply via email to