diff options
author | peter <peter@FreeBSD.org> | 2004-03-21 01:21:26 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-03-21 01:21:26 +0000 |
commit | ccd389b7a3813a60939dfe53407367fc91ef3df8 (patch) | |
tree | ded17068c1bf0dea014f27d5b6b5ccda995841f0 /sbin | |
parent | 14202432d8f8324b424c7568b2a142567d110dfb (diff) | |
download | FreeBSD-src-ccd389b7a3813a60939dfe53407367fc91ef3df8.zip FreeBSD-src-ccd389b7a3813a60939dfe53407367fc91ef3df8.tar.gz |
Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems. Most of this involves using alternate
paths, environment variables and diagnostic messages.
The build glue is seperate.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ldconfig/ldconfig.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 23516a8..5c0eb1d 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -63,6 +63,9 @@ static const char rcsid[] = #define _PATH_ELF_HINTS "./ld-elf.so.hints" #endif +#define _PATH_LD32_HINTS "/var/run/ld32.so.hints" +#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints" + #undef major #undef minor @@ -102,20 +105,31 @@ char *argv[]; { int i, c; int rval = 0; - int is_aout; - - is_aout = 0; - if (argc > 1 && strcmp(argv[1], "-aout") == 0) { - is_aout = 1; - argc--; - argv++; - } else if (argc > 1 && strcmp(argv[1], "-elf") == 0) { - /* skip over legacy -elf arg */ - argc--; - argv++; + int is_aout = 0; + int is_32 = 0; + + while (argc > 1) { + if (strcmp(argv[1], "-aout") == 0) { + is_aout = 1; + argc--; + argv++; + } else if (strcmp(argv[1], "-elf") == 0) { + is_aout = 0; + argc--; + argv++; + } else if (strcmp(argv[1], "-32") == 0) { + is_32 = 1; + argc--; + argv++; + } else { + break; + } } - hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; + if (is_32) + hints_file = is_aout ? _PATH_LD32_HINTS : _PATH_ELF32_HINTS; + else + hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; if (argc == 1) rescan = 1; else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { |