.byte values using the inc instruction in a small x86 64 asm project . I want to increment the values of .byte 0x0d and .byte 0x04 in my code to change them to .byte 0x0f and .byte 0x05, respectively..byte values by using inc byte ptr [rip+offset] to modify the bytes at the correct memory offsets. So when I run the code, I encounter a SIGSEGV, a segmentation fault at the inc instructions, even though I verified the offsets using objdump and confirmed that they are correct_start and manually adjust the byte values, but this approach didn’t work when assembling the code.SIGSEGV when trying to modify these .byte values with inc byte ptr [rip+offset]?.byte values directly in assembly , I don't quite know rip relative addressing . How can I achieve this modification without causing a crash?
SIGSEGV because .byte values are in the code section, which is read-only. You cannot modify them directly with inc. store them in a writable data section like .data or .bss, then modify them using the correct addressing mode.