Created
January 29, 2014 12:19
-
-
Save sjp38/8686823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
char a[] = "abc"; | |
char *b = "def"; | |
int main(void) | |
{ | |
b = a; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "arr_ptr.c" | |
.globl a | |
.data | |
.type a, @object | |
.size a, 4 | |
a: | |
.string "abc" | |
.globl b | |
.section .rodata | |
.LC0: | |
.string "def" | |
.data | |
.align 8 | |
.type b, @object | |
.size b, 8 | |
b: | |
.quad .LC0 | |
.text | |
.globl main | |
.type main, @function | |
main: | |
.LFB0: | |
.cfi_startproc | |
pushq %rbp | |
.cfi_def_cfa_offset 16 | |
.cfi_offset 6, -16 | |
movq %rsp, %rbp | |
.cfi_def_cfa_register 6 | |
movq $a, b(%rip) | |
movl $0, %eax | |
popq %rbp | |
.cfi_def_cfa 7, 8 | |
ret | |
.cfi_endproc | |
.LFE0: | |
.size main, .-main | |
.ident "GCC: (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3" | |
.section .note.GNU-stack,"",@progbits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment