1*0a6a1f1dSLionel Sambuc.\" $NetBSD: elf_getshdrstrndx.3,v 1.2 2014/03/09 16:58:04 christos Exp $ 2*0a6a1f1dSLionel Sambuc.\" 3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. 4*0a6a1f1dSLionel Sambuc.\" 5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions 7*0a6a1f1dSLionel Sambuc.\" are met: 8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 9*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 11*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 12*0a6a1f1dSLionel Sambuc.\" documentation and/or other materials provided with the distribution. 13*0a6a1f1dSLionel Sambuc.\" 14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and 15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the 16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose 17*0a6a1f1dSLionel Sambuc.\" are disclaimed. in no event shall Joseph Koshy be liable 18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential 19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods 20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption) 21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict 22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way 23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of 24*0a6a1f1dSLionel Sambuc.\" such damage. 25*0a6a1f1dSLionel Sambuc.\" 26*0a6a1f1dSLionel Sambuc.\" Id: elf_getshdrstrndx.3 467 2009-08-05 18:18:49Z jkoshy 27*0a6a1f1dSLionel Sambuc.\" 28*0a6a1f1dSLionel Sambuc.Dd August 5, 2009 29*0a6a1f1dSLionel Sambuc.Os 30*0a6a1f1dSLionel Sambuc.Dt ELF_GETSHDRSTRNDX 3 31*0a6a1f1dSLionel Sambuc.Sh NAME 32*0a6a1f1dSLionel Sambuc.Nm elf_getshdrstrndx 33*0a6a1f1dSLionel Sambuc.Nd retrieve the index of the section name string table 34*0a6a1f1dSLionel Sambuc.Sh LIBRARY 35*0a6a1f1dSLionel Sambuc.Lb libelf 36*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS 37*0a6a1f1dSLionel Sambuc.In libelf.h 38*0a6a1f1dSLionel Sambuc.Ft int 39*0a6a1f1dSLionel Sambuc.Fn elf_getshdrstrndx "Elf *elf" "size_t *ndxptr" 40*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION 41*0a6a1f1dSLionel SambucFunction 42*0a6a1f1dSLionel Sambuc.Fn elf_getshdrstrndx 43*0a6a1f1dSLionel Sambucretrieves the section index of the string table containing section 44*0a6a1f1dSLionel Sambucnames from descriptor 45*0a6a1f1dSLionel Sambuc.Ar elf 46*0a6a1f1dSLionel Sambucand stores it into the location pointed to by argument 47*0a6a1f1dSLionel Sambuc.Ar ndxptr . 48*0a6a1f1dSLionel Sambuc.Pp 49*0a6a1f1dSLionel SambucThis function allow applications to process both normal ELF 50*0a6a1f1dSLionel Sambucobjects and ELF objects that use extended section numbering uniformly. 51*0a6a1f1dSLionel Sambuc.Pp 52*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES 53*0a6a1f1dSLionel SambucThese functions return zero if successful, or -1 in case of an error. 54*0a6a1f1dSLionel Sambuc.Sh ERRORS 55*0a6a1f1dSLionel SambucThese functions can fail with the following errors: 56*0a6a1f1dSLionel Sambuc.Bl -tag -width "[ELF_E_RESOURCE]" 57*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 58*0a6a1f1dSLionel SambucA NULL value was passed in for argument 59*0a6a1f1dSLionel Sambuc.Ar elf . 60*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 61*0a6a1f1dSLionel SambucArgument 62*0a6a1f1dSLionel Sambuc.Ar elf 63*0a6a1f1dSLionel Sambucwas not for an ELF file. 64*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 65*0a6a1f1dSLionel SambucArgument 66*0a6a1f1dSLionel Sambuc.Ar elf 67*0a6a1f1dSLionel Sambuclacks an ELF Executable header. 68*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 69*0a6a1f1dSLionel SambucArgument 70*0a6a1f1dSLionel Sambuc.Ar ndx 71*0a6a1f1dSLionel Sambuccontained a value in the reserved range of section indices. 72*0a6a1f1dSLionel Sambuc.El 73*0a6a1f1dSLionel Sambuc.Sh SEE ALSO 74*0a6a1f1dSLionel Sambuc.Xr elf 3 , 75*0a6a1f1dSLionel Sambuc.Xr elf32_getehdr 3 , 76*0a6a1f1dSLionel Sambuc.Xr elf64_getehdr 3 , 77*0a6a1f1dSLionel Sambuc.Xr elf_getident 3 , 78*0a6a1f1dSLionel Sambuc.Xr elf_getphdrnum 3 , 79*0a6a1f1dSLionel Sambuc.Xr elf_getshdrnum 3 , 80*0a6a1f1dSLionel Sambuc.Xr gelf 3 , 81*0a6a1f1dSLionel Sambuc.Xr gelf_getehdr 3 82