[syslinux] [PATCH 0/4] Improve linker scripts

Celelibi
2015-10-08T23:24:29Z

2015-10-08 12:58 UTC+02:00, Gene Cumm <gene.cumm at
gmail.com>:
> On Mon, Oct 5, 2015 at 2:15 PM, celelibi--- via Syslinux
> <syslinux at zytor.com> wrote:
>> From: Sylvain Gault <sylvain.gault at gmail.com>
>>
>> These patches basically remove unused linker scripts and port a change
>> that was
>> made to an unused script.
>>
>> Those are to be applied on top of the gcc 5 bug fixes as they would
>> conflict
>> otherwise.
>>
>> Sylvain Gault (4):
>>   diag/mbr: fix dependency to linker script
>>   Remove unused linker scripts
>>   core: Make symbols defined in linker script HIDDEN
>>   core: Move linker script in arch-agnostic dir
>>
>>  core/Makefile           |   2 +-
>>  core/i386/syslinux.ld   | 389
>> ------------------------------------------------
>>  core/syslinux.ld        | 117 ++++++---------
>>  core/x86_64/syslinux.ld | 389
>> ------------------------------------------------
>>  diag/mbr/Makefile       |   2 +-
>>  efi/syslinux.ld         | 176 ----------------------
>>  mbr/mbr.ld              |  73 ---------
>>  memdisk/memdisk.ld      | 140 -----------------
>>  8 files changed, 48 insertions(+), 1240 deletions(-)
>>  delete mode 100644 core/i386/syslinux.ld
>>  delete mode 100644 core/x86_64/syslinux.ld
>>  delete mode 100644 efi/syslinux.ld
>>  delete mode 100644 mbr/mbr.ld
>>  delete mode 100644 memdisk/memdisk.ld
>
>
> gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
> GNU ld (GNU Binutils for Ubuntu) 2.22
>
>
> ld -m elf_i386  -Bsymbolic -pie -E --hash-style=gnu -T
> /home/gene/s/g/core/syslinux.ld -M -o ldlinux.elf ldlinux.o \
>                 --start-group libcom32.a --whole-archive
> /home/gene/s/g/bios/com32/lib/libcom32core.a libldlinux.a --end-group
> \
>                 > ldlinux.map
> ld:/home/gene/s/g/core/syslinux.ld:29: syntax error
> make[3]: *** [ldlinux.elf] Error 1
>
>
> core/syslinux.ld:29:    HIDDEN(__module_start = .);
>
> This would seem to indicate that the keyword HIDDEN is invalid in my
> version.  A quick "git grep com32.ld" seems to show that com32.ld
is
> unused.
>

I just checked, HIDDEN has been added in binutils 2.23 release in late
2012. Should I just not port the commit
275a269ddec9f4d1b7a65f4f7c3e818401103d31 to the actually used linker
scripts and leave the symbols not hidden?

That's interesting, I don't know what's the purpose of
com32/lib/com32.ld, it's just installed and never used. By looking
into the history, it looks that it has been replaced by
com32/lib/elf32.ld which was then split into arch-specific linker
scripts. I guess it's a leftover.

However, I don't know why it needs to be installed. This linker script
installation has been introduced in 2004 by the commit
2d747a0e3e9d99cce544e4645370fcf7ef3e92ee. Maybe someone knows why it
had to be installed? hpa?


Celelibi