[syslinux] linking external library into module

H. Peter Anvin hpa at zytor.com
Wed Sep 28 21:08:44 PDT 2016


On 09/22/16 07:26, Jeff Williams via Syslinux wrote:
]\>
> 1) It appears that external libraries will not link correctly into a
> com32 module if they weren't built with the same flags as are used in
> the syslinux com32 module build. There is no error output during the
> link, you just end up with seemingly random run-time issues. This may
> partially depend upon #2, below.
> 

This is very true.  The Syslinux ABI is not compatible with any other ABI.

> 2) The final link command line order is surprisingly fussy. "$(LD)
> $(LDFLAGS) -o $@ $^ $(C_LIBS)" builds a com32 module that runs pretty
> reliably. "$(LD) -o $@ $^ $(LDFLAGS) $(C_LIBS)" builds a com32 module
> that may or may not run depending upon how much and in what order your
> .c source code may be. Order of flags on the tool's command line
> matters? Looks like it. Weird.

When it comes to archives (.a), the order on the command line does
indeed matter; they are normally required to be such that dependencies
are resolved to the right.  The GNU ld specific options --start-group
and --end-group can be used to change that behavior.


	-hpa



More information about the Syslinux mailing list