ia64/linux-2.6.18-xen.hg

changeset 19:3bf38ecef900

Imported patch x86-elfnote-as-preprocessor-macro.patch from xen-unstable.hg 15200:bd3d6b4c52ec
author Ian Campbell <ian.campbell@xensource.com>
date Mon Jun 04 10:05:24 2007 +0100 (2007-06-04)
parents 50af4d15dfea
children cb5094f46707
files include/linux/elfnote.h
line diff
     1.1 --- a/include/linux/elfnote.h	Mon Jun 04 10:05:24 2007 +0100
     1.2 +++ b/include/linux/elfnote.h	Mon Jun 04 10:05:24 2007 +0100
     1.3 @@ -31,22 +31,38 @@
     1.4  /*
     1.5   * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
     1.6   * turn out to be the same size and shape), followed by the name and
     1.7 - * desc data with appropriate padding.  The 'desc' argument includes
     1.8 - * the assembler pseudo op defining the type of the data: .asciz
     1.9 - * "hello, world"
    1.10 + * desc data with appropriate padding.  The 'desctype' argument is the
    1.11 + * assembler pseudo op defining the type of the data e.g. .asciz while
    1.12 + * 'descdata' is the data itself e.g.  "hello, world".
    1.13 + *
    1.14 + * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
    1.15 + *      ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
    1.16   */
    1.17 -.macro ELFNOTE name type desc:vararg
    1.18 -.pushsection ".note.\name"
    1.19 -  .align 4
    1.20 -  .long 2f - 1f			/* namesz */
    1.21 -  .long 4f - 3f			/* descsz */
    1.22 -  .long \type
    1.23 -1:.asciz "\name"
    1.24 -2:.align 4
    1.25 -3:\desc
    1.26 -4:.align 4
    1.27 +#ifdef __STDC__
    1.28 +#define ELFNOTE(name, type, desctype, descdata...) \
    1.29 +.pushsection .note.name			;	\
    1.30 +  .align 4				;	\
    1.31 +  .long 2f - 1f		/* namesz */	;	\
    1.32 +  .long 4f - 3f		/* descsz */	;	\
    1.33 +  .long type				;	\
    1.34 +1:.asciz #name				;	\
    1.35 +2:.align 4				;	\
    1.36 +3:desctype descdata			;	\
    1.37 +4:.align 4				;	\
    1.38  .popsection
    1.39 -.endm
    1.40 +#else /* !__STDC__, i.e. -traditional */
    1.41 +#define ELFNOTE(name, type, desctype, descdata) \
    1.42 +.pushsection .note.name			;	\
    1.43 +  .align 4				;	\
    1.44 +  .long 2f - 1f		/* namesz */	;	\
    1.45 +  .long 4f - 3f		/* descsz */	;	\
    1.46 +  .long type				;	\
    1.47 +1:.asciz "name"				;	\
    1.48 +2:.align 4				;	\
    1.49 +3:desctype descdata			;	\
    1.50 +4:.align 4				;	\
    1.51 +.popsection
    1.52 +#endif /* __STDC__ */
    1.53  #else	/* !__ASSEMBLER__ */
    1.54  #include <linux/elf.h>
    1.55  /*