/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* 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
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <libld.h>
#include <rtld.h>
#include <conv.h>
#include "msg.h"
#include "_debug.h"
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
const char *str;
if (type == MR_PADDING)
else if (type == MR_HDR_ELF)
else if (type == MR_HDR_AOUT)
else
}
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (addr == 0)
else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
static int hdl_title = 0;
void
{
MSG_FIL_HDL_CREATE, /* MSG_INTL(MSG_FIL_HDL_CREATE) */
MSG_FIL_HDL_ADD, /* MSG_INTL(MSG_FIL_HDL_ADD) */
MSG_FIL_HDL_DELETE, /* MSG_INTL(MSG_FIL_HDL_DELETE) */
MSG_FIL_HDL_ORPHAN, /* MSG_INTL(MSG_FIL_HDL_ORPHAN) */
MSG_FIL_HDL_REINST, /* MSG_INTL(MSG_FIL_HDL_REINST) */
};
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Establish a binding title for later use in Dbg_file_hdl_action.
*/
if (type <= DBG_HDL_REINST) {
hdl_title = 1;
} else {
hdl_str = 0;
hdl_title = 0;
}
}
void
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
else
if (hdl_title) {
hdl_title = 0;
}
if (name)
else
}
void
{
MSG_FIL_DEP_ADD, /* MSG_INTL(MSG_FIL_DEP_ADD) */
MSG_FIL_DEP_UPDATE, /* MSG_INTL(MSG_FIL_DEP_UPDATE) */
MSG_FIL_DEP_DELETE, /* MSG_INTL(MSG_FIL_DEP_DELETE) */
MSG_FIL_DEP_REMOVE, /* MSG_INTL(MSG_FIL_DEP_REMOVE) */
MSG_FIL_DEP_REMAIN, /* MSG_INTL(MSG_FIL_DEP_REMAIN) */
MSG_FIL_DEP_ORPHAN, /* MSG_INTL(MSG_FIL_DEP_ORPHAN) */
MSG_FIL_DEP_REINST, /* MSG_INTL(MSG_FIL_DEP_REINST) */
};
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
if (hdl_title) {
if (hdl_str) {
const char *name;
/*
* Protect ourselves in case this handle has no
* originating owner.
*/
else
}
hdl_title = 0;
}
/*
* Establish a binding descriptor format string.
*/
if (type > DBG_DEP_REINST)
return;
else
(RTLD_GLOBAL | RTLD_NODELETE))
else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the dependency together with the modes of the binding.
*/
}
void
{
const char *str;
int next = 0;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
if (flag & RT_SORT_REV)
else
/* LINTED */
/*
* For .init processing, only collect objects that have been
* relocated and haven't already been collected.
* For .fini processing, only collect objects that have had
* their .init collected, and haven't already been .fini
* collected.
*/
if (flag & RT_SORT_REV) {
continue;
} else {
if ((flag & RT_SORT_DELETE) &&
continue;
(FLG_RT_INITCLCT | FLG_RT_FINICLCT)) ==
FLG_RT_INITCLCT) == 0)
continue;
}
if (next++)
else {
&bnd_type_buf));
}
}
}
}
void
{
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
int config)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (config)
else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (audit)
else if (filter)
else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
int fd;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Obtain the present input object filename for concatenation to the
* prefix name.
*/
else
ofile++;
/*
* Concatenate the prefix with the object filename, open the file and
* write out the present Elf memory image. As this is debugging we
* ignore all errors.
*/
0666)) != -1) {
}
}
}
void
{
const char *str;
if (features == 0)
return;
switch (features & ~CONF_FEATMSK) {
case DBG_CONF_IGNORE:
break;
case DBG_CONF_VERSION:
break;
case DBG_CONF_PRCFAIL:
break;
case DBG_CONF_CORRUPT:
break;
case DBG_CONF_ABIMISMATCH:
break;
default:
break;
}
}
void
const char *config)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (file) {
} else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/* LINTED */
}
}
/*
* Report archive rescan operation.
* argv_start_ndx, argv_end_ndx - Index range of command line arguments
* from which archives are to be reprocessed.
*/
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (again)
else
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
static const Msg
reject[] = {
MSG_REJ_MACH, /* MSG_INTL(MSG_REJ_MACH) */
MSG_REJ_CLASS, /* MSG_INTL(MSG_REJ_CLASS) */
MSG_REJ_DATA, /* MSG_INTL(MSG_REJ_DATA) */
MSG_REJ_TYPE, /* MSG_INTL(MSG_REJ_TYPE) */
MSG_REJ_BADFLAG, /* MSG_INTL(MSG_REJ_BADFLAG) */
MSG_REJ_MISFLAG, /* MSG_INTL(MSG_REJ_MISFLAG) */
MSG_REJ_VERSION, /* MSG_INTL(MSG_REJ_VERSION) */
MSG_REJ_HAL, /* MSG_INTL(MSG_REJ_HAL) */
MSG_REJ_US3, /* MSG_INTL(MSG_REJ_US3) */
MSG_REJ_STR, /* MSG_INTL(MSG_REJ_STR) */
MSG_REJ_UNKFILE, /* MSG_INTL(MSG_REJ_UNKFILE) */
MSG_REJ_UNKCAP, /* MSG_INTL(MSG_REJ_UNKCAP) */
MSG_REJ_HWCAP_1, /* MSG_INTL(MSG_REJ_HWCAP_1) */
MSG_REJ_SFCAP_1, /* MSG_INTL(MSG_REJ_SFCAP_1) */
MSG_REJ_MACHCAP, /* MSG_INTL(MSG_REJ_MACHCAP) */
MSG_REJ_PLATCAP, /* MSG_INTL(MSG_REJ_PLATCAP) */
MSG_REJ_HWCAP_2 /* MSG_INTL(MSG_REJ_HWCAP_2) */
};
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
else
}
void
{
const char *str;
return;
if (DBG_NOTDETAIL())
return;
if (nfd == -1)
else
}
if (nelf == 0)
else
}
}
void
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
}