This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran, patch, pr64589, v1] [OOP] Linking error due to undefined integer symbol with unlimited polymorphism


Le 10/07/2015 16:51, Andre Vehreschild a écrit :
> Hi everyone,
> 
> attached is a rather trivial patch to fix a linker issue when unlimited
> polymorphism is used and the vtabs of intrinsic types are referenced from two
> different locations (e.g. module and main program). Gfortran finds the vtab
> defined in the scope of a module's subroutine and tries to link it to a
> reference in a subroutine of the main program. Then name mangling takes
> place (the module's name is prefixed to the vtab's identifier) and the linker
> later on can not link the reference in the subroutine of the main program to the
> module's entity. By putting the vtabs of all intrinsic types into the top-level
> scope this is easily fixed. The linker now is able to find the name (although
> it is mangled) and linking is fine. 
> 
> I rather don't understand why the decision to put intrinsic type's vtabs into
> the local scope was choosen. There are not so many intrinsic types that they
> can effectively clutter the top-level scope. Instead putting the intrinsic
> types into local scope bloats the executable, because the same entity is
> created over and over again. So this time removing two lines of code did the
> trick. 
> 
> Bootstraps and regtests fine on x86_64-linux-gnu/f21.
> 
> Ok for trunk?
> 
OK. Thanks.

Mikael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]