[Fortran, patch, pr64589, v1] [OOP] Linking error due to undefined integer symbol with unlimited polymorphism
Andre Vehreschild
vehre@gmx.de
Fri Jul 10 14:52:00 GMT 2015
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?
Regards,
Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64589_1.clog
Type: application/octet-stream
Size: 321 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150710/d69396c4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64589_1.patch
Type: text/x-patch
Size: 1403 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150710/d69396c4/attachment.bin>
More information about the Fortran
mailing list