Libgpg-error may end up being dynamically loaded, either directly
or perhaps more commonly indirectly, via use of e.g. dlopen().
Some programs will subsequently do dlclose() before calling exit().
In this context, use of atexit() to register an in-library function
for invocation at exit() time is problematical, and will in all
probability cause a segmentation fault. It does in my case, running
this on NetBSD/amd64 6.1.5.
I was told that use of attribute((destructor,used)) is probably
a better way of dealing with this, as it will cause the marked function
to be called both on dlclose() and it remains present at exit().
The attached patch has been added to NetBSD's pkgsrc to effect this change.