On Wed, 27 May 2026 15:29:17 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).
>
> George Adams has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   bump copyright year

I see there's a committer vote for you but I guess this change shouldn't sit 
and wait for that to be over.

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

PR Comment: https://git.openjdk.org/jdk/pull/31294#issuecomment-4566766756

Reply via email to