diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:45:42 +0100 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 15:07:12 +0100 |
commit | a1ffb40e32741f992c743e7b16c061fefa3747ac (patch) | |
tree | 246a29a87b26cfd5d07b17070f85eb3785018de9 /elf/dl-open.c | |
parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.bz2 |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r-- | elf/dl-open.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c index a9ca6b3..7cc4cc1 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -147,7 +147,7 @@ add_to_global (struct link_map *new) ns->_ns_main_searchlist->r_list[new_nlist++] = map; /* We modify the global scope. Report this. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) _dl_debug_printf ("\nadd %s [%lu] to global scope\n", map->l_name, map->l_ns); } @@ -232,7 +232,7 @@ dl_open_worker (void *a) return; } - if (__builtin_expect (mode & __RTLD_SPROF, 0)) + if (__glibc_unlikely (mode & __RTLD_SPROF)) /* This happens only if we load a DSO for 'sprof'. */ return; @@ -240,10 +240,10 @@ dl_open_worker (void *a) ++new->l_direct_opencount; /* It was already open. */ - if (__builtin_expect (new->l_searchlist.r_list != NULL, 0)) + if (__glibc_unlikely (new->l_searchlist.r_list != NULL)) { /* Let the user know about the opencount. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n", new->l_name, new->l_ns, new->l_direct_opencount); @@ -269,7 +269,7 @@ dl_open_worker (void *a) #ifdef SHARED /* Auditing checkpoint: we have added all objects. */ - if (__builtin_expect (GLRO(dl_naudit) > 0, 0)) + if (__glibc_unlikely (GLRO(dl_naudit) > 0)) { struct link_map *head = GL(dl_ns)[new->l_ns]._ns_loaded; /* Do not call the functions for any auditing object. */ @@ -294,7 +294,7 @@ dl_open_worker (void *a) LIBC_PROBE (map_complete, 3, args->nsid, r, new); /* Print scope information. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) _dl_show_scope (new, 0); /* Only do lazy relocation if `LD_BIND_NOW' is not set. */ @@ -344,7 +344,7 @@ dl_open_worker (void *a) if (runp != NULL) /* Look through the dependencies of the object. */ while (*runp != NULL) - if (__builtin_expect (*runp++ == thisp, 0)) + if (__glibc_unlikely (*runp++ == thisp)) { /* Move the current object to the back past the last object with it as the dependency. */ @@ -391,7 +391,7 @@ dl_open_worker (void *a) } #ifdef SHARED - if (__builtin_expect (GLRO(dl_profile) != NULL, 0)) + if (__glibc_unlikely (GLRO(dl_profile) != NULL)) { /* If this here is the shared object which we want to profile make sure the profile is started. We can find out whether @@ -444,7 +444,7 @@ dl_open_worker (void *a) /* Avoid duplicates. */ continue; - if (__builtin_expect (cnt + 1 >= imap->l_scope_max, 0)) + if (__glibc_unlikely (cnt + 1 >= imap->l_scope_max)) { /* The 'r_scope' array is too small. Allocate a new one dynamically. */ @@ -511,7 +511,7 @@ dl_open_worker (void *a) } /* Print scope information. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) _dl_show_scope (imap, from_scope); } @@ -574,7 +574,7 @@ cannot load any more object with static TLS")); /* Mark the object as not deletable if the RTLD_NODELETE flags was passed. */ - if (__builtin_expect (mode & RTLD_NODELETE, 0)) + if (__glibc_unlikely (mode & RTLD_NODELETE)) new->l_flags_1 |= DF_1_NODELETE; #ifndef SHARED @@ -584,7 +584,7 @@ cannot load any more object with static TLS")); #endif /* Let the user know about the opencount. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n", new->l_name, new->l_ns, new->l_direct_opencount); } @@ -601,14 +601,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid, /* Make sure we are alone. */ __rtld_lock_lock_recursive (GL(dl_load_lock)); - if (__builtin_expect (nsid == LM_ID_NEWLM, 0)) + if (__glibc_unlikely (nsid == LM_ID_NEWLM)) { /* Find a new namespace. */ for (nsid = 1; DL_NNS > 1 && nsid < GL(dl_nns); ++nsid) if (GL(dl_ns)[nsid]._ns_loaded == NULL) break; - if (__builtin_expect (nsid == DL_NNS, 0)) + if (__glibc_unlikely (nsid == DL_NNS)) { /* No more namespace available. */ __rtld_lock_unlock_recursive (GL(dl_load_lock)); @@ -656,7 +656,7 @@ no more namespaces available for dlmopen()")); #endif /* See if an error occurred during loading. */ - if (__builtin_expect (errstring != NULL, 0)) + if (__glibc_unlikely (errstring != NULL)) { /* Remove the object from memory. It may be in an inconsistent state if relocation failed, for example. */ |