This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: .gnu.linkonce.* and shared libraries
>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
> On Wed, Jul 11, 2001 at 02:11:06PM -0700, Ian Lance Taylor wrote:
>> Jakub Jelinek <jakub@redhat.com> writes:
>>
>> > I perhaps have not written it clearly.
>> > All of 1)-4) would be done in the static linker, not dynamic linker.
>>
>> Sorry, I misunderstood.
>>
>> The only relevant issue then is that your scheme is robust in the face
>> of running against a dynamic library which is not the specific one
>> which was linked against.
> That's why the compiler/programmer has to ask for it explicitely.
> As far as I understand C++, having e.g. different vtables in a program would
> make it non-conforming.
Considering the entire program, perhaps. The problem comes when the stuff
in .gnu.linkonce.foo is not part of the intended API of the library, but a
side effect of the implementation. If the implementation changes (say, to
use list<T> instead of vector<T>), the instantiations present in the
library change, so if the linker had decided the executable could just use
the vector<int> code in the library things break.
Jason