ldconfig.c (248525) | ldconfig.c (294295) |
---|---|
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 248525 2013-03-19 16:57:04Z imp $"; | 33 "$FreeBSD: head/sbin/ldconfig/ldconfig.c 294295 2016-01-18 21:40:18Z imp $"; |
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> --- 17 unchanged lines hidden (view full) --- 59#undef _PATH_LD_HINTS 60#define _PATH_LD_HINTS "./ld.so.hints" 61#undef _PATH_ELF_HINTS 62#define _PATH_ELF_HINTS "./ld-elf.so.hints" 63#endif 64 65#define _PATH_LD32_HINTS "/var/run/ld32.so.hints" 66#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" | 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> --- 17 unchanged lines hidden (view full) --- 59#undef _PATH_LD_HINTS 60#define _PATH_LD_HINTS "./ld.so.hints" 61#undef _PATH_ELF_HINTS 62#define _PATH_ELF_HINTS "./ld-elf.so.hints" 63#endif 64 65#define _PATH_LD32_HINTS "/var/run/ld32.so.hints" 66#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" |
67#define _PATH_ELFSOFT_HINTS "/var/run/ld-elf-soft.so.hints" |
|
67 68#undef major 69#undef minor 70 71static int verbose; 72static int nostd; 73static int justread; 74static int merge; --- 31 unchanged lines hidden (view full) --- 106 107int 108main(int argc, char **argv) 109{ 110 int i, c; 111 int rval = 0; 112 int is_aout = 0; 113 int is_32 = 0; | 68 69#undef major 70#undef minor 71 72static int verbose; 73static int nostd; 74static int justread; 75static int merge; --- 31 unchanged lines hidden (view full) --- 107 108int 109main(int argc, char **argv) 110{ 111 int i, c; 112 int rval = 0; 113 int is_aout = 0; 114 int is_32 = 0; |
115 int is_soft = 0; |
|
114 115 while (argc > 1) { 116 if (strcmp(argv[1], "-aout") == 0) { 117 is_aout = 1; 118 argc--; 119 argv++; 120 } else if (strcmp(argv[1], "-elf") == 0) { 121 is_aout = 0; 122 argc--; 123 argv++; 124 } else if (strcmp(argv[1], "-32") == 0) { 125 is_32 = 1; 126 argc--; 127 argv++; | 116 117 while (argc > 1) { 118 if (strcmp(argv[1], "-aout") == 0) { 119 is_aout = 1; 120 argc--; 121 argv++; 122 } else if (strcmp(argv[1], "-elf") == 0) { 123 is_aout = 0; 124 argc--; 125 argv++; 126 } else if (strcmp(argv[1], "-32") == 0) { 127 is_32 = 1; 128 argc--; 129 argv++; |
130 } else if (strcmp(argv[1], "-soft") == 0) { 131 is_soft = 1; 132 argc--; 133 argv++; |
|
128 } else { 129 break; 130 } 131 } 132 | 134 } else { 135 break; 136 } 137 } 138 |
133 if (is_32) | 139 if (is_soft) 140 hints_file = _PATH_ELFSOFT_HINTS; /* Never will have a.out softfloat */ 141 else if (is_32) |
134 hints_file = is_aout ? _PATH_LD32_HINTS : _PATH_ELF32_HINTS; 135 else 136 hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; 137 if (argc == 1) 138 rescan = 1; 139 else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { 140 switch (c) { 141 case 'R': --- 499 unchanged lines hidden --- | 142 hints_file = is_aout ? _PATH_LD32_HINTS : _PATH_ELF32_HINTS; 143 else 144 hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; 145 if (argc == 1) 146 rescan = 1; 147 else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { 148 switch (c) { 149 case 'R': --- 499 unchanged lines hidden --- |