Skip to content

Commit f4a18c4

Browse files
jasonmolendaMichael137
authored andcommitted
Strip authentication bits from vtable load address (llvm#71128)
The current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets. This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in llvm#67599 so I needed to update the local patch, and was reminded that I should upstream this. (cherry picked from commit de24b0e)
1 parent a218f91 commit f4a18c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,17 @@ llvm::Expected<LanguageRuntime::VTableInfo>
235235
"failed to get the address of the value");
236236

237237
Status error;
238-
const lldb::addr_t vtable_load_addr =
238+
lldb::addr_t vtable_load_addr =
239239
process->ReadPointerFromMemory(original_ptr, error);
240240

241241
if (!error.Success() || vtable_load_addr == LLDB_INVALID_ADDRESS)
242242
return llvm::createStringError(std::errc::invalid_argument,
243243
"failed to read vtable pointer from memory at 0x%" PRIx64,
244244
original_ptr);
245-
;
245+
246+
// The vtable load address can have authentication bits with
247+
// AArch64 targets on Darwin.
248+
vtable_load_addr = process->FixDataAddress(vtable_load_addr);
246249

247250
// Find the symbol that contains the "vtable_load_addr" address
248251
Address vtable_addr;

0 commit comments

Comments
 (0)