~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to include/grub/dl.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-05-17 23:59:10 UTC
  • mto: (17.3.55 sid)
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: james.westby@ubuntu.com-20110517235910-ma8u889vyjdfro27
Tags: upstream-1.99
ImportĀ upstreamĀ versionĀ 1.99

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define GRUB_DL_H       1
22
22
 
23
23
#include <grub/symbol.h>
 
24
#ifndef ASM_FILE
24
25
#include <grub/err.h>
25
26
#include <grub/types.h>
26
27
#include <grub/elf.h>
 
28
#endif
27
29
 
28
30
/*
29
31
 * Macros GRUB_MOD_INIT and GRUB_MOD_FINI are also used by build rules
30
32
 * to collect module names, so we define them only when they are not
31
33
 * defined already.
32
34
 */
 
35
#ifndef ASM_FILE
33
36
 
34
37
#ifndef GRUB_MOD_INIT
35
38
#define GRUB_MOD_INIT(name)     \
63
66
 
64
67
#define GRUB_MOD_DEP(name)      \
65
68
__asm__ (".section .moddeps\n.asciz \"" #name "\"\n")
66
 
#endif
 
69
 
 
70
#endif
 
71
 
 
72
#endif
 
73
 
 
74
#ifndef ASM_FILE
 
75
#ifdef APPLE_CC
 
76
#define GRUB_MOD_SECTION(x) "_" #x ", _" #x ""
 
77
#else
 
78
#define GRUB_MOD_SECTION(x) "." #x
 
79
#endif
 
80
#else
 
81
#ifdef APPLE_CC
 
82
#define GRUB_MOD_SECTION(x) _ ## x , _ ##x 
 
83
#else
 
84
#define GRUB_MOD_SECTION(x) . ## x
 
85
#endif
 
86
#endif
 
87
 
 
88
/* Me, Vladimir Serbinenko, hereby I add this module check as per new
 
89
   GNU module policy. Note that this license check is informative only.
 
90
   Modules have to be licensed under GPLv3 or GPLv3+ (optionally
 
91
   multi-licensed under other licences as well) independently of the
 
92
   presence of this check and solely by linking (module loading in GRUB
 
93
   constitutes linking) and GRUB core being licensed under GPLv3+.
 
94
   Be sure to understand your license obligations.
 
95
*/
 
96
#ifndef ASM_FILE
 
97
#define GRUB_MOD_LICENSE(license)       \
 
98
  static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION (module_license)), used)) = "LICENSE=" license;
 
99
#else
 
100
#define GRUB_MOD_LICENSE(license)       \
 
101
  .section GRUB_MOD_SECTION(module_license), "a";       \
 
102
  .ascii "LICENSE="; \
 
103
  .ascii license; \
 
104
  .byte 0
 
105
#endif
 
106
 
 
107
/* Under GPL license obligations you have to distribute your module
 
108
   under GPLv3(+). However, you can also distribute the same code under
 
109
   another license as long as GPLv3(+) version is provided.
 
110
*/
 
111
#define GRUB_MOD_DUAL_LICENSE(x)
 
112
 
 
113
#ifndef ASM_FILE
67
114
 
68
115
struct grub_dl_segment
69
116
{
119
166
void grub_arch_dl_init_linker (void);
120
167
#endif
121
168
 
 
169
#endif
 
170
 
122
171
#endif /* ! GRUB_DL_H */