This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH roland/x86_64-crt1-cfi] BZ#15407: Complete CFI annotations in x86_64 _start code.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Cc: Jan Kratochvil <jkratoch at redhat dot com>
- Date: Fri, 26 Apr 2013 14:26:36 -0700 (PDT)
- Subject: [PATCH roland/x86_64-crt1-cfi] BZ#15407: Complete CFI annotations in x86_64 _start code.
Wholly untested, but looks obviously right. I've asked HJ to come up with
a test case that exhibits the problems created by the current incomplete
CFI for _start. I'd prefer to put this in along with a test that fails
before this change and passes after it.
Thanks,
Roland
2013-04-26 Roland McGrath <roland@hack.frob.com>
[BZ #15407]
* sysdeps/x86_64/start.S (_start): Use cfi_adjust_cfa_offset for
change to the stack pointer.
--- a/sysdeps/x86_64/start.S
+++ b/sysdeps/x86_64/start.S
@@ -88,6 +88,7 @@ _start:
#else
popq %rsi /* Pop the argument count. */
#endif
+ cfi_adjust_cfa_offset (LP_SIZE)
/* argv starts just at the current stack top. */
mov %RSP_LP, %RDX_LP
/* Align the stack to a 16 byte boundary to follow the ABI. */
@@ -95,10 +96,12 @@ _start:
/* Push garbage because we push 8 more bytes. */
pushq %rax
+ cfi_adjust_cfa_offset (-8)
/* Provide the highest stack address to the user code (for stacks
which grow downwards). */
pushq %rsp
+ cfi_adjust_cfa_offset (-8)
#ifdef SHARED
/* Pass address of our own entry points to .fini and .init. */