[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings in kern/dl.c
From: |
Bean |
Subject: |
Re: Warnings in kern/dl.c |
Date: |
Fri, 18 Jul 2008 17:36:34 +0800 |
Hi,
I have another thought about this issue, it's actually caused by
different working environment for the same file. For kern/dl.c, there
are three modes:
1. Target mode
When it's used in boot environment, it's in target mode, for example, i386.
2. Host mode
When it's used in tools like grub-emu, it's in host mode, for example, x86_64.
3. Cross mode
When it's used in grub-mkimage, it's in cross mode. It runs in x86_64,
but produce image that will be used in i386.
For these three modes, we have only one controlling macro, GRUB_UTIL,
so it can't cover all cases. To solve this, we can either:
a. Add new macro, for example GRUB_CROSS or GRUB_MKIMAGE.
or
b. Drop one of the usage.
But actually, host mode is not useful, we can't load external modules
in grub-emu, so support 1 and 3 is enough.
BTW, kern/dl.c has issue as well. For example, grub_dl_resolve_symbol
returns void*. It should be Elf_Addr, so that it can expand to the
correct type according to GRUB_TARGET_SIZEOF_VOID_P.
--
Bean