+bryner for good old times sake, and because he knows about this stuff ;-)
-Darin



On Tue, Jul 28, 2009 at 8:18 PM, Mark Mentovai <[email protected]> wrote:

>
> Evan Martin wrote:
> > When we load a plugin any symbols we export come before its symbols.
>
> This doesn't happen on the Mac unless you go out of your way to
> arrange for it to happen.
>
> Even so, we do use -fvisiblility=hidden for all Mac builds, because I
> like for these things to be well-trimmed anyway.
>
> > The -fvisibility=hidden flag is maybe supposed to do this (see
> > discussion on http://gcc.gnu.org/wiki/Visibility ), but I tried
> > building both with and without it and found that:
> >  - in debug builds, objdump -T shows all of our symbols, regardless of
> > the flags I pass to gcc or strip
> >  - in release builds, objdump -T doesn't show us exporting symbols,
> > regardless of the flags I pass to gcc
> >
> > The resulting release binaries are within 1kb of each other.
> >
> > I don't really know what I'm doing, so my guess is that some other
> > compilation flags we're using already produce the intended effect.
> > Clearly this flag does *something* as the resulting binaries have
> > slightly different sizes, but maybe it's not intended to apply to
> > binaries or maybe it doesn't in my gcc (4.2.4).
>
> In order for any of this to apply to executables (as opposed to static
> libraries), you need to be linking with ld -E.  Otherwise, global
> symbols that wind up in the executable don't get exported via the
> dynamic symbol table.  I don't know how you guys are linking, but this
> can be significant here.
>
> This -E business applies to Linux/ELF.  On the Mac, things work a
> little differently: there's only one symbol table, symbols wind up in
> it pretty much identically whether you're linking an executable or a
> library, and as I mentioned above, the runtime loader does a better
> job of resolving undefined symbols to the same libraries that provided
> them at link time.
>
> Mark
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to