On Tue, 1 Dec 2026 15:45:39 GMT, Kurt Miller <[email protected]> wrote:

> JDK-8396508 introduced dynamic relocations in a read only data section, aka a 
> `TEXTREL` section. `TEXTREL` sections are undesirable from a security 
> standpoint and will cause the jdk to fail to run in an hardened Linux 
> environment like SELinux. It also causes linking to fail when built with 
> clang/lld. 
> 
> This PR adds `-z,text` to `BASIC_LDFLAGS` for gcc to forbid dynamic 
> relocations in read-only sections so that similar issues in the future are 
> caught during the development cycle and switches the `.rodata` section to a 
> RELRO section in 
> [atomic_linux_aarch64.S](https://github.com/openjdk/jdk/compare/master...bsdkurt:jdk:JDK-8398503?expand=1#diff-aac001dcef5d037ac72a231b0d5913247997099a7d08b466f0cf9826a3443482)
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

OK, thanks for fixing this. I understand what is happening.

In hindsight it might have been better to encode the entry points as relative 
rather than absolute addresses in order to avoid .data.rel.ro load-time fixups, 
but it's a minor thing.

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

Marked as reviewed by aph (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/34160#pullrequestreview-6136457947

Reply via email to