fake __gnu_local_gp
This commit is contained in:
parent
e8b458be45
commit
6315da8831
3 changed files with 10 additions and 3 deletions
|
@ -17,7 +17,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
|
||||||
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
|
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
|
||||||
symbol.h term.h time.h types.h loader.h partition.h \
|
symbol.h term.h time.h types.h loader.h partition.h \
|
||||||
msdos_partition.h machine/kernel.h handler.h list.h \
|
msdos_partition.h machine/kernel.h handler.h list.h \
|
||||||
command.h machine/memory.h cpu/libgcc.h cpu/cache.h
|
command.h machine/memory.h cpu/libgcc.h cpu/cache.h cpu/dl.h
|
||||||
|
|
||||||
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
|
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
|
||||||
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
||||||
|
|
|
@ -29,7 +29,7 @@ FNR == 1 {
|
||||||
if ($1 in symtab) {
|
if ($1 in symtab) {
|
||||||
modtab[module] = modtab[module] " " symtab[$1];
|
modtab[module] = modtab[module] " " symtab[$1];
|
||||||
}
|
}
|
||||||
else if ($1 != "__gnu_local_gp"){
|
else {
|
||||||
printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
|
printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
|
||||||
error++;
|
error++;
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <grub/elf.h>
|
#include <grub/elf.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/err.h>
|
#include <grub/err.h>
|
||||||
|
#include <grub/cpu/types.h>
|
||||||
|
|
||||||
/* Check if EHDR is a valid ELF header. */
|
/* Check if EHDR is a valid ELF header. */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
|
@ -29,9 +30,15 @@ grub_arch_dl_check_header (void *ehdr)
|
||||||
Elf_Ehdr *e = ehdr;
|
Elf_Ehdr *e = ehdr;
|
||||||
|
|
||||||
/* Check the magic numbers. */
|
/* Check the magic numbers. */
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
if (e->e_ident[EI_CLASS] != ELFCLASS32
|
||||||
|
|| e->e_ident[EI_DATA] != ELFDATA2MSB
|
||||||
|
|| e->e_machine != EM_MIPS)
|
||||||
|
#else
|
||||||
if (e->e_ident[EI_CLASS] != ELFCLASS32
|
if (e->e_ident[EI_CLASS] != ELFCLASS32
|
||||||
|| e->e_ident[EI_DATA] != ELFDATA2LSB
|
|| e->e_ident[EI_DATA] != ELFDATA2LSB
|
||||||
|| e->e_machine != EM_386)
|
|| e->e_machine != EM_MIPS)
|
||||||
|
#endif
|
||||||
return grub_error (GRUB_ERR_BAD_OS, "invalid arch specific ELF magic");
|
return grub_error (GRUB_ERR_BAD_OS, "invalid arch specific ELF magic");
|
||||||
|
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
Loading…
Reference in a new issue