Skip to content

Instantly share code, notes, and snippets.

@vegard

vegard/pointer.c Secret

Created February 11, 2018 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vegard/72e1af7dc01ac4bb25d033870347328d to your computer and use it in GitHub Desktop.
Save vegard/72e1af7dc01ac4bb25d033870347328d to your computer and use it in GitHub Desktop.
int x = 0x12345678;
const int *xptr = &x;
#if 0
$ gcc -O2 -c test.c && objdump -Dr test.o
test.o: file format elf64-x86-64
Disassembly of section .data:
0000000000000000 <xptr>:
...
0: R_X86_64_64 x
0000000000000008 <x>:
8: 78 56 js 60 <x+0x58>
a: 34 12 xor $0x12,%al
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment