X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fldpreload.h;h=c3942a5b4e10d4f2fcfca16bb7c3edb2cde3d044;hb=f54cd101d750cb31f54081a41d6cb880a9199dba;hp=6ef291185981a44c90a484df71efe635460e7b03;hpb=3773b830ba1eae6e912e06290f291b0052e85ad8;p=coloredstderr%2Fcoloredstderr.git diff --git a/src/ldpreload.h b/src/ldpreload.h index 6ef2911..c3942a5 100644 --- a/src/ldpreload.h +++ b/src/ldpreload.h @@ -2,7 +2,7 @@ * Helper header for LD_PRELOAD related headers macros. Must be loaded _first_ * (for RTLD_NEXT)! * - * Copyright (C) 2012-2013 Simon Ruderich + * Copyright (C) 2012-2014 Simon Ruderich * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include #include +static void *dlsym_function(char const *name) noinline; /* Load the function name using dlsym() and return it. Terminate program on * failure. Split in function and macro to reduce code inserted into the * function using the macro. */ @@ -52,7 +53,7 @@ static void *dlsym_function(char const *name) { } #define DLSYM_FUNCTION(pointer, name) \ - if (!(pointer)) { \ + if (unlikely(!(pointer))) { \ *(void **) (&(pointer)) = dlsym_function(name); \ }