Re: weak-attribute over-optimisation with 4.1

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

 



[ Please keep me on the CC list, thanks! ]

On Sun, May 21, 2006 at 10:53:52AM +0200, Florian Weimer wrote:
> * Jan Kiszka:
> 
> > So, is this a regression? Does it also happen with vanilla 4.1?
> 
> According to the documentation, the weak attribute affects
> declarations, not definitions, and is an instruction to the linker.
> Technically, the GCC 4.1 behavior is correct.  I'm not sure if it's
> desirably, though.

I've got a few questions then, does this mean that for gcc-4.1 the
correct answer is:
1) foo.h includes weak declarations
2) foo.c does not provide any copy of the function, only calls.
3) bar.c may or may not provide the function call
4) foo.o and bar.o get linked together and we would get the desired
results (functions called if provided, otherwise we link fine and the
call goes away) ?

If so, is there a recommended way to write all of that so that gcc-3.2
will work as well (since this is code for the Linux Kernel)

Thanks!

-- 
Tom Rini

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux