From: Ivan Maidanski Date: Wed, 17 Oct 2012 17:44:24 +0000 (+0400) Subject: Add comment for _DYNAMIC[] compared to NULL in GC_FirstDLOpenedLinkMap X-Git-Tag: gc7_4_0~199 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=630803c5ee009137cae22ee89a253c503414ec65;p=gc Add comment for _DYNAMIC[] compared to NULL in GC_FirstDLOpenedLinkMap * dyn_load.c (GC_FirstDLOpenedLinkMap): Add comment for _DYNAMIC-is-NULL code branch; cast _DYNAMIC (array symbol) to ptr_t in comparison to NULL (0). --- diff --git a/dyn_load.c b/dyn_load.c index c44669d9..708667f8 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -151,7 +151,8 @@ GC_FirstDLOpenedLinkMap(void) dynStructureAddr = &_DYNAMIC; # endif - if( dynStructureAddr == 0) { + if (dynStructureAddr == 0) { + /* _DYNAMIC symbol not resolved. */ return(0); } if( cachedResult == 0 ) { @@ -640,7 +641,8 @@ GC_FirstDLOpenedLinkMap(void) ElfW(Dyn) *dp; static struct link_map *cachedResult = 0; - if( _DYNAMIC == 0) { + if (0 == (ptr_t)_DYNAMIC) { + /* _DYNAMIC symbol not resolved. */ return(0); } if( cachedResult == 0 ) {