/* ----------------------------------------------------------------------------------- What to do: gcc -c reloc.c objdump -r reloc.o RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 0000000000000006 R_X86_64_PC32 x-0x0000000000000008 0000000000000010 R_X86_64_PC32 x-0x0000000000000008 objdump -d reloc.o Disassembly of section .text: 0000000000000000 : 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: c7 05 00 00 00 00 04 movl $0x4,0x0(%rip) # e ^^^^^^^^^^^ addr 6 (hex) b: 00 00 00 e: c7 05 00 00 00 00 07 movl $0x7,0x0(%rip) # 18 ^^^^^^^^^^^ addr 10 (hex) 15: 00 00 00 18: c9 leaveq 19: c3 retq Depending on where the linker put the variable x, These locations must be updated accordingly ---------------------------------------------------------------------------------- */ int x; void f() { x = 4; x = 7; }