[syslinux] Linker script assertion with binutils 2.21
H. Peter Anvin
hpa at zytor.com
Mon Jan 17 11:41:01 PST 2011
On 01/17/2011 06:53 AM, Colin Watson wrote:
> dos/syslinux.elf fails to build on current Ubuntu Natty (binutils 2.21)
> as follows:
>
> ld -m elf_i386 -T dosexe.ld -o syslinux.elf header.o crt0.o ldlinux.o syslinux.o fat.o syslxmod.o syslxopt.o setadv.o getopt_long.o bootsect_bin.o mbr_bin.o cache.o fatchain.o open.o searchdir.o libcom.a
> /usr/bin/ld.bfd.real: syslinux_ldlinux_size must equal the size of .payload
> /usr/bin/ld.bfd.real: syslinux_ldlinux_size must equal the size of .payload
>
> 'objdump -t ldlinux.o' looks reasonable:
>
> SYMBOL TABLE:
> 00000000 l d .text 00000000 .text
> 00000000 l d .data 00000000 .data
> 00000000 l d .bss 00000000 .bss
> 00000000 l d .payload 00000000 .payload
> 00000000 l d .rodata 00000000 .rodata
> 00000000 g .payload 00007c00 syslinux_ldlinux
> 00007c00 g *ABS* 00000000 syslinux_ldlinux_size
> 00000000 g .rodata 00000004 syslinux_ldlinux_len
>
> Our toolchain packager pointed me at
> http://sources.redhat.com/git/?p=binutils.git;a=commitdiff;h=557189b0dd1f3dec6b00b91b9b0c5459ece72a52,
> which indeed seems like a likely cause of this kind of failure.
> However, I'm having a hard time pinning down what the problem might be.
> Does anyone more familiar with linker scripts than me know?
>
The assertion in the linker script compares the symbols
syslinux_ldlinux_size (from the assembler) with __payload_len (from the
linker). Comment out the assert and check the value of __payload_len in
syslinux.elf; if it is something other than 0x7c00 we need to find out
where it gets the value (by backtracking the component values.)
-hpa
More information about the Syslinux
mailing list