[syslinux] Isohybrid wiki page and UEFI

Bruno Cornec Bruno.Cornec at hpe.com
Wed Oct 28 03:43:09 PDT 2015

Gene Cumm said on Wed, Oct 28, 2015 at 05:58:59AM -0400:
>> Ok, I tried to modify mk/devel.mk to put:
>> And removing the -DDYNAMIC_DEBUG but now syslinux doesn't want to build:
>MALLOC and THREAD are two debugs you probably don't want.

Ok I can drop them, but that doesn't change the fact it doesn't build

>> libcom32.a(bios.o): In function `SEG':
>> /root/syslinux/com32/include/com32.h:144: undefined reference to `__bad_SEG'
>> /root/syslinux/com32/include/com32.h:144: undefined reference to `__bad_SEG'
>> It seems that the kaboom.c file is not compiled with the lib to define
>> the function, but I'm absolutely unclear on what to do to fix this :-(
>kaboom.c is in the core, not ldlinux.*.  I can't say I've ever seen this before.

I'm not sure I get your point here.

kaboom.c is the file defining __bad_SEG.
In fact what fails is this:
ld -m elf_i386  -Bsymbolic -pie -E --hash-style=gnu -T /root/syslinux/core/i386/syslinux.ld -M -o ldlinux.elf ldlinux.o \
        --start-group libcom32.a --whole-archive /root/syslinux/bios/com32/lib/libcom32core.a libldlinux.a
		--end-group \
		> ldlinux.map

So I guess that the code of kaboom.c is not in any of the 3 libs

# nm -g ./bios/core/libcom32.a | grep kaboom | grep T
00000000 T _kaboom

So libcom32.a integrates the object file, but the __bad_SEG function is
not in it:
# nm -g ./bios/core/libcom32.a | grep __bad_SEG
         U __bad_SEG
		 U __bad_SEG
		 U __bad_SEG

It's as if the function wasn't compiled in :-(
If I remove the .o file and relaunch make I get:

gcc -Wp,-MT,kaboom.o,-MD,./.kaboom.o.d -m32 -march=i386 -mpreferred-stack-boundary=2 -mincoming-stack-boundary=2 -ffreestanding -fno-stack-protector -fwrapv -freg-struct-return -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 -msoft-float -fno-exceptions -fno-asynchronous-unwind-tables -fno-strict-aliasing -falign-functions=0 -falign-jumps=0 -falign-labels=0 -falign-loops=0 -fvisibility=hidden -g -W -Wall -Wstrict-prototypes  -Wno-clobbered -DCORE_DEBUG=1  -Wno-sign-compare  -I/root/syslinux/core/include -I/root/syslinux/com32/include -I/root/syslinux/com32/include/sys -I/root/syslinux/com32/lib -I/root/syslinux/core/lwip/src/include -I/root/syslinux/core/lwip/src/include/ipv4 -I/root/syslinux/core/fs/pxe -D__SYSLINUX_CORE__ -D__FIRMWARE_BIOS__ -I/root/syslinux/bios -DLDLINUX=\"ldlinux.c32\" -c -o kaboom.o /root/syslinux/core/kaboom.c

So the CORE_DEBUG option is passed, and in the code I see:

#if defined(CORE_DEBUG) || defined(DEBUG_PORT)

#include <dprintf.h>

__export __noreturn __bad_SEG(const volatile void *p)
    dprintf("SEG() passed an invalid pointer: %p\n", p);


So IIUC it should include that function if CORE_DEBUG is set to 1 no ?

# nm ./bios/core/kaboom.o
         U call16
		 U kaboom
00000000 T _kaboom
         U zero_regs

So I commented the #if and #endif and now it's compiling further. I'm
not sure why it fails but that's a workaround for me now.

Open Source Profession, Linux Community Lead WW  http://opensource.hp.com
HP EMEA EG Open Source Technology Strategist         http://hpintelco.net
FLOSS projects:     http://mondorescue.org     http://project-builder.org 
Musique ancienne? http://www.musique-ancienne.org http://www.medieval.org

More information about the Syslinux mailing list