ldconfig.c (126896) | ldconfig.c (127250) |
---|---|
1/* 2 * Copyright (c) 1993,1995 Paul Kranenburg 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#ifndef lint 32static const char rcsid[] = | 1/* 2 * Copyright (c) 1993,1995 Paul Kranenburg 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#ifndef lint 32static const char rcsid[] = |
33 "$FreeBSD: head/sbin/ldconfig/ldconfig.c 126896 2004-03-13 00:11:05Z cperciva $"; | 33 "$FreeBSD: head/sbin/ldconfig/ldconfig.c 127250 2004-03-21 01:21:26Z peter $"; |
34#endif /* not lint */ 35 36#include <sys/param.h> 37#include <sys/types.h> 38#include <sys/stat.h> 39#include <sys/mman.h> 40#include <a.out.h> 41#include <ctype.h> --- 16 unchanged lines hidden (view full) --- 58#if DEBUG 59/* test */ 60#undef _PATH_LD_HINTS 61#define _PATH_LD_HINTS "./ld.so.hints" 62#undef _PATH_ELF_HINTS 63#define _PATH_ELF_HINTS "./ld-elf.so.hints" 64#endif 65 | 34#endif /* not lint */ 35 36#include <sys/param.h> 37#include <sys/types.h> 38#include <sys/stat.h> 39#include <sys/mman.h> 40#include <a.out.h> 41#include <ctype.h> --- 16 unchanged lines hidden (view full) --- 58#if DEBUG 59/* test */ 60#undef _PATH_LD_HINTS 61#define _PATH_LD_HINTS "./ld.so.hints" 62#undef _PATH_ELF_HINTS 63#define _PATH_ELF_HINTS "./ld-elf.so.hints" 64#endif 65 |
66#define _PATH_LD32_HINTS "/var/run/ld32.so.hints" 67#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" 68 |
|
66#undef major 67#undef minor 68 69static int verbose; 70static int nostd; 71static int justread; 72static int merge; 73static int rescan; --- 23 unchanged lines hidden (view full) --- 97 98int 99main(argc, argv) 100int argc; 101char *argv[]; 102{ 103 int i, c; 104 int rval = 0; | 69#undef major 70#undef minor 71 72static int verbose; 73static int nostd; 74static int justread; 75static int merge; 76static int rescan; --- 23 unchanged lines hidden (view full) --- 100 101int 102main(argc, argv) 103int argc; 104char *argv[]; 105{ 106 int i, c; 107 int rval = 0; |
105 int is_aout; | 108 int is_aout = 0; 109 int is_32 = 0; |
106 | 110 |
107 is_aout = 0; 108 if (argc > 1 && strcmp(argv[1], "-aout") == 0) { 109 is_aout = 1; 110 argc--; 111 argv++; 112 } else if (argc > 1 && strcmp(argv[1], "-elf") == 0) { 113 /* skip over legacy -elf arg */ 114 argc--; 115 argv++; | 111 while (argc > 1) { 112 if (strcmp(argv[1], "-aout") == 0) { 113 is_aout = 1; 114 argc--; 115 argv++; 116 } else if (strcmp(argv[1], "-elf") == 0) { 117 is_aout = 0; 118 argc--; 119 argv++; 120 } else if (strcmp(argv[1], "-32") == 0) { 121 is_32 = 1; 122 argc--; 123 argv++; 124 } else { 125 break; 126 } |
116 } 117 | 127 } 128 |
118 hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; | 129 if (is_32) 130 hints_file = is_aout ? _PATH_LD32_HINTS : _PATH_ELF32_HINTS; 131 else 132 hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; |
119 if (argc == 1) 120 rescan = 1; 121 else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { 122 switch (c) { 123 case 'R': 124 rescan = 1; 125 break; 126 case 'f': --- 495 unchanged lines hidden --- | 133 if (argc == 1) 134 rescan = 1; 135 else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { 136 switch (c) { 137 case 'R': 138 rescan = 1; 139 break; 140 case 'f': --- 495 unchanged lines hidden --- |