aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/elfnote.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 16f9f8ebffd9..67396db141e8 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -31,22 +31,24 @@
31/* 31/*
32 * Generate a structure with the same shape as Elf{32,64}_Nhdr (which 32 * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
33 * turn out to be the same size and shape), followed by the name and 33 * turn out to be the same size and shape), followed by the name and
34 * desc data with appropriate padding. The 'desc' argument includes 34 * desc data with appropriate padding. The 'desctype' argument is the
35 * the assembler pseudo op defining the type of the data: .asciz 35 * assembler pseudo op defining the type of the data e.g. .asciz while
36 * "hello, world" 36 * 'descdata' is the data itself e.g. "hello, world".
37 *
38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
37 */ 40 */
38.macro ELFNOTE name type desc:vararg 41#define ELFNOTE(name, type, desctype, descdata) \
39.pushsection ".note.\name" 42.pushsection .note.name ; \
40 .align 4 43 .align 4 ; \
41 .long 2f - 1f /* namesz */ 44 .long 2f - 1f /* namesz */ ; \
42 .long 4f - 3f /* descsz */ 45 .long 4f - 3f /* descsz */ ; \
43 .long \type 46 .long type ; \
441:.asciz "\name" 471:.asciz "name" ; \
452:.align 4 482:.align 4 ; \
463:\desc 493:desctype descdata ; \
474:.align 4 504:.align 4 ; \
48.popsection 51.popsection ;
49.endm
50#else /* !__ASSEMBLER__ */ 52#else /* !__ASSEMBLER__ */
51#include <linux/elf.h> 53#include <linux/elf.h>
52/* 54/*