[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Kernel fixes for Cygwin

From: Bean
Subject: Re: [PATCH] Kernel fixes for Cygwin
Date: Mon, 21 Jul 2008 15:25:20 +0800

On Mon, Jul 21, 2008 at 3:02 PM, Bean <address@hidden> wrote:
> On Mon, Jul 21, 2008 at 4:51 AM, Christian Franke
> <address@hidden> wrote:
>> This adds Cygwin support to kernel sources. It handles the issues introduced
>> by PE->ELF conversion and adds support for HAVE_ASM_USCORE.
>> Christian
>> 2007-07-20      Christian Franke  <address@hidden>
>>        * include/grub/dl.h: Remove .previous, gas supports this only
>>        for ELF format.
>>        * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE):
>>        Remove .type, gas supports this only for ELF format.
>>        * kern/dl.c (grub_dl_resolve_symbols): Add check for grub_mod_init
>>        and grub_mod_fini for symbols without a type. Handle HAVE_ASM_USCORE
>>        case for these symbols.
>>        (grub_dl_resolve_dependencies): Add check for trailing nullbytes
>>        in symbol table. This fixes an infinite loop if table is zero filled.
>>        * kern/i386/dl.c [__CYGWIN__] (fix_pc_rel_relocation): New function
>>        to fix bad PC relative relocation produced by objcopy.
>>        [__CYGWIN__] (grub_arch_dl_relocate_symbols): Add fix of PC relative
>> relocation.
>>        (grub_arch_dl_relocate_symbols): Abort on unknown relocation type.
> Hi,
> I'm not fond of fixing elf relocation bug in dl.c. First of all, this
> is an objcopy bug, it may be changed in the future, also, it makes
> modules compiled by cygwin not compatible with those compiled by elf
> gcc.
> Perhaps you can write a small tool, which fix various bugs after using
> objcopy to generate the module file.


BTW, if you have time, you can consider writing a tool that convert pe
to elf directly, thus avoiding objcopy altogether. This shouldn't be
too difficult, you can take a look at util/i386/efi/grub-mkimage.c,
which does exactly the opposite, converting elf to pe32.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]