nlist_private.h revision 1.26
11.26Smaya/* $NetBSD: nlist_private.h,v 1.26 2020/03/30 20:34:11 maya Exp $ */
21.1Scgd
31.1Scgd/*
41.10Scgd * Copyright (c) 1996 Christopher G. Demetriou
51.10Scgd * All rights reserved.
61.10Scgd *
71.1Scgd * Redistribution and use in source and binary forms, with or without
81.1Scgd * modification, are permitted provided that the following conditions
91.1Scgd * are met:
101.1Scgd * 1. Redistributions of source code must retain the above copyright
111.1Scgd *    notice, this list of conditions and the following disclaimer.
121.1Scgd * 2. Redistributions in binary form must reproduce the above copyright
131.1Scgd *    notice, this list of conditions and the following disclaimer in the
141.1Scgd *    documentation and/or other materials provided with the distribution.
151.1Scgd * 3. All advertising materials mentioning features or use of this software
161.1Scgd *    must display the following acknowledgement:
171.10Scgd *          This product includes software developed for the
181.17Ssalo *          NetBSD Project.  See http://www.NetBSD.org/ for
191.10Scgd *          information about NetBSD.
201.1Scgd * 4. The name of the author may not be used to endorse or promote products
211.10Scgd *    derived from this software without specific prior written permission.
221.10Scgd *
231.1Scgd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
241.1Scgd * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
251.1Scgd * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
261.1Scgd * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
271.1Scgd * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
281.1Scgd * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
291.1Scgd * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
301.1Scgd * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
311.1Scgd * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
321.1Scgd * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
331.10Scgd *
341.10Scgd * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
351.1Scgd */
361.1Scgd
371.4Sthorpej#if defined(__alpha__)
381.4Sthorpej#  define	NLIST_ECOFF
391.13Sfvdl#  define	NLIST_ELF64
401.13Sfvdl#elif defined(__x86_64__)
411.4Sthorpej#  define	NLIST_ELF64
421.16Sfvdl#  define	NLIST_ELF32
431.4Sthorpej#elif defined(__mips__)
441.4Sthorpej#  define	NLIST_ECOFF
451.4Sthorpej#  define	NLIST_ELF32
461.21Smatt#  ifndef __mips_o32
471.21Smatt#    define	NLIST_ELF64
481.21Smatt#  endif
491.11Sbjh21#elif defined(__arm__) || defined(__i386__) || defined (__m68k__) || \
501.12Smatt    defined(__powerpc__) || defined(__vax__)
511.4Sthorpej#  define	NLIST_AOUT
521.4Sthorpej#  define	NLIST_ELF32
531.6Sthorpej#elif defined(__sparc__)
541.6Sthorpej#  define	NLIST_AOUT
551.15Sscw#  define	NLIST_ELF32
561.15Sscw#  define	NLIST_ELF64
571.7Smsaitoh#elif defined(__sh__)
581.7Smsaitoh#  define	NLIST_COFF
591.14Sfredette#  define	NLIST_ELF32
601.14Sfredette#elif defined(__hppa__)
611.7Smsaitoh#  define	NLIST_ELF32
621.23Sdennis#elif defined(__riscv__)
631.23Sdennis#  define	NLIST_ELF32
641.23Sdennis#  ifdef __riscv64
651.23Sdennis#    define	NLIST_ELF64
661.23Sdennis#  endif
671.23Sdennis#elif defined(__aarch64__)
681.23Sdennis#  define	NLIST_ELF64
691.24Schristos#elif defined(__ia64__)
701.24Schristos#  define	NLIST_ELF64
711.25Schristos#elif defined(__or1k__)
721.25Schristos#  define	NLIST_ELF32
731.2Scgd#else
741.26Smaya#  error	"Add your architecture here"
751.2Scgd#endif
761.1Scgd
771.19She#define	ISLAST(p)	(N_NAME(p) == 0 || N_NAME(p)[0] == 0)
781.19She
791.19Shestruct nlist;
801.1Scgd
811.1Scgd#ifdef NLIST_AOUT
821.22Smattint	__fdnlist_aout(int, struct nlist *);
831.7Smsaitoh#endif
841.7Smsaitoh#ifdef NLIST_COFF
851.22Smattint	__fdnlist_coff(int, struct nlist *);
861.1Scgd#endif
871.1Scgd#ifdef NLIST_ECOFF
881.22Smattint	__fdnlist_ecoff(int, struct nlist *);
891.1Scgd#endif
901.1Scgd#ifdef NLIST_ELF32
911.22Smattint	__fdnlist_elf32(int, struct nlist *);
921.1Scgd#endif
931.1Scgd#ifdef NLIST_ELF64
941.22Smattint	__fdnlist_elf64(int, struct nlist *);
951.1Scgd#endif
96