tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Reducing ld.elf_so relocations and size

On Sat, Dec 11, 2010 at 07:52:21AM +0000, Nick Hudson wrote:
> > (2) It (almost) allows to drop the special visibility hacks in
> > ld.elf_so. Look at the output of 'readelf -s ld.elf_so' and the long
> > list of GLOBAL symbols with DEFAULT visiblity. After the patch, only 3
> > symbols are still visible that shouldn't be (__bss_start, _edata, _end)
> > and they come from the ld script used. It should be fixed to make them
> > hidden or protected, but that's a separate discussion.
> Wouldn't a simple version script be better here? 
>      { global: foo; bar; local: *; };
> Doesn't this allow _rtld_is_exported to die?

This helps the visibility, but doesn't help with goal (1).

> > I know that the global define trick is not the most beautiful approach,
> > but I haven't found an idea that involves less code changes and still
> > gives the benefits of (1). More importantly, I would strongly prefer to
> > only have to source code as optimisation, not to make it work. I also
> > don't want to duplicate the logic from libc to decide where a specific
> > source file lives and if the C version or the MD assembler should be
> > used. Ideas are welcome.
> To replay my previous comments and add some more
>       - Abusing libc/Makefile is awful

libc's build system is not the most friendly for actually reusing stuff.
It is finding sources in one of four locations, some of them at least
hard coded using .CURDIR. That's not very helpful for interacting with
it and I don't want to change half of the libc build system.

>       - Extracting make logic into a separate .mk is desirable.

Doesn't help much due to the former.

>       - AFAICT, most of what you want to achieve can be done with
>         {C,CPP,AS}FLAGS - no need for .hpico.

Feel free to provide a patch that actually works.

>       - Having libc_hidden (or some other name) under libexec/ld.elf_so seems
>         sensible

I don't think it makes any real difference.

>       - the asm stuff is ugly

See above for why it is helpful.

I am waiting for a patch that works, gives the same benefits and is


Home | Main Index | Thread Index | Old Index