http://llvm.org/bugs/show_bug.cgi?id=19430
Bug ID: 19430
Summary: cfi_startproc should emit a relocation at the actual
location of the directive to to match gas(1) behavior
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: MC
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Currently .cfi_startproc is bound to the last seen symbol.
This was causing a crash when a cfi_startproc was used before any symbol was
defined (see r206236).
Thus, one has to define a symbol before using .cfi_startproc in an assembly
file.
To match gas(1), we should be emit the relocation based on the location of the
directive, not the last symbol.
More information from Eric Christopher <[email protected]>:
"gas appears to create a symbol for the .cfi_startproc and makes the
relocation relative to it:
.text
.space 1000
.cfi_startproc
.space 1000
.globl _someFunction
_someFunction :
.cfi_def_cfa_offset 16
.cfi_offset %rbp,-16
.cfi_def_cfa_register rbp
ret
.cfi_endproc
RELOCATION RECORDS FOR [.eh_frame]:
OFFSET TYPE VALUE
0000000000000020 R_X86_64_PC32 .text+0x00000000000003e8
which holds up if you do:
.text
.space 1000
.globl _someFunction
_someFunction :
.space 1000
.cfi_startproc
.cfi_def_cfa_offset 16
.cfi_offset %rbp,-16
.cfi_def_cfa_register rbp
ret
.cfi_endproc
RELOCATION RECORDS FOR [.eh_frame]:
OFFSET TYPE VALUE
0000000000000024 R_X86_64_PC32 .text+0x00000000000007d0
which seems to say that to be compatible we'll need to do the
relocation for the .cfi_startproc we need to emit it at the location
of the directive and not at the last known symbol."
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs