/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1997-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*/
#ifndef _GNU_SOURCE
#endif
#ifndef __EXTENSIONS__
#endif
#include <ast.h>
#include <dlldefs.h>
#include <rld_interface.h>
#endif
/*
* return a handle for the next layer down,
* i.e., the next layer that has symbols covered
* by the main prog and dll's loaded so far
*
* intentionally light on external lib calls
* so this routine can be used early in process
* startup
*/
#ifdef _DLL_RLD_SYM
#if DEBUG
#endif
void*
{
register char* vp;
register void* lp;
register int found = 0;
char* s;
char* b;
char* e;
#if DEBUG
#endif
#if DEBUG
{
do
{
{
}
}
#endif
{
do
{
{
if (found)
{
b = e = 0;
s = vp;
for (;;)
{
switch (*s++)
{
case 0:
break;
case '/':
b = s;
e = 0;
continue;
case '.':
if (!e)
e = s - 1;
continue;
default:
continue;
}
break;
}
if (b && e)
{
s = dummy;
*s++ = '_';
*s++ = '_';
while (b < e)
*s++ = *b++;
b = "_dummy";
while (*s++ = *b++);
{
lp = 0;
}
}
if (lp)
{
#if DEBUG
if (wr)
#endif
return lp;
}
#if DEBUG
else if (wr)
#endif
}
{
#if DEBUG
if (wr)
#endif
found = 1;
}
}
}
}
#endif
#ifndef RTLD_NEXT
#if _dll_DYNAMIC
#include <link.h>
extern struct link_dynamic _DYNAMIC;
#endif
#endif
void*
{
register void* dll;
#ifndef RTLD_NEXT
#if _dll_DYNAMIC
register char* s;
register char* b;
#endif
register char* ver;
char* path;
#endif
#ifdef RTLD_NEXT
#else
#if _dll_DYNAMIC
{
b = 0;
while (*s)
if (*s++ == '/')
b = s;
if (b && b[0] == 'l' && b[1] == 'i' && b[2] == 'b' && b[3] == 'c' && b[4] == '.')
{
break;
}
}
#endif
{
do
{
return 0;
} while (*--ver != '.');
return 0;
*ver = 0;
}
#endif
return dll;
}