ElfW(Verdef) *def;
/* Display information about what we are doing while debugging. */
- if (_dl_debug_versions)
+ if (__builtin_expect (_dl_debug_versions, 0))
_dl_debug_message (1, "checking for version `", string, "' in file ",
map->l_name[0] ? map->l_name : _dl_argv[0],
" required by file ", name, "\n", NULL);
- if (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL)
+ if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
{
/* The file has no symbol versioning. I.e., the dependent
object was linked against another version of this file. We
{
/* Currently the version number of the definition entry is 1.
Make sure all we see is this version. */
- if (def->vd_version != 1)
+ if (__builtin_expect (def->vd_version, 1) != 1)
{
char buf[20];
buf[sizeof (buf) - 1] = '\0';
ElfW(Verdaux) *aux = (ElfW(Verdaux) *) ((char *) def + def->vd_aux);
/* To be safe, compare the string as well. */
- if (strcmp (string, strtab + aux->vda_name) == 0)
+ if (__builtin_expect (strcmp (string, strtab + aux->vda_name), 0)
+ == 0)
/* Bingo! */
return 0;
}
}
/* Symbol not found. If it was a weak reference it is not fatal. */
- if (weak)
+ if (__builtin_expect (weak, 1))
{
if (verbose)
_dl_signal_cerror (0, map->l_name,
/* Currently the version number of the needed entry is 1.
Make sure all we see is this version. */
- if (ent->vn_version != 1)
+ if (__builtin_expect (ent->vn_version, 1) != 1)
{
char buf[20];
buf[sizeof (buf) - 1] = '\0';
/* Make sure this is no stub we created because of a missing
dependency. */
- if (! trace_mode || needed->l_opencount != 0)
+ if (__builtin_expect (! trace_mode, 1)
+ || __builtin_expect (needed->l_opencount, 1) != 0)
{
/* NEEDED is the map for the file we need. Now look for the
dependency symbols. */
section. */
map->l_versions = (struct r_found_version *)
calloc (ndx_high + 1, sizeof (*map->l_versions));
- if (map->l_versions == NULL)
+ if (__builtin_expect (map->l_versions == NULL, 0))
{
_dl_signal_error (ENOMEM, (*map->l_name ? map->l_name : _dl_argv[0]),
"cannot allocate version reference table");