From fd82b0a352e37f552fdbd678cc76c4d1e5018714 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 11 Sep 2003 10:47:23 +0000 Subject: Simplify an expression. Use static const on strings to avoid a gcc 2.95 compiler problem on powerpc. --- ldso/ldso/dl-elf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ldso/ldso/dl-elf.c') diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 032c59607..2dad09d6d 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -223,9 +223,8 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt, const char *pnt, *pnt1; struct elf_resolve *tpnt1; const char *libname; - const char libc6[] = "libc.so.6"; - const char libc5[] = "libc.so.5"; - const char aborted_wrong_lib[] = "%s: aborted attempt to load %s!\n"; + static const char libc[] = "libc.so."; + static const char aborted_wrong_lib[] = "%s: aborted attempt to load %s!\n"; _dl_internal_error_number = 0; libname = full_libname; @@ -251,11 +250,11 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt, /* Make sure they are not trying to load the wrong C library! * This sometimes happens esp with shared libraries when the * library path is somehow wrong! */ - if ((pnt1 = libc6, (_dl_strcmp(libname, pnt1) == 0)) || - (pnt1 = libc5, (_dl_strcmp(libname, pnt1) == 0))) + if ((_dl_strcmp(libname, libc) == 0) && + ( libname[8]=='6' || libname[8]=='5')) { if (!_dl_trace_loaded_objects) { - _dl_dprintf(2, aborted_wrong_lib, pnt1, _dl_progname); + _dl_dprintf(2, aborted_wrong_lib, libname, _dl_progname); } return NULL; } -- cgit v1.2.3