gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [PATCH] Speedup gij/libjava loading on darwin

Subject: Re: [PATCH] Speedup gij/libjava loading on darwin
From: Andrew Pinski
Date: Fri, 19 Aug 2005 07:19:26 -0400

On Aug 19, 2005, at 5:21 AM, Andrew Haley wrote:
OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Looks good.  Is -single_module Darwinese for -Bsymbolic?

In a way yes.  The way functions call other functions on Darwin is via
a stub which was created by the compiler, -signal_module tells the linker
to get rid of all those stubs for the functions inside that module.
So for an example:
if you have the following TUs:
int g(void);
int f(void) { return f();}
----
int g(void) { return 0; }
---
Normally in the first TU, the compiler creates a stub to call g.
And then in a shared library linked with -single_module, the stub is
removed and a direct call is created so you end up with no way to
over ride the function g at all out side the shared library.
So you end up with less relocations in the shared library for the
loader to deal with.

For executables, it is about the same as shared libraries with
-single_module.


-- Pinski

<Prev in Thread] Current Thread [Next in Thread>