PPC/S390: Place SaveCalleeSavedRegisters under the .text section
Top-level inline-asm has no knowledge of its current section and continues under whatever section that was defined before it. `src/heap/base/stack.h` in this case is defining some global constant values and as a result the previous section in this case is `.rodata`, hence we may be placing instructions in a (potentially not properly aligned) read only data section (which happens to become executable). This CL forces the assembler to place these in the .text section and gives them a correct alignment. Change-Id: Ie9288b6c024f6ff0f399620169e5f777986e96c7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035887 Reviewed-by: Nikolaos Papaspyrou <nikolaos@chromium.org> Commit-Queue: Milad Farazmand <mfarazma@redhat.com> Cr-Commit-Position: refs/heads/main@{#84367}
This commit is contained in:
parent
2f4397d652
commit
23f4346062
@ -26,12 +26,15 @@ static_assert(heap::base::Stack::NumberOfCalleeSavedRegisters() == 20,
|
||||
"Mismatch in the number of callee-saved registers");
|
||||
static_assert(sizeof(intptr_t) == 8, "Mismatch in word size");
|
||||
|
||||
asm(".align 2 \n"
|
||||
asm(
|
||||
#if defined(_AIX)
|
||||
".globl .SaveCalleeSavedRegisters, hidden \n"
|
||||
".csect .text[PR] \n"
|
||||
".align 2 \n"
|
||||
".globl .SaveCalleeSavedRegisters, hidden \n"
|
||||
".SaveCalleeSavedRegisters: \n"
|
||||
#else
|
||||
".text \n"
|
||||
".align 2 \n"
|
||||
".globl SaveCalleeSavedRegisters \n"
|
||||
".type SaveCalleeSavedRegisters, %function \n"
|
||||
".hidden SaveCalleeSavedRegisters \n"
|
||||
|
@ -21,7 +21,9 @@ static_assert(heap::base::Stack::NumberOfCalleeSavedRegisters() == 10,
|
||||
"Mismatch in the number of callee-saved registers");
|
||||
static_assert(sizeof(intptr_t) == 8, "Mismatch in word size");
|
||||
|
||||
asm(".globl SaveCalleeSavedRegisters \n"
|
||||
asm(".text \n"
|
||||
".align 8 \n"
|
||||
".globl SaveCalleeSavedRegisters \n"
|
||||
".type SaveCalleeSavedRegisters, %function \n"
|
||||
".hidden SaveCalleeSavedRegisters \n"
|
||||
"SaveCalleeSavedRegisters: \n"
|
||||
|
Loading…
Reference in New Issue
Block a user