Hello from main
Hello from func1
Hello from func2
Back to func1
Back to main
Hello from myfunc2
Back to main
Note that the same code but with the static func.lib produces
Hello from main
Hello from func1
Hello from myfunc2
Back to func1
Back to main
Hello from myfunc2
Back to main
Which demonstrates how undefined behaviour can produce different results even in one and the same implementation.
This also illustrates the invalidity of the claim that "the difference between [shared and static libraries] is not important for this disussion [sic]", and why "pre-linked" is an important aspect of shared libraries.
Cheers,
V.