ia64/xen-unstable

changeset 11274:62b7b5f3029f

[LINUX] Define ELFNOTE as a preprocessor macro rather than an assembler macro

Assembler .macros have various issues with string arguments and :varargs.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Aug 23 14:34:25 2006 +0100 (2006-08-23)
parents 0bb18319b8a0
children 7ca72a1c4182
files patches/linux-2.6.16.13/series patches/linux-2.6.16.13/x86-elfnote-as-preprocessor-macro.patch
line diff
     1.1 --- a/patches/linux-2.6.16.13/series	Wed Aug 23 11:27:06 2006 +0100
     1.2 +++ b/patches/linux-2.6.16.13/series	Wed Aug 23 14:34:25 2006 +0100
     1.3 @@ -20,3 +20,4 @@ xen-hotplug.patch
     1.4  xenoprof-generic.patch
     1.5  x86-put-note-sections-into-a-pt_note-segment-in-vmlinux.patch
     1.6  x86_64-put-note-sections-into-a-pt_note-segment-in-vmlinux.patch
     1.7 +x86-elfnote-as-preprocessor-macro.patch
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/linux-2.6.16.13/x86-elfnote-as-preprocessor-macro.patch	Wed Aug 23 14:34:25 2006 +0100
     2.3 @@ -0,0 +1,44 @@
     2.4 +
     2.5 +diff -r 4b7cd997c08f include/linux/elfnote.h
     2.6 +--- a/include/linux/elfnote.h	Wed Aug 23 11:48:46 2006 +0100
     2.7 ++++ b/include/linux/elfnote.h	Wed Aug 23 12:44:27 2006 +0100
     2.8 +@@ -31,22 +31,24 @@
     2.9 + /*
    2.10 +  * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
    2.11 +  * turn out to be the same size and shape), followed by the name and
    2.12 +- * desc data with appropriate padding.  The 'desc' argument includes
    2.13 +- * the assembler pseudo op defining the type of the data: .asciz
    2.14 +- * "hello, world"
    2.15 ++ * desc data with appropriate padding.  The 'desctype' argument is the
    2.16 ++ * assembler pseudo op defining the type of the data e.g. .asciz while
    2.17 ++ * 'descdata' is the data itself e.g.  "hello, world".
    2.18 ++ *
    2.19 ++ * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
    2.20 ++ *      ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
    2.21 +  */
    2.22 +-.macro ELFNOTE name type desc:vararg
    2.23 +-.pushsection ".note.\name"
    2.24 +-  .align 4
    2.25 +-  .long 2f - 1f			/* namesz */
    2.26 +-  .long 4f - 3f			/* descsz */
    2.27 +-  .long \type
    2.28 +-1:.asciz "\name"
    2.29 +-2:.align 4
    2.30 +-3:\desc
    2.31 +-4:.align 4
    2.32 +-.popsection
    2.33 +-.endm
    2.34 ++#define ELFNOTE(name, type, desctype, descdata)	\
    2.35 ++.pushsection .note.name			;	\
    2.36 ++  .align 4				;	\
    2.37 ++  .long 2f - 1f		/* namesz */	;	\
    2.38 ++  .long 4f - 3f		/* descsz */	;	\
    2.39 ++  .long type				;	\
    2.40 ++1:.asciz "name"				;	\
    2.41 ++2:.align 4				;	\
    2.42 ++3:desctype descdata			;	\
    2.43 ++4:.align 4				;	\
    2.44 ++.popsection				;
    2.45 + #else	/* !__ASSEMBLER__ */
    2.46 + #include <linux/elf.h>
    2.47 + /*