public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Roland McGrath <roland@redhat.com>
Cc: GNU libc hackers <libc-hacker@sources.redhat.com>
Subject: Re: syscall.S unwind info
Date: Thu, 08 May 2003 07:38:00 -0000	[thread overview]
Message-ID: <hou1c56g70.fsf@byrd.suse.de> (raw)
In-Reply-To: <u8issmd27z.fsf@gromit.moeb> (Andreas Jaeger's message of "Wed, 07 May 2003 20:46:24 +0200")


Here's a patch for sysdep.h to add the unwind info.

What do you think?  Is this the right way to add the eh frame info to
the syscalls?

Andreas

============================================================
Index: sysdeps/unix/sysv/linux/x86_64/sysdep.h
--- sysdeps/unix/sysv/linux/x86_64/sysdep.h	5 May 2003 08:45:16 -0000	1.17
+++ sysdeps/unix/sysv/linux/x86_64/sysdep.h	8 May 2003 07:37:57 -0000
@@ -77,26 +77,57 @@
 #undef	PSEUDO
 #define	PSEUDO(name, syscall_name, args)				      \
   .text;								      \
-  ENTRY (name)								      \
-    DO_CALL (syscall_name, args);					      \
+  .LF25: ENTRY (name)							      \
+    DO_CALL (syscall_name, args);				              \
     cmpq $-4095, %rax;							      \
     jae SYSCALL_ERROR_LABEL;						      \
+  DWARF_INFO (name) \
   L(pseudo_end):
 
+#define DWARF_INFO(name)						\
+        .section        .eh_frame,"a",@progbits;			\
+.Lframe1:								\
+        .long   .LECIE1-.LSCIE1; /* Length of Common Information Entry */ \
+.LSCIE1:								\
+        .long   0x0;     /* CIE Identifier Tag  */			\
+        .byte   0x1;     /* CIE Version  */				\
+        .ascii "zR\0";   /* CIE Augmentation  */			\
+        .uleb128 0x1;    /* CIE Code Alignment Factor  */		\
+        .sleb128 -8;     /* CIE Data Alignment Factor  */		\
+        .byte   0x10;    /* CIE RA Column  */				\
+        .uleb128 0x1;    /* Augmentation size  */			\
+        .byte   0x1b;    /* FDE Encoding (pcrel sdata4)  */		\
+        .byte   0xc;     /* DW_CFA_def_cfa  */				\
+        .uleb128 0x7;							\
+        .uleb128 0x8;							\
+        .byte   0x90;    /* DW_CFA_offset, column 0x10  */		\
+        .uleb128 0x1;							\
+        .align 8;							\
+.LECIE1:								\
+.LSFDE1:								\
+        .long   .LEFDE1-.LASFDE1;        /* FDE Length  */		\
+.LASFDE1:								\
+        .long   .LASFDE1-.Lframe1;       /* FDE CIE offset  */		\
+        .long   .LF25-.;   /* FDE initial location  */			\
+        .long   .LFE1-.LF25;     /* FDE address range  */		\
+        .uleb128 0x0;     /* Augmentation size  */			\
+        .align 8;							\
+.LEFDE1: .text;
+
 #undef	PSEUDO_END
 #define	PSEUDO_END(name)						      \
   SYSCALL_ERROR_HANDLER							      \
-  END (name)
+  .LFE1: END (name)							      \
 
 #undef	PSEUDO_NOERRNO
 #define	PSEUDO_NOERRNO(name, syscall_name, args) \
   .text;								      \
-  ENTRY (name)								      \
+  .LF25: ENTRY (name)								      \
     DO_CALL (syscall_name, args)
 
 #undef	PSEUDO_END_NOERRNO
-#define	PSEUDO_END_NOERRNO(name) \
-  END (name)
+#define	PSEUDO_END_NOERRNO(name)		\
+  .LFE1: END (name)				\
 
 #define ret_NOERRNO ret
 

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

      reply	other threads:[~2003-05-08  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07 18:43 Roland McGrath
2003-05-07 19:14 ` Andreas Jaeger
2003-05-08  7:38   ` Andreas Jaeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hou1c56g70.fsf@byrd.suse.de \
    --to=aj@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).