strptr.c revision 7257d1b4d25bfac0c802847390e98a464fd787ac
/*
* 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
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "libelf.h"
#include "decl.h"
#include "msg.h"
char *
{
Elf_Scn *s;
Elf_Data *d;
char *rc;
if (elf == 0)
return (0);
_elf_seterr(EREQ_STRSCN, 0);
return (0);
}
_elf_seterr(EREQ_STRSCN, 0);
READUNLOCKS(elf, s)
return (0);
}
_elf_seterr(EREQ_STRSCN, 0);
READUNLOCKS(elf, s)
return (0);
}
} else {
_elf_seterr(EREQ_STRSCN, 0);
READUNLOCKS(elf, s)
return (0);
}
/*
* If the layout bit is set, use the offsets and
* sizes in the data buffers. Otherwise, take
* data buffers in order.
*/
d = 0;
while ((d = _elf_locked_getdata(s, d)) != 0) {
if (d->d_buf == 0)
continue;
READUNLOCKS(elf, s)
return (rc);
}
}
} else {
while ((d = _elf_locked_getdata(s, d)) != 0) {
j -= sz % j;
sz += j;
if (off < j)
break;
off -= j;
}
if (d->d_buf != 0) {
READUNLOCKS(elf, s)
return (rc);
}
}
break;
}
}
_elf_seterr(EREQ_STROFF, 0);
READUNLOCKS(elf, s)
return (0);
}