* include/grub/dl.h [ASM_FILE]: Adapt for assembly.

* grub-core/lib/i386/setjmp.S: Add missing GRUB_MOD_LICENSE.
	* grub-core/lib/x86_64/setjmp.S: Likewise.
	* grub-core/lib/mips/setjmp.S: Likewise.
	* grub-core/lib/powerpc/setjmp.S: Likewise.
	* grub-core/lib/sparc64/setjmp.S: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-04-20 01:37:48 +02:00
parent 0624551c22
commit d97e7b5935
7 changed files with 52 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2011-04-20 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/dl.h [ASM_FILE]: Adapt for assembly.
* grub-core/lib/i386/setjmp.S: Add missing GRUB_MOD_LICENSE.
* grub-core/lib/x86_64/setjmp.S: Likewise.
* grub-core/lib/mips/setjmp.S: Likewise.
* grub-core/lib/powerpc/setjmp.S: Likewise.
* grub-core/lib/sparc64/setjmp.S: Likewise.
2011-04-20 Vladimir Serbinenko <phcoder@gmail.com> 2011-04-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/efi/datetime.c: Add missing GRUB_MOD_LICENSE. * grub-core/lib/efi/datetime.c: Add missing GRUB_MOD_LICENSE.

View file

@ -17,9 +17,12 @@
*/ */
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/dl.h>
.file "setjmp.S" .file "setjmp.S"
GRUB_MOD_LICENSE ("GPLv3+")
.text .text
/* /*

View file

@ -17,9 +17,12 @@
*/ */
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/dl.h>
.file "setjmp.S" .file "setjmp.S"
GRUB_MOD_LICENSE ("GPLv3+")
.text .text
/* /*

View file

@ -17,9 +17,12 @@
*/ */
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/dl.h>
.file "setjmp.S" .file "setjmp.S"
GRUB_MOD_LICENSE ("GPLv3+")
.text .text
/* /*

View file

@ -17,9 +17,12 @@
*/ */
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/dl.h>
.file "setjmp.S" .file "setjmp.S"
GRUB_MOD_LICENSE ("GPLv3+")
.text .text
/* /*

View file

@ -17,9 +17,12 @@
*/ */
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/dl.h>
.file "setjmp.S" .file "setjmp.S"
GRUB_MOD_LICENSE ("GPLv3+")
.text .text
/* /*

View file

@ -21,15 +21,18 @@
#define GRUB_DL_H 1 #define GRUB_DL_H 1
#include <grub/symbol.h> #include <grub/symbol.h>
#ifndef ASM_FILE
#include <grub/err.h> #include <grub/err.h>
#include <grub/types.h> #include <grub/types.h>
#include <grub/elf.h> #include <grub/elf.h>
#endif
/* /*
* Macros GRUB_MOD_INIT and GRUB_MOD_FINI are also used by build rules * Macros GRUB_MOD_INIT and GRUB_MOD_FINI are also used by build rules
* to collect module names, so we define them only when they are not * to collect module names, so we define them only when they are not
* defined already. * defined already.
*/ */
#ifndef ASM_FILE
#ifndef GRUB_MOD_INIT #ifndef GRUB_MOD_INIT
#define GRUB_MOD_INIT(name) \ #define GRUB_MOD_INIT(name) \
@ -66,10 +69,20 @@ __asm__ (".section .moddeps\n.asciz \"" #name "\"\n")
#endif #endif
#endif
#ifndef ASM_FILE
#ifdef APPLE_CC #ifdef APPLE_CC
#define GRUB_MOD_SECTION(x) "_" x ", _" x "" #define GRUB_MOD_SECTION(x) "_" #x ", _" #x ""
#else #else
#define GRUB_MOD_SECTION(x) "." x #define GRUB_MOD_SECTION(x) "." #x
#endif
#else
#ifdef APPLE_CC
#define GRUB_MOD_SECTION(x) _ ## x , _ ##x
#else
#define GRUB_MOD_SECTION(x) . ## x
#endif
#endif #endif
/* Me, Vladimir Serbinenko, hereby I add this module check as per new /* Me, Vladimir Serbinenko, hereby I add this module check as per new
@ -80,8 +93,16 @@ __asm__ (".section .moddeps\n.asciz \"" #name "\"\n")
constitutes linking) and GRUB core being licensed under GPLv3+. constitutes linking) and GRUB core being licensed under GPLv3+.
Be sure to understand your license obligations. Be sure to understand your license obligations.
*/ */
#ifndef ASM_FILE
#define GRUB_MOD_LICENSE(license) \ #define GRUB_MOD_LICENSE(license) \
static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION ("module_license")), used)) = "LICENSE=" license; static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION (module_license)), used)) = "LICENSE=" license;
#else
#define GRUB_MOD_LICENSE(license) \
.section GRUB_MOD_SECTION(module_license), "a"; \
.ascii "LICENSE="; \
.ascii license; \
.byte 0
#endif
/* Under GPL license obligations you have to distribute your module /* Under GPL license obligations you have to distribute your module
under GPLv3(+). However, you can also distribute the same code under under GPLv3(+). However, you can also distribute the same code under
@ -89,6 +110,8 @@ __asm__ (".section .moddeps\n.asciz \"" #name "\"\n")
*/ */
#define GRUB_MOD_DUAL_LICENSE(x) #define GRUB_MOD_DUAL_LICENSE(x)
#ifndef ASM_FILE
struct grub_dl_segment struct grub_dl_segment
{ {
struct grub_dl_segment *next; struct grub_dl_segment *next;
@ -143,4 +166,6 @@ grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr);
void grub_arch_dl_init_linker (void); void grub_arch_dl_init_linker (void);
#endif #endif
#endif
#endif /* ! GRUB_DL_H */ #endif /* ! GRUB_DL_H */