From c13de8f6a88563211bd4432ca11ca38ed3bf0fc0 Mon Sep 17 00:00:00 2001 From: ab196087 Date: Mon, 15 May 2006 08:44:26 -0700 Subject: PSARC 2006/301 elf_M32.h removal PSARC 2006/309 crle(1) configuration file format change 6174390 crle configuration files are inconsistent across platforms --HG-- rename : usr/src/cmd/sgs/dump/common/util.c => deleted_files/usr/src/cmd/sgs/dump/common/util.c rename : usr/src/uts/common/sys/elf_M32.h => deleted_files/usr/src/uts/common/sys/elf_M32.h --- usr/src/cmd/file/file.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'usr/src/cmd/file/file.c') diff --git a/usr/src/cmd/file/file.c b/usr/src/cmd/file/file.c index 8c48682c3d..18bca230ed 100644 --- a/usr/src/cmd/file/file.c +++ b/usr/src/cmd/file/file.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -27,7 +26,7 @@ /* All Rights Reserved */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -35,6 +34,9 @@ #define _LARGEFILE64_SOURCE +/* Get definitions for the relocation types supported. */ +#define ELF_TARGET_ALL + #include #include #include @@ -53,14 +55,13 @@ #include #include #include -#include -#include #include #include #include #include #include #include +#include #include "file.h" typedef Elf64_Nhdr GElf_Nhdr; @@ -188,6 +189,7 @@ static void usage(void); static void default_magic(void); static void add_to_mlist(char *, int); static void fd_cleanup(void); +static int is_rtld_config(void); #ifdef XPG4 /* SUSv3 requires a single after the colon */ @@ -608,6 +610,7 @@ def_position_tests(void) (void) putchar('\n'); return (1); + /* LINTED: pointer cast may result in improper alignment */ } else if (*(int *)fbuf == CORE_MAGIC) { /* LINTED: pointer cast may result in improper alignment */ @@ -621,6 +624,12 @@ def_position_tests(void) return (1); } + /* + * Runtime linker (ld.so.1) configuration file. + */ + if (is_rtld_config()) + return (1); + /* * ZIP files, JAR files, and Java executables */ @@ -1069,10 +1078,6 @@ static void print_elf_flags(int machine, unsigned int flags) { switch (machine) { - case EM_M32: - if (flags & EF_M32_MAU) - (void) printf("%s", gettext(", MAU Required")); - break; case EM_SPARCV9: if (flags & EF_SPARC_EXT_MASK) { if (flags & EF_SPARC_SUN_US3) { @@ -1311,6 +1316,30 @@ is_stripped(Elf *elf) } } +/* + * is_rtld_config - If file is a runtime linker config file, prints + * the description and returns True (1). Otherwise, silently returns + * False (0). + */ +int +is_rtld_config(void) +{ + Rtc_id *id; + + if ((fbsz >= sizeof (*id)) && RTC_ID_TEST(fbuf)) { + (void) printf(gettext("Runtime Linking Configuration")); + /* LINTED: pointer cast may result in improper alignment */ + id = (Rtc_id *) fbuf; + print_elf_class(id->id_class); + print_elf_datatype(id->id_data); + print_elf_machine(id->id_machine); + (void) printf("\n"); + return (1); + } + + return (0); +} + /* * lookup - * Attempts to match one of the strings from a list, 'tab', -- cgit v1.2.3