diff options
| author | mycroft <mycroft@NetBSD.org> | 2002-10-05 11:59:03 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 2002-10-05 11:59:03 +0000 |
| commit | ad8ccd629051a32d4501b6d19f252ffa2e60af3e (patch) | |
| tree | e042f4b70147fae09faaf882e6190ab6259971f4 /libexec | |
| parent | a7330033a9af5c184657ccbf70e428f2c7a624e9 (diff) | |
Minor cleanup.
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ld.elf_so/arch/alpha/rtld_start.S | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/mips/mips_reloc.c | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/mips/rtld_start.S | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/powerpc/ppc_reloc.c | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/powerpc/rtld_start.S | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/vax/rtld_start.S | 4 | ||||
| -rw-r--r-- | libexec/ld.elf_so/headers.c | 3 | ||||
| -rw-r--r-- | libexec/ld.elf_so/load.c | 3 | ||||
| -rw-r--r-- | libexec/ld.elf_so/map_object.c | 3 | ||||
| -rw-r--r-- | libexec/ld.elf_so/paths.c | 57 | ||||
| -rw-r--r-- | libexec/ld.elf_so/rtld.c | 3 | ||||
| -rw-r--r-- | libexec/ld.elf_so/search.c | 6 | ||||
| -rw-r--r-- | libexec/ld.elf_so/symbol.c | 3 |
13 files changed, 56 insertions, 46 deletions
diff --git a/libexec/ld.elf_so/arch/alpha/rtld_start.S b/libexec/ld.elf_so/arch/alpha/rtld_start.S index 5bf789b6354..27f5d2d9dd9 100644 --- a/libexec/ld.elf_so/arch/alpha/rtld_start.S +++ b/libexec/ld.elf_so/arch/alpha/rtld_start.S @@ -1,8 +1,8 @@ -/* $NetBSD: rtld_start.S,v 1.14 2002/09/12 17:18:37 mycroft Exp $ */ +/* $NetBSD: rtld_start.S,v 1.15 2002/10/05 11:59:05 mycroft Exp $ */ /* * Copyright 1996 Matt Thomas <matt@3am-software.com> - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/arch/mips/mips_reloc.c b/libexec/ld.elf_so/arch/mips/mips_reloc.c index 95895c7c9bb..26e395ccb90 100644 --- a/libexec/ld.elf_so/arch/mips/mips_reloc.c +++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c @@ -1,8 +1,8 @@ -/* $NetBSD: mips_reloc.c,v 1.36 2002/09/26 20:41:34 mycroft Exp $ */ +/* $NetBSD: mips_reloc.c,v 1.37 2002/10/05 11:59:05 mycroft Exp $ */ /* * Copyright 1997 Michael L. Hitch <mhitch@montana.edu> - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/arch/mips/rtld_start.S b/libexec/ld.elf_so/arch/mips/rtld_start.S index 338f2606cdf..03e906a816d 100644 --- a/libexec/ld.elf_so/arch/mips/rtld_start.S +++ b/libexec/ld.elf_so/arch/mips/rtld_start.S @@ -1,8 +1,8 @@ -/* $NetBSD: rtld_start.S,v 1.8 2002/09/26 20:41:34 mycroft Exp $ */ +/* $NetBSD: rtld_start.S,v 1.9 2002/10/05 11:59:05 mycroft Exp $ */ /* * Copyright 1997 Michael L. Hitch <mhitch@montana.edu> - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c b/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c index 2a7228bb166..e8a140523ce 100644 --- a/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c +++ b/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c @@ -1,8 +1,8 @@ -/* $NetBSD: ppc_reloc.c,v 1.31 2002/09/26 20:42:11 mycroft Exp $ */ +/* $NetBSD: ppc_reloc.c,v 1.32 2002/10/05 11:59:06 mycroft Exp $ */ /*- * Copyright (C) 1998 Tsubai Masanari - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/arch/powerpc/rtld_start.S b/libexec/ld.elf_so/arch/powerpc/rtld_start.S index d30a11209d7..34d8c298952 100644 --- a/libexec/ld.elf_so/arch/powerpc/rtld_start.S +++ b/libexec/ld.elf_so/arch/powerpc/rtld_start.S @@ -1,8 +1,8 @@ -/* $NetBSD: rtld_start.S,v 1.10 2002/09/25 07:27:53 mycroft Exp $ */ +/* $NetBSD: rtld_start.S,v 1.11 2002/10/05 11:59:06 mycroft Exp $ */ /*- * Copyright (C) 1998 Tsubai Masanari - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/arch/vax/rtld_start.S b/libexec/ld.elf_so/arch/vax/rtld_start.S index 4cfa63e2968..2c933a54502 100644 --- a/libexec/ld.elf_so/arch/vax/rtld_start.S +++ b/libexec/ld.elf_so/arch/vax/rtld_start.S @@ -1,8 +1,8 @@ -/* $NetBSD: rtld_start.S,v 1.14 2002/09/27 03:46:12 mycroft Exp $ */ +/* $NetBSD: rtld_start.S,v 1.15 2002/10/05 11:59:06 mycroft Exp $ */ /* * Copyright 1996 Matt Thomas <matt@3am-software.com> - * Portions copyright 2002 Charles M. Hannum. + * Portions copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/headers.c b/libexec/ld.elf_so/headers.c index c6b004214ce..922939d82b5 100644 --- a/libexec/ld.elf_so/headers.c +++ b/libexec/ld.elf_so/headers.c @@ -1,8 +1,9 @@ -/* $NetBSD: headers.c,v 1.16 2002/10/04 18:50:43 mycroft Exp $ */ +/* $NetBSD: headers.c,v 1.17 2002/10/05 11:59:03 mycroft Exp $ */ /* * Copyright 1996 John D. Polstra. * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/load.c b/libexec/ld.elf_so/load.c index 6083b17dc20..227c6bf59b1 100644 --- a/libexec/ld.elf_so/load.c +++ b/libexec/ld.elf_so/load.c @@ -1,8 +1,9 @@ -/* $NetBSD: load.c,v 1.23 2002/10/04 04:04:26 mycroft Exp $ */ +/* $NetBSD: load.c,v 1.24 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 John D. Polstra. * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/map_object.c b/libexec/ld.elf_so/map_object.c index 565f35625ee..841efacf733 100644 --- a/libexec/ld.elf_so/map_object.c +++ b/libexec/ld.elf_so/map_object.c @@ -1,8 +1,9 @@ -/* $NetBSD: map_object.c,v 1.23 2002/10/05 00:13:27 mycroft Exp $ */ +/* $NetBSD: map_object.c,v 1.24 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 John D. Polstra. * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/paths.c b/libexec/ld.elf_so/paths.c index 60455a14580..480defda503 100644 --- a/libexec/ld.elf_so/paths.c +++ b/libexec/ld.elf_so/paths.c @@ -1,7 +1,8 @@ -/* $NetBSD: paths.c,v 1.18 2002/09/28 05:00:27 junyoung Exp $ */ +/* $NetBSD: paths.c,v 1.19 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,8 +54,8 @@ static Search_Path *_rtld_find_path __P((Search_Path *, const char *, size_t)); static Search_Path **_rtld_append_path __P((Search_Path **, Search_Path **, - const char *, const char *)); -static void _rtld_process_mapping __P((Library_Xform **, char *, char *)); + const char *, size_t)); +static void _rtld_process_mapping __P((Library_Xform **, char *, size_t)); static Search_Path * _rtld_find_path(path, pathstr, pathlen) @@ -71,25 +72,25 @@ _rtld_find_path(path, pathstr, pathlen) } static Search_Path ** -_rtld_append_path(head_p, path_p, bp, ep) +_rtld_append_path(head_p, path_p, bp, len) Search_Path **head_p, **path_p; const char *bp; - const char *ep; + size_t len; { char *cp; Search_Path *path; - if (bp == NULL || bp == ep || *bp == '\0') + if (bp == NULL || len == 0 || *bp == '\0') return path_p; - if (_rtld_find_path(*head_p, bp, ep - bp) != NULL) + if (_rtld_find_path(*head_p, bp, len) != NULL) return path_p; path = NEW(Search_Path); - path->sp_pathlen = ep - bp; - cp = xmalloc(path->sp_pathlen + 1); - strncpy(cp, bp, path->sp_pathlen); - cp[path->sp_pathlen] = '\0'; + path->sp_pathlen = len; + cp = xmalloc(len + 1); + memcpy(cp, bp, len); + cp[len] = '\0'; path->sp_path = cp; path->sp_next = (*path_p); (*path_p) = path; @@ -124,7 +125,7 @@ _rtld_add_paths(path_p, pathstr) if (ep == NULL) ep = &pathstr[strlen(pathstr)]; - path_p = _rtld_append_path(head_p, path_p, bp, ep); + path_p = _rtld_append_path(head_p, path_p, bp, ep - bp); if (ep[0] == '\0') break; @@ -186,16 +187,17 @@ const struct list *lists[] = { * <library_name> <machdep_variable> <value,...:library_name,...> ... */ static void -_rtld_process_mapping(lib_p, bp, ep) +_rtld_process_mapping(lib_p, bp, len) Library_Xform **lib_p; - char *bp, *ep; + char *bp; + size_t len; { static const char WS[] = " \t\n"; Library_Xform *hwptr = NULL; char *ptr, *key, *lib, *l; int i, j, k; - if (bp == NULL || bp == ep || *bp == '\0') + if (bp == NULL || len == 0 || *bp == '\0') return; dbg((" processing mapping \"%s\"", bp)); @@ -372,12 +374,13 @@ _rtld_process_hints(path_p, lib_p, fname) break; case '\n': - *p = '\0'; if (doing_path) path_p = _rtld_append_path(head_p, path_p, b, - p); - else - _rtld_process_mapping(lib_p, b, p); + p - b); + else { + *p = '\0'; + _rtld_process_mapping(lib_p, b, p - b); + } b = NULL; break; @@ -387,13 +390,15 @@ _rtld_process_hints(path_p, lib_p, fname) for (sp = p - 1; *sp == ' ' || *sp == '\t'; --sp) continue; - *++sp = '\0'; + ++sp; if (doing_path) path_p = _rtld_append_path(head_p, - path_p, b, sp); - else - _rtld_process_mapping(lib_p, b, sp); - *sp = ' '; + path_p, b, sp - b); + else { + *sp = '\0'; + _rtld_process_mapping(lib_p, b, sp - b); + *sp = ' '; + } } b = NULL; break; @@ -406,9 +411,9 @@ _rtld_process_hints(path_p, lib_p, fname) } if (doing_path) - path_p = _rtld_append_path(head_p, path_p, b, ebuf); + path_p = _rtld_append_path(head_p, path_p, b, ebuf - b); else - _rtld_process_mapping(lib_p, b, ebuf); + _rtld_process_mapping(lib_p, b, ebuf - b); (void)munmap(buf, sz); } diff --git a/libexec/ld.elf_so/rtld.c b/libexec/ld.elf_so/rtld.c index 8cf89b6a7dc..db6978355ac 100644 --- a/libexec/ld.elf_so/rtld.c +++ b/libexec/ld.elf_so/rtld.c @@ -1,8 +1,9 @@ -/* $NetBSD: rtld.c,v 1.86 2002/10/04 18:50:43 mycroft Exp $ */ +/* $NetBSD: rtld.c,v 1.87 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 John D. Polstra. * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libexec/ld.elf_so/search.c b/libexec/ld.elf_so/search.c index 0bde692cd4f..f858bce5cc3 100644 --- a/libexec/ld.elf_so/search.c +++ b/libexec/ld.elf_so/search.c @@ -1,4 +1,4 @@ -/* $NetBSD: search.c,v 1.14 2002/10/01 14:16:53 junyoung Exp $ */ +/* $NetBSD: search.c,v 1.15 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 Matt Thomas <matt@3am-software.com> @@ -77,8 +77,8 @@ _rtld_search_library_path(name, namelen, dir, dirlen, mode) for (sp = _rtld_invalid_paths; sp != NULL; sp = sp->sp_next) { if (sp->sp_pathlen == pathnamelen && - !strncmp(name, sp->sp_path + dirlen + 1, namelen) && - !strncmp(dir, sp->sp_path, dirlen)) { + !memcmp(name, sp->sp_path + dirlen + 1, namelen) && + !memcmp(dir, sp->sp_path, dirlen)) { return NULL; } } diff --git a/libexec/ld.elf_so/symbol.c b/libexec/ld.elf_so/symbol.c index ff75238371e..f4255d891e7 100644 --- a/libexec/ld.elf_so/symbol.c +++ b/libexec/ld.elf_so/symbol.c @@ -1,8 +1,9 @@ -/* $NetBSD: symbol.c,v 1.24 2002/10/04 20:34:10 mycroft Exp $ */ +/* $NetBSD: symbol.c,v 1.25 2002/10/05 11:59:04 mycroft Exp $ */ /* * Copyright 1996 John D. Polstra. * Copyright 1996 Matt Thomas <matt@3am-software.com> + * Copyright 2002 Charles M. Hannum <root@ihack.net> * All rights reserved. * * Redistribution and use in source and binary forms, with or without |
