I want the address of the global variable I create to be a multiple of 0x1000.
sample
char alignstr[0x100] = "this is align string";
int main()
{
printf("var address = [%p]", &alignstr);
}
output
"var address = [0x140005000]"
Just use alignas
:
alignas(0x1000) char alignstr[0x100] = "this is align string";