News for hackers. Stuff that matters.
Re:Declaring C String Constants by bonzini on Wednesday May 17, 2017 @02:57PM (#14361662)
It's a global variable, it's not on the stack. It's in the data section.

$arr is copying the address of "arr", so it must use an immediate move (possibly 64-bit). It could also use RIP-relative with the "lea" (load effective address) instruction.

$ptr(%rip) is accessing memory, so it uses RIP-relative addressing with the "mov" instruction.

Re:Declaring C String Constants by magnetic on Wednesday May 17, 2017 @04:20PM (#14362429)
> It's a global variable, it's not on the stack. It's in the data section.

And because it's a const, it's in the .rodata section... (read-only) Playing too liberally with the data often leads to a SEGV (as it should).