Re: huge gcc 4.1.{0,1} __weak problem

Venki Pallipadi
2008-05-01T23:30:52Z

On Thu, May 01, 2008 at 04:21:16PM -0700, Tom Rini wrote:
> On Thu, May 01, 2008 at 03:42:38PM -0700, Andrew Morton wrote:
>
> [snip]
> > Is there some vaguely maintainable workaround we can do? If the problem
> > only affects completely-empty weak functions then we could put something in
> > them to make them non-empty?
>
> My memory is a tiny bit hazy (it was a while ago), but no, it's not just
> empty functions (again, I _think_ I hit it with a generic vs arch weak
> function).
>

Other thing we observed was: this does not just depend on the __weak
function definition. It also depends on where the function is called from.

__weak function with single return statement, did not get inlined when called
from say

caller()
{
function();
}

but got inlined when called as in

caller()
{
for (;;) {
function();
}
}

Thanks,
Venki