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 Sun, Dec 12, 2010 at 08:18:17AM +0000, Nick Hudson wrote:
> On Saturday 11 December 2010 21:50:06 Joerg Sonnenberger wrote:
> > 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).
> 
> What relocs are there against __bss_start, _edata, and _end?

Those are just unrelated bugs in the linker script. They shouldn't be
DEFAULT in case, it just doesn't make sense. E.g. it might make sense to
refer to the BSS and data segment of the main program, but that only
works now if it is also defining __bss_start etc, since the symbols are
present in every shared object. I'm not sure if they are even used
nowadays (and could be dropped fully)...

> There was a time when NetBSD was about doing it right for all supported 
> platforms even if it took that little bit more effort.  You don't seem to 
> share this goal. 

That comment doesn't even make sense. But thanks for the valuable ad
honimem input.

Joerg


Home | Main Index | Thread Index | Old Index