summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRod Evans <Rod.Evans@Sun.COM>2009-01-26 14:58:24 -0800
committerRod Evans <Rod.Evans@Sun.COM>2009-01-26 14:58:24 -0800
commitb4059b01d62d4bc3032cf192d365aff4f632526b (patch)
treeadf77beebd4d23658bb91140c09ba3ccf57afb4a /usr/src
parent690d169b7362d7345d695f6ba4862bd714799136 (diff)
downloadillumos-gate-b4059b01d62d4bc3032cf192d365aff4f632526b.tar.gz
6797468 ld.so.1: orphaned handles aren't processed correctly
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/sgs/liblddbg/common/files.c2
-rw-r--r--usr/src/cmd/sgs/liblddbg/common/liblddbg.msg2
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README1
-rw-r--r--usr/src/cmd/sgs/rtld/common/dlfcns.c102
-rw-r--r--usr/src/cmd/sgs/rtld/common/remove.c46
-rw-r--r--usr/src/cmd/sgs/rtld/common/rtld.msg2
6 files changed, 80 insertions, 75 deletions
diff --git a/usr/src/cmd/sgs/liblddbg/common/files.c b/usr/src/cmd/sgs/liblddbg/common/files.c
index 6f912912a6..d6f32a81a1 100644
--- a/usr/src/cmd/sgs/liblddbg/common/files.c
+++ b/usr/src/cmd/sgs/liblddbg/common/files.c
@@ -256,7 +256,7 @@ Dbg_file_hdl_action(Grp_hdl *ghp, Rt_map *lmp, int type, uint_t flags)
else
name = MSG_INTL(MSG_STR_UNKNOWN);
- dbg_print(lml, MSG_INTL(hdl_str), name);
+ dbg_print(lml, MSG_INTL(hdl_str), name, EC_NATPTR(ghp));
}
hdl_title = 0;
}
diff --git a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg
index 7f0556569c..18bad94d98 100644
--- a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg
+++ b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg
@@ -429,7 +429,7 @@
@ MSG_FIL_DEP_ORPHAN " file=%s; object remains on orphan handle %s"
@ MSG_FIL_DEP_REINST " file=%s; object reinstated %s"
-@ MSG_FIL_HDL_CREATE "handle=%s; creating:"
+@ MSG_FIL_HDL_CREATE "handle=%s; creating: 0x%llx"
@ MSG_FIL_HDL_ADD "handle=%s; adding dependent objects:"
@ MSG_FIL_HDL_DELETE "handle=%s; inspecting for deletion:"
@ MSG_FIL_HDL_ORPHAN "handle=%s; deletion cannot be completed: moving to \
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index a7538897fb..2ceccbdaa7 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1433,3 +1433,4 @@ Bugid Risk Synopsis
6686372 ld.so.1 should use mmapobj(2)
6726108 dlopen() performance could be improved.
6792836 ld is slow when processing GNU linkonce sections
+6797468 ld.so.1: orphaned handles aren't processed correctly
diff --git a/usr/src/cmd/sgs/rtld/common/dlfcns.c b/usr/src/cmd/sgs/rtld/common/dlfcns.c
index 68dedae3b6..60747c0498 100644
--- a/usr/src/cmd/sgs/rtld/common/dlfcns.c
+++ b/usr/src/cmd/sgs/rtld/common/dlfcns.c
@@ -184,7 +184,7 @@ Grp_hdl *
hdl_create(Lm_list *lml, Rt_map *nlmp, Rt_map *clmp, uint_t hflags,
uint_t ndflags, uint_t cdflags)
{
- Grp_hdl *ghp = 0, *_ghp;
+ Grp_hdl *ghp = NULL, *_ghp;
APlist **alpp;
Aliste idx;
@@ -213,7 +213,7 @@ hdl_create(Lm_list *lml, Rt_map *nlmp, Rt_map *clmp, uint_t hflags,
}
}
- if (ghp == 0) {
+ if (ghp == NULL) {
uint_t ndx;
DBG_CALL(Dbg_file_hdl_title(DBG_HDL_CREATE));
@@ -447,7 +447,7 @@ dlclose_core(Grp_hdl *ghp, Rt_map *clmp, Lm_list *lml)
* is part of an alternative link-map list, determine if the whole list
* can be removed also.
*/
- error = remove_hdl(ghp, clmp, 0);
+ error = remove_hdl(ghp, clmp, NULL);
if ((lml->lm_flags & (LML_FLG_BASELM | LML_FLG_RTLDLM)) == 0)
remove_lml(lml);
@@ -462,8 +462,8 @@ dlclose_core(Grp_hdl *ghp, Rt_map *clmp, Lm_list *lml)
int
dlclose_intn(Grp_hdl *ghp, Rt_map *clmp)
{
- Rt_map *nlmp = 0;
- Lm_list *olml = 0;
+ Rt_map *nlmp = NULL;
+ Lm_list *olml = NULL;
int error;
/*
@@ -506,7 +506,8 @@ dlclose_check(void *handle, Rt_map *clmp)
Grp_hdl *ghp = (Grp_hdl *)handle;
if (hdl_validate(ghp) == 0) {
- eprintf(LIST(clmp), ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL));
+ eprintf(LIST(clmp), ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL),
+ EC_NATPTR(handle));
return (1);
}
return (dlclose_intn(ghp, clmp));
@@ -556,7 +557,7 @@ newlmid(Lm_list *lml)
MSG_ORIG(MSG_LMID_FMT), MSG_ORIG(MSG_LMID_ALT),
lml->lm_lmid);
}
- if ((lml->lm_lmidstr = strdup(buffer)) == 0)
+ if ((lml->lm_lmidstr = strdup(buffer)) == NULL)
return (0);
return (1);
@@ -594,7 +595,7 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
* If the path specified is null then we're operating on global
* objects. Associate a dummy handle with the link-map list.
*/
- if (path == 0) {
+ if (path == NULL) {
Grp_hdl *ghp;
uint_t hflags = GPH_ZERO, cdflags = GPD_PARENT;
int promote = 0;
@@ -626,8 +627,8 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
cdflags |= GPD_RELOC;
if ((ghp = hdl_create(lml, 0, clmp, hflags,
- (GPD_DLSYM | GPD_RELOC | GPD_ADDEPS), cdflags)) == 0)
- return (0);
+ (GPD_DLSYM | GPD_RELOC | GPD_ADDEPS), cdflags)) == NULL)
+ return (NULL);
/*
* Traverse the main link-map control list, updating the mode
@@ -664,13 +665,13 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
* provides flexibility should we be able to support dlopening more
* than one object in the future.
*/
- if (LM_FIX_NAME(clmp)(path, clmp, &palp, AL_CNT_NEEDED, orig) == 0)
- return (0);
+ if (LM_FIX_NAME(clmp)(path, clmp, &palp, AL_CNT_NEEDED, orig) == NULL)
+ return (NULL);
if ((palp->al_arritems > 1) && ((mode & RTLD_FIRST) == 0)) {
remove_plist(&palp, 1);
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_ILLMODE_5));
- return (0);
+ return (NULL);
}
/*
@@ -678,9 +679,9 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
* associated object.
*/
if ((lmc = alist_append(&lml->lm_lists, 0, sizeof (Lm_cntl),
- AL_CNT_LMLISTS)) == 0) {
+ AL_CNT_LMLISTS)) == NULL) {
remove_plist(&palp, 1);
- return (0);
+ return (NULL);
}
olmco = nlmco = (Aliste)((char *)lmc - (char *)lml->lm_lists);
@@ -692,9 +693,9 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
* couldn't be loaded, cleanup.
*/
remove_plist(&palp, 1);
- if (nlmp == 0) {
+ if (nlmp == NULL) {
remove_cntl(lml, olmco);
- return (0);
+ return (NULL);
}
/*
@@ -717,7 +718,7 @@ dlmopen_core(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
*/
if (((nlmp = analyze_lmc(lml, nlmco, nlmp, in_nfavl)) == NULL) ||
(relocate_lmc(lml, nlmco, clmp, nlmp, in_nfavl) == 0)) {
- ghp = 0;
+ ghp = NULL;
nlmp = NULL;
}
@@ -775,7 +776,7 @@ Grp_hdl *
dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
uint_t flags, uint_t orig)
{
- Rt_map *dlmp = 0;
+ Rt_map *dlmp = NULL;
Grp_hdl *ghp;
int in_nfavl = 0;
@@ -806,7 +807,7 @@ dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
lml->lm_flags |= LML_FLG_NOAUDIT;
}
- if (list_append(&dynlm_list, lml) == 0) {
+ if (list_append(&dynlm_list, lml) == NULL) {
free(lml);
return (NULL);
}
@@ -833,7 +834,7 @@ dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
* file system has changed since this "not-found" recording was made,
* retry the dlopen() with a clean "not-found" AVL tree.
*/
- if ((ghp == 0) && in_nfavl) {
+ if ((ghp == NULL) && in_nfavl) {
avl_tree_t *oavlt = nfavl;
nfavl = NULL;
@@ -868,10 +869,10 @@ dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
/*
* If this load failed, remove any alternative link-map list.
*/
- if ((ghp == 0) &&
+ if ((ghp == NULL) &&
((lml->lm_flags & (LML_FLG_BASELM | LML_FLG_RTLDLM)) == 0)) {
remove_lml(lml);
- lml = 0;
+ lml = NULL;
}
/*
@@ -911,7 +912,7 @@ dlmopen_check(Lm_list *lml, const char *path, int mode, Rt_map *clmp)
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_ILLMODE_2));
return (0);
}
- if ((lml == (Lm_list *)LM_ID_NEWLM) && (path == 0)) {
+ if ((lml == (Lm_list *)LM_ID_NEWLM) && (path == NULL)) {
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_ILLMODE_3));
return (0);
}
@@ -983,7 +984,7 @@ dlsym_handle(Grp_hdl *ghp, Slookup *slp, Rt_map **_lmp, uint_t *binfo,
Rt_map *nlmp, * lmp = ghp->gh_ownlmp;
Rt_map *clmp = slp->sl_cmap;
const char *name = slp->sl_name;
- Sym *sym = 0;
+ Sym *sym = NULL;
Slookup sl = *slp;
sl.sl_flags = (LKUP_FIRST | LKUP_SPEC);
@@ -1200,7 +1201,7 @@ dlsym_core(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp,
* lookup_sym(), however here, we must do this up-front, as
* lookup_sym() will be used to inspect the next object.
*/
- if ((sl.sl_rsymndx) && ((sip = SYMINFO(clmp)) != 0)) {
+ if ((sl.sl_rsymndx) && ((sip = SYMINFO(clmp)) != NULL)) {
/* LINTED */
sip = (Syminfo *)((char *)sip +
(sl.sl_rsymndx * SYMINENT(clmp)));
@@ -1215,7 +1216,7 @@ dlsym_core(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp,
* lookup_sym() of the next object.
*/
sl.sl_rsymndx = 0;
- sl.sl_rsym = 0;
+ sl.sl_rsym = NULL;
}
/*
@@ -1231,7 +1232,7 @@ dlsym_core(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp,
(nlmp ? NAME(nlmp) : MSG_INTL(MSG_STR_NULL)),
DBG_DLSYM_NEXT));
- if (nlmp == 0)
+ if (nlmp == NULL)
return (0);
sl.sl_flags = LKUP_NEXT;
@@ -1330,7 +1331,7 @@ dlsym_core(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp,
void *
dlsym_intn(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp)
{
- Rt_map *llmp = 0;
+ Rt_map *llmp = NULL;
void *error;
Aliste idx;
Grp_desc *gdp;
@@ -1352,7 +1353,8 @@ dlsym_intn(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp)
llmp = LIST(ghp->gh_ownlmp)->lm_tail;
else {
for (ALIST_TRAVERSE(ghp->gh_depends, idx, gdp)) {
- if ((llmp = LIST(gdp->gd_depend)->lm_tail) != 0)
+ if ((llmp =
+ LIST(gdp->gd_depend)->lm_tail) != NULL)
break;
}
}
@@ -1366,7 +1368,7 @@ dlsym_intn(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp)
* the file system has changed since this "not-found" recording was
* made, retry the dlsym() with a clean "not-found" AVL tree.
*/
- if ((error == 0) && in_nfavl) {
+ if ((error == NULL) && in_nfavl) {
avl_tree_t *oavlt = nfavl;
nfavl = NULL;
@@ -1382,12 +1384,12 @@ dlsym_intn(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp)
nfavl = oavlt;
}
- if (error == 0) {
+ if (error == NULL) {
/*
* Cache the error message, as Java tends to fall through this
* code many times.
*/
- if (nosym_str == 0)
+ if (nosym_str == NULL)
nosym_str = MSG_INTL(MSG_GEN_NOSYM);
eprintf(LIST(clmp), ERR_FATAL, nosym_str, name);
}
@@ -1405,15 +1407,16 @@ dlsym_check(void *handle, const char *name, Rt_map *clmp, Rt_map **dlmp)
/*
* Verify the arguments.
*/
- if (name == 0) {
+ if (name == NULL) {
eprintf(LIST(clmp), ERR_FATAL, MSG_INTL(MSG_ARG_ILLSYM));
- return (0);
+ return (NULL);
}
if ((handle != RTLD_NEXT) && (handle != RTLD_DEFAULT) &&
(handle != RTLD_SELF) && (handle != RTLD_PROBE) &&
(hdl_validate((Grp_hdl *)handle) == 0)) {
- eprintf(LIST(clmp), ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL));
- return (0);
+ eprintf(LIST(clmp), ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL),
+ EC_NATPTR(handle));
+ return (NULL);
}
return (dlsym_intn(handle, name, clmp, dlmp));
}
@@ -1429,7 +1432,7 @@ void *
dlsym(void *handle, const char *name)
{
int entry;
- Rt_map *clmp, *dlmp = 0;
+ Rt_map *clmp, *dlmp = NULL;
void *addr;
entry = enter(0);
@@ -1458,8 +1461,8 @@ dladdr_core(Rt_map *clmp, void *addr, Dl_info *dlip, void **info, int flags)
dlip->dli_fname = PATHNAME(clmp);
dlip->dli_fbase = (void *)ADDR(clmp);
- dlip->dli_sname = 0;
- dlip->dli_saddr = 0;
+ dlip->dli_sname = NULL;
+ dlip->dli_saddr = NULL;
/*
* Determine the nearest symbol to this address.
@@ -1486,7 +1489,7 @@ dladdr(void *addr, Dl_info *dlip)
* with the supplied address. If a caller can't be determined,
* indicate the failure.
*/
- if ((clmp = _caller(addr, CL_NONE)) == 0) {
+ if ((clmp = _caller(addr, CL_NONE)) == NULL) {
eprintf(0, ERR_FATAL, MSG_INTL(MSG_ARG_INVADDR),
EC_NATPTR(addr));
error = 0;
@@ -1520,7 +1523,7 @@ dladdr1(void *addr, Dl_info *dlip, void **info, int flags)
flags);
return (0);
}
- if (info == 0) {
+ if (info == NULL) {
eprintf(0, ERR_FATAL, MSG_INTL(MSG_ARG_ILLINFO), flags);
return (0);
}
@@ -1533,7 +1536,7 @@ dladdr1(void *addr, Dl_info *dlip, void **info, int flags)
* with the supplied address. If a caller can't be determined,
* indicate the failure.
*/
- if ((clmp = _caller(addr, CL_NONE)) == 0) {
+ if ((clmp = _caller(addr, CL_NONE)) == NULL) {
eprintf(0, ERR_FATAL, MSG_INTL(MSG_ARG_INVADDR),
EC_NATPTR(addr));
error = 0;
@@ -1573,7 +1576,7 @@ dldump_core(Lm_list *lml, const char *ipath, const char *opath, int flags)
* have to be revisited.
*/
if (ipath) {
- if ((lmp = is_so_loaded(&lml_main, ipath, NULL)) == 0) {
+ if ((lmp = is_so_loaded(&lml_main, ipath, NULL)) == NULL) {
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_GEN_NOFILE),
ipath);
return (1);
@@ -1664,7 +1667,7 @@ dlinfo_core(void *handle, int request, void *p, Rt_map *clmp)
Lm_list *lml = LIST(clmp);
Rt_map *lmp;
- if ((request > RTLD_DI_MAX) || (p == 0)) {
+ if ((request > RTLD_DI_MAX) || (p == NULL)) {
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_ILLVAL));
return (-1);
}
@@ -1675,7 +1678,7 @@ dlinfo_core(void *handle, int request, void *p, Rt_map *clmp)
if (request == RTLD_DI_CONFIGADDR) {
Dl_info *dlip = (Dl_info *)p;
- if ((config->c_name == 0) || (config->c_bgn == 0) ||
+ if ((config->c_name == NULL) || (config->c_bgn == 0) ||
(config->c_end == 0)) {
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_NOCONFIG));
return (-1);
@@ -1743,7 +1746,8 @@ dlinfo_core(void *handle, int request, void *p, Rt_map *clmp)
Grp_hdl *ghp = (Grp_hdl *)handle;
if (!hdl_validate(ghp)) {
- eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL));
+ eprintf(lml, ERR_FATAL, MSG_INTL(MSG_ARG_INVHNDL),
+ EC_NATPTR(handle));
return (-1);
}
lmp = ghp->gh_ownlmp;
@@ -1803,10 +1807,10 @@ dlinfo_core(void *handle, int request, void *p, Rt_map *clmp)
/*
* Traverse search path entries for this object.
*/
- while ((pdp = get_next_dir(&sd, lmp, 0)) != 0) {
+ while ((pdp = get_next_dir(&sd, lmp, 0)) != NULL) {
size_t _size;
- if (pdp->pd_pname == 0)
+ if (pdp->pd_pname == NULL)
continue;
/*
diff --git a/usr/src/cmd/sgs/rtld/common/remove.c b/usr/src/cmd/sgs/rtld/common/remove.c
index b752974111..edc4b28238 100644
--- a/usr/src/cmd/sgs/rtld/common/remove.c
+++ b/usr/src/cmd/sgs/rtld/common/remove.c
@@ -169,7 +169,7 @@ remove_plist(Alist **alpp, int complete)
void
remove_lml(Lm_list *lml)
{
- if (lml && (lml->lm_head == 0)) {
+ if (lml && (lml->lm_head == NULL)) {
/*
* As a whole link-map list is being removed, the debuggers
* would have been alerted of this deletion (or an addition
@@ -223,7 +223,7 @@ remove_so(Lm_list *lml, Rt_map *lmp)
{
Dyninfo *dip;
- if (lmp == 0)
+ if (lmp == NULL)
return;
/*
@@ -243,12 +243,12 @@ remove_so(Lm_list *lml, Rt_map *lmp)
for (tag = 0; tag < CI_MAX; tag++) {
if (lml->lm_lcs[tag].lc_lmp == lmp) {
- lml->lm_lcs[tag].lc_lmp = 0;
+ lml->lm_lcs[tag].lc_lmp = NULL;
lml->lm_lcs[tag].lc_un.lc_val = 0;
}
if (glcs[tag].lc_lmp == lmp) {
- ASSERT(glcs[tag].lc_lmp != 0);
- glcs[tag].lc_lmp = 0;
+ ASSERT(glcs[tag].lc_lmp != NULL);
+ glcs[tag].lc_lmp = NULL;
glcs[tag].lc_un.lc_val = 0;
}
}
@@ -442,7 +442,7 @@ remove_lists(Rt_map *lmp, int lazy)
continue;
if (dip->di_info == (void *)lmp) {
- dip->di_info = 0;
+ dip->di_info = NULL;
if (LAZY(clmp)++ == 0)
LIST(clmp)->lm_lazy++;
@@ -475,7 +475,7 @@ remove_cntl(Lm_list *lml, Aliste lmco)
/*
* This element should be empty.
*/
- ASSERT(lmc->lc_head == 0);
+ ASSERT(lmc->lc_head == NULL);
#endif
alist_delete_by_offset(lml->lm_lists, &_lmco);
}
@@ -506,10 +506,10 @@ remove_incomplete(Lm_list *lml, Aliste lmco)
* effectively the link-map control head gets updated to point to the
* next link-map.
*/
- while ((lmp = lmc->lc_head) != 0)
+ while ((lmp = lmc->lc_head) != NULL)
remove_so(lml, lmp);
- lmc->lc_head = lmc->lc_tail = 0;
+ lmc->lc_head = lmc->lc_tail = NULL;
}
/*
@@ -863,12 +863,12 @@ remove_lmc(Lm_list *lml, Rt_map *clmp, Lm_cntl *lmc, Aliste lmco,
* Establish a handle, and should anything fail, fall through
* to remove the link-map control list.
*/
- if (((ghp =
- hdl_create(lml, lmc->lc_head, 0, 0, GPD_ADDEPS, 0)) == 0) ||
+ if (((ghp = hdl_create(lml, lmc->lc_head, 0, 0,
+ GPD_ADDEPS, 0)) == NULL) ||
(hdl_initialize(ghp, lmc->lc_head, 0, 0) == 0))
lmc->lc_flags &= ~LMC_FLG_RELOCATING;
} else {
- ghp = 0;
+ ghp = NULL;
}
/*
@@ -885,7 +885,7 @@ remove_lmc(Lm_list *lml, Rt_map *clmp, Lm_cntl *lmc, Aliste lmco,
return;
}
- ASSERT(ghp != 0);
+ ASSERT(ghp != NULL);
/*
* As the objects of this handle are being forcibly removed, first
@@ -931,7 +931,7 @@ remove_lmc(Lm_list *lml, Rt_map *clmp, Lm_cntl *lmc, Aliste lmco,
for (ALIST_TRAVERSE(falp, idx2, pdp)) {
if ((Grp_hdl *)pdp->pd_info == ghp) {
- pdp->pd_info = 0;
+ pdp->pd_info = NULL;
break;
}
}
@@ -947,7 +947,7 @@ remove_lmc(Lm_list *lml, Rt_map *clmp, Lm_cntl *lmc, Aliste lmco,
* objects.
*/
ghp->gh_refcnt = 1;
- (void) remove_hdl(ghp, clmp, 0);
+ (void) remove_hdl(ghp, clmp, NULL);
/*
* If this link-map control list still contains objects, determine the
@@ -1103,7 +1103,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
* Establish which link-map list we're dealing with for later
* .fini processing.
*/
- if (lml == 0)
+ if (lml == NULL)
lml = LIST(lmp);
/*
@@ -1205,7 +1205,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
* If this handle is already an orphan, or if it's owner is
* deletable there's no need to inspect its dependencies.
*/
- if ((ghp->gh_ownlmp == 0) ||
+ if ((ghp->gh_ownlmp == NULL) ||
(FLAGS(ghp->gh_ownlmp) & FLG_RT_DELETE))
continue;
@@ -1307,7 +1307,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
lml->lm_flags |= LML_FLG_OBJDELETED;
if (((tobj = tsort(lml->lm_head, delcnt,
- (RT_SORT_DELETE | RT_SORT_FWD))) != 0) &&
+ (RT_SORT_DELETE | RT_SORT_FWD))) != NULL) &&
(tobj != (Rt_map **)S_ERROR)) {
error = purge_exit_handlers(lml, tobj);
call_fini(lml, tobj);
@@ -1450,7 +1450,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
*/
if (ghp->gh_ownlmp == lmp) {
(void) aplist_delete_value(HANDLES(lmp), ghp);
- ghp->gh_ownlmp = 0;
+ ghp->gh_ownlmp = NULL;
}
(void) aplist_delete_value(GROUPS(lmp), ghp);
@@ -1487,7 +1487,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
free(ghp->gh_depends);
free(ghp);
- } else if ((removed == 0) && (ghp->gh_refcnt == 0) &&
+ } else if ((ghp->gh_refcnt == 0) &&
((ghp->gh_flags & GPH_ZERO) == 0)) {
/*
* Move this handle to the orphans list.
@@ -1535,7 +1535,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
do {
APlist *alp;
Aliste idx;
- Grp_hdl *ghp, *oghp = 0;
+ Grp_hdl *ghp, *oghp = NULL;
int title = 0;
/*
@@ -1554,7 +1554,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
if (oghp) {
(void) aplist_delete_value(alp, oghp);
- oghp = 0;
+ oghp = NULL;
}
if (((_error = remove_hdl(ghp, clmp, &_remove)) != 0) &&
@@ -1568,7 +1568,7 @@ remove_hdl(Grp_hdl *ghp, Rt_map *clmp, int *removed)
}
if (oghp) {
(void) aplist_delete_value(alp, oghp);
- oghp = 0;
+ oghp = NULL;
}
if (alp)
free((void *)alp);
diff --git a/usr/src/cmd/sgs/rtld/common/rtld.msg b/usr/src/cmd/sgs/rtld/common/rtld.msg
index 75ba223f91..eba3d4d274 100644
--- a/usr/src/cmd/sgs/rtld/common/rtld.msg
+++ b/usr/src/cmd/sgs/rtld/common/rtld.msg
@@ -52,7 +52,7 @@
@ MSG_ARG_ILLPATH "illegal pathname"
@ MSG_ARG_ILLSYM "illegal symbol name"
@ MSG_ARG_INVADDR "address 0x%llx does not fall within any mapped object"
-@ MSG_ARG_INVHNDL "invalid handle"
+@ MSG_ARG_INVHNDL "invalid handle: 0x%llx"
@ MSG_ARG_ILLVAL "illegal request value"
@ MSG_ARG_NOCONFIG "no configuration file in use"
@ MSG_ARG_NOPROFNAME "no profile target specified"