summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-09-11 10:47:23 +0000
committerEric Andersen <andersen@codepoet.org>2003-09-11 10:47:23 +0000
commitfd82b0a352e37f552fdbd678cc76c4d1e5018714 (patch)
tree4935833480d63f770f0822a5581c62d82e363ddb
parent752e5e2a3be8f8fb7ac1d4327cbcd1129f89008c (diff)
Simplify an expression. Use static const on strings to avoid
a gcc 2.95 compiler problem on powerpc.
-rw-r--r--ldso/ldso/dl-elf.c11
-rw-r--r--ldso/ldso/readelflib1.c11
2 files changed, 10 insertions, 12 deletions
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;
}
diff --git a/ldso/ldso/readelflib1.c b/ldso/ldso/readelflib1.c
index 032c59607..2dad09d6d 100644
--- a/ldso/ldso/readelflib1.c
+++ b/ldso/ldso/readelflib1.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;
}