Browse Source
Treat labels which are used only by directives in other labels as used if the other label itself is used by an opcode: that is, propagate the transitive usage of labels. Fixes #35dev/git-series/gccdum

5 changed files with 139 additions and 18 deletions
@ -0,0 +1,46 @@
|
||||
.file "example.cpp" |
||||
.intel_syntax noprefix |
||||
.text |
||||
.Ltext0: |
||||
.globl s_sA |
||||
.section .rodata |
||||
.LC0: |
||||
.string "hello world!" |
||||
.data |
||||
.align 8 |
||||
.type s_sA, @object |
||||
.size s_sA, 8 |
||||
s_sA: |
||||
.quad .LC0 |
||||
.section .rodata |
||||
.align 8 |
||||
.type s_sB, @object |
||||
.size s_sB, 10 |
||||
s_sB: |
||||
.string "hey there" |
||||
.text |
||||
.globl main |
||||
.type main, @function |
||||
main: |
||||
.LFB0: |
||||
.file 1 "/tmp/gcc-explorer-compiler116820-58-ewfj5u/example.cpp" |
||||
.loc 1 6 0 |
||||
.cfi_startproc |
||||
push rbp |
||||
.cfi_def_cfa_offset 16 |
||||
.cfi_offset 6, -16 |
||||
mov rbp, rsp |
||||
.cfi_def_cfa_register 6 |
||||
.loc 1 7 0 |
||||
mov rax, QWORD PTR s_sA[rip] |
||||
mov rdi, rax |
||||
call puts |
||||
.loc 1 8 0 |
||||
mov edi, OFFSET FLAT:s_sB |
||||
call puts |
||||
.loc 1 9 0 |
||||
mov eax, 0 |
||||
pop rbp |
||||
.cfi_def_cfa 7, 8 |
||||
ret |
||||
.cfi_endproc |
@ -0,0 +1,17 @@
|
||||
.LC0: |
||||
.string "hello world!" |
||||
s_sA: |
||||
.quad .LC0 |
||||
s_sB: |
||||
.string "hey there" |
||||
main: |
||||
push rbp |
||||
mov rbp, rsp |
||||
mov rax, QWORD PTR s_sA[rip] |
||||
mov rdi, rax |
||||
call puts |
||||
mov edi, OFFSET FLAT:s_sB |
||||
call puts |
||||
mov eax, 0 |
||||
pop rbp |
||||
ret |
Loading…
Reference in new issue