1 .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
31 .Nd retrieve the symbol table of an archive
37 .Fn elf_getarsym "Elf *elf" "size_t *ptr"
41 retrieves the symbol table for an
43 archive, if one is available.
47 should be a descriptor for an
56 contains a symbol table with n entries, this function returns a
57 pointer to an array of n+1
62 structure has the following elements:
63 .Bl -tag -width indent -compact
64 .It Vt "char *" Va as_name
65 This structure member is a pointer to a null-terminated symbol name.
66 .It Vt "off_t" Va as_off
67 This structure member contains the byte offset from the beginning of the archive to
68 the header for the archive member.
69 This value is suitable for use with
71 .It Vt "unsigned long" Va as_hash
72 This structure member contains a portable hash value for the symbol
77 The last entry of the returned array will have a NULL value for member
79 a zero value for member
81 and an illegal value of ~0UL for
88 function will store the number of table entries returned (including the
89 sentinel entry at the end) into the location it points to.
93 returns a pointer to an array of
95 structures if successful, or a NULL
96 pointer if an error was encountered.
100 is non-null and there was no error, the library will store the
101 number of archive symbol entries returned into the location it
105 is non-null and an error was encountered, the library will
106 set the location pointed to by it to zero.
110 may fail with the following errors:
111 .Bl -tag -width "[ELF_E_RESOURCE]"
112 .It Bq Er ELF_E_ARGUMENT
116 .It Bq Er ELF_E_ARGUMENT
119 was not a descriptor for an