Skip to content

Commit 4338cb3

Browse files
committed
8323556: CDS archive space addresses should be randomized with ArchiveRelocationMode=1
Reviewed-by: coleenp Backport-of: 437342b93e9e66340ac57bd1c6fdc948b3302db0
1 parent b7f38fc commit 4338cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
3-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
5858
0x7ffc, 0x7ffe, 0x7fff
5959
};
6060
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
61-
const int start_index = aslr ? os::random() : 0;
61+
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
6262
constexpr int max_tries = 64;
6363
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
6464
// As in os::attempt_reserve_memory_between, we alternate between higher and lower

0 commit comments

Comments
 (0)