com32: Put deleted object files back into the Makefile
authorMatt Fleming <matt.fleming@linux.intel.com>
Wed, 13 Apr 2011 11:54:49 +0000 (12:54 +0100)
committerMatt Fleming <matt.fleming@linux.intel.com>
Tue, 26 Apr 2011 08:53:36 +0000 (09:53 +0100)
commit96b913d090ec6e21f151cd3832fbb3b27454c7a1
treeb15d163cf56491ecf19cb544c499a0efa3eab303
parent43d7cbaa55806ecb33b0cc5aa56e97b0f8027c45
com32: Put deleted object files back into the Makefile

For some reason that I can't understand, some object files were
removed from this Makefile in the following commit,

    |commit 0cb6490fa96f752c01bbb9add2c9ca6dbf99ece2
    |Author: Feng Tang <feng.tang@intel.com>
    |Date:   Thu Jun 3 10:48:22 2010 +0800
    |
    |   elflink: start merge with pathbased branch
    |
    |   modify these files to make compile pass
    |
    |       modified:   com32/MCONFIG
    |       modified:   com32/Makefile
    |       modified:   com32/include/klibc/compiler.h
    |       modified:   com32/include/sys/elfcommon.h
    |       modified:   com32/lib/Makefile
    |       modified:   com32/lib/free.c
    |       modified:   com32/lib/malloc.c

However, with this patch things continue to compile correctly so I'm
unsure why they were ever removed. Furthermore, pieces of code in
com32/ refer to symbols defined in these these object files and so
they are required in order to load modules.

These missing object files were discovered when loading libcom32.c32,
which wouldn't load because it was complaining about unresolved
symbols.

The removal of core/strncasecmp.c needs some explanation. There are
currently two identical copies of strncasecmp.c, one in com32/lib and
one in core/, and while the core copy is part of core/libcom32.a, the
copy in com32/lib isn't compiled. Now, because there are no references
to strncasecmp within core/ the symbol isn't pulled in from libcom32.a
and exported as a global symbol by the core. So, if ELF modules have
references to strncasecmp they cannot be resolved at runtime.

To fix this I've included strncasecmp.o in libcom32min.a which
isolinux.elf, ldlinux.elf and pxelinux.elf link against with
--whole-archive, which means that even if there are no references to
strncasecmp within the core, that symbol is still exported.

Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
com32/lib/Makefile
core/strncasecmp.c [deleted file]