head 1.23; access; symbols netbsd-10-0-RELEASE:1.23 netbsd-10-0-RC6:1.23 netbsd-10-0-RC5:1.23 netbsd-10-0-RC4:1.23 netbsd-10-0-RC3:1.23 netbsd-10-0-RC2:1.23 netbsd-10-0-RC1:1.23 netbsd-10:1.23.0.26 netbsd-10-base:1.23 netbsd-9-3-RELEASE:1.23 cjep_sun2x-base1:1.23 cjep_sun2x:1.23.0.24 cjep_sun2x-base:1.23 cjep_staticlib_x-base1:1.23 netbsd-9-2-RELEASE:1.23 cjep_staticlib_x:1.23.0.22 cjep_staticlib_x-base:1.23 netbsd-9-1-RELEASE:1.23 phil-wifi-20200421:1.23 phil-wifi-20200411:1.23 is-mlppp:1.23.0.20 is-mlppp-base:1.23 phil-wifi-20200406:1.23 netbsd-8-2-RELEASE:1.23 netbsd-9-0-RELEASE:1.23 netbsd-9-0-RC2:1.23 netbsd-9-0-RC1:1.23 phil-wifi-20191119:1.23 netbsd-9:1.23.0.18 netbsd-9-base:1.23 phil-wifi-20190609:1.23 netbsd-8-1-RELEASE:1.23 netbsd-8-1-RC1:1.23 pgoyette-compat-merge-20190127:1.23 pgoyette-compat-20190127:1.23 pgoyette-compat-20190118:1.23 pgoyette-compat-1226:1.23 pgoyette-compat-1126:1.23 pgoyette-compat-1020:1.23 pgoyette-compat-0930:1.23 pgoyette-compat-0906:1.23 netbsd-7-2-RELEASE:1.21 pgoyette-compat-0728:1.23 netbsd-8-0-RELEASE:1.23 phil-wifi:1.23.0.16 phil-wifi-base:1.23 pgoyette-compat-0625:1.23 netbsd-8-0-RC2:1.23 pgoyette-compat-0521:1.23 pgoyette-compat-0502:1.23 pgoyette-compat-0422:1.23 netbsd-8-0-RC1:1.23 pgoyette-compat-0415:1.23 pgoyette-compat-0407:1.23 pgoyette-compat-0330:1.23 pgoyette-compat-0322:1.23 pgoyette-compat-0315:1.23 netbsd-7-1-2-RELEASE:1.21 pgoyette-compat:1.23.0.14 pgoyette-compat-base:1.23 netbsd-7-1-1-RELEASE:1.21 matt-nb8-mediatek:1.23.0.12 matt-nb8-mediatek-base:1.23 perseant-stdc-iso10646:1.23.0.10 perseant-stdc-iso10646-base:1.23 netbsd-8:1.23.0.8 netbsd-8-base:1.23 prg-localcount2-base3:1.23 prg-localcount2-base2:1.23 prg-localcount2-base1:1.23 prg-localcount2:1.23.0.6 prg-localcount2-base:1.23 pgoyette-localcount-20170426:1.23 bouyer-socketcan-base1:1.23 pgoyette-localcount-20170320:1.23 netbsd-7-1:1.21.0.52 netbsd-7-1-RELEASE:1.21 netbsd-7-1-RC2:1.21 netbsd-7-nhusb-base-20170116:1.21 bouyer-socketcan:1.23.0.4 bouyer-socketcan-base:1.23 pgoyette-localcount-20170107:1.23 netbsd-7-1-RC1:1.21 pgoyette-localcount-20161104:1.23 netbsd-7-0-2-RELEASE:1.21 localcount-20160914:1.23 netbsd-7-nhusb:1.21.0.50 netbsd-7-nhusb-base:1.21 pgoyette-localcount-20160806:1.23 pgoyette-localcount-20160726:1.23 pgoyette-localcount:1.23.0.2 pgoyette-localcount-base:1.23 netbsd-7-0-1-RELEASE:1.21 netbsd-7-0:1.21.0.48 netbsd-7-0-RELEASE:1.21 netbsd-7-0-RC3:1.21 netbsd-7-0-RC2:1.21 netbsd-7-0-RC1:1.21 netbsd-5-2-3-RELEASE:1.21 netbsd-5-1-5-RELEASE:1.21 netbsd-6-0-6-RELEASE:1.21 netbsd-6-1-5-RELEASE:1.21 netbsd-7:1.21.0.46 netbsd-7-base:1.21 yamt-pagecache-base9:1.21 yamt-pagecache-tag8:1.21 netbsd-6-1-4-RELEASE:1.21 netbsd-6-0-5-RELEASE:1.21 tls-earlyentropy:1.21.0.44 tls-earlyentropy-base:1.21 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.21 riastradh-drm2-base3:1.21 netbsd-6-1-3-RELEASE:1.21 netbsd-6-0-4-RELEASE:1.21 netbsd-5-2-2-RELEASE:1.21 netbsd-5-1-4-RELEASE:1.21 netbsd-6-1-2-RELEASE:1.21 netbsd-6-0-3-RELEASE:1.21 netbsd-5-2-1-RELEASE:1.21 netbsd-5-1-3-RELEASE:1.21 netbsd-6-1-1-RELEASE:1.21 riastradh-drm2-base2:1.21 riastradh-drm2-base1:1.21 riastradh-drm2:1.21.0.38 riastradh-drm2-base:1.21 netbsd-6-1:1.21.0.42 netbsd-6-0-2-RELEASE:1.21 netbsd-6-1-RELEASE:1.21 netbsd-6-1-RC4:1.21 netbsd-6-1-RC3:1.21 agc-symver:1.21.0.40 agc-symver-base:1.21 netbsd-6-1-RC2:1.21 netbsd-6-1-RC1:1.21 yamt-pagecache-base8:1.21 netbsd-5-2:1.21.0.36 netbsd-6-0-1-RELEASE:1.21 yamt-pagecache-base7:1.21 netbsd-5-2-RELEASE:1.21 netbsd-5-2-RC1:1.21 matt-nb6-plus-nbase:1.21 yamt-pagecache-base6:1.21 netbsd-6-0:1.21.0.34 netbsd-6-0-RELEASE:1.21 netbsd-6-0-RC2:1.21 tls-maxphys:1.21.0.32 tls-maxphys-base:1.21 matt-nb6-plus:1.21.0.30 matt-nb6-plus-base:1.21 netbsd-6-0-RC1:1.21 yamt-pagecache-base5:1.21 yamt-pagecache-base4:1.21 netbsd-6:1.21.0.28 netbsd-6-base:1.21 netbsd-5-1-2-RELEASE:1.21 netbsd-5-1-1-RELEASE:1.21 yamt-pagecache-base3:1.21 yamt-pagecache-base2:1.21 yamt-pagecache:1.21.0.6 yamt-pagecache-base:1.21 cherry-xenmp:1.21.0.26 cherry-xenmp-base:1.21 uebayasi-xip-base7:1.21 bouyer-quota2-nbase:1.21 bouyer-quota2:1.21.0.24 bouyer-quota2-base:1.21 matt-mips64-premerge-20101231:1.21 matt-nb5-mips64-premerge-20101231:1.21 matt-nb5-pq3:1.21.0.22 matt-nb5-pq3-base:1.21 netbsd-5-1:1.21.0.20 uebayasi-xip-base6:1.21 uebayasi-xip-base5:1.21 netbsd-5-1-RELEASE:1.21 uebayasi-xip-base4:1.21 uebayasi-xip-base3:1.21 netbsd-5-1-RC4:1.21 matt-nb5-mips64-k15:1.21 uebayasi-xip-base2:1.21 netbsd-5-1-RC3:1.21 netbsd-5-1-RC2:1.21 uebayasi-xip-base1:1.21 netbsd-5-1-RC1:1.21 uebayasi-xip:1.21.0.18 uebayasi-xip-base:1.21 netbsd-5-0-2-RELEASE:1.21 matt-nb5-mips64-premerge-20091211:1.21 matt-premerge-20091211:1.21 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.21 matt-nb4-mips64-k7-u2a-k9b:1.21 matt-nb5-mips64-u1-k1-k5:1.21 matt-nb5-mips64:1.21.0.16 netbsd-5-0-1-RELEASE:1.21 jym-xensuspend-nbase:1.21 netbsd-5-0:1.21.0.14 netbsd-5-0-RELEASE:1.21 netbsd-5-0-RC4:1.21 netbsd-5-0-RC3:1.21 netbsd-5-0-RC2:1.21 jym-xensuspend:1.21.0.12 jym-xensuspend-base:1.21 netbsd-5-0-RC1:1.21 christos-time_t-nbase:1.21 christos-time_t:1.21.0.10 christos-time_t-base:1.21 netbsd-5:1.21.0.8 netbsd-5-base:1.21 matt-mips64-base2:1.21 matt-mips64:1.20.0.26 netbsd-4-0-1-RELEASE:1.20 wrstuden-revivesa-base-3:1.21 wrstuden-revivesa-base-2:1.21 wrstuden-fixsa-newbase:1.20 wrstuden-revivesa-base-1:1.21 simonb-wapbl-nbase:1.21 yamt-pf42-base4:1.21 simonb-wapbl:1.21.0.4 simonb-wapbl-base:1.21 yamt-pf42-base3:1.21 hpcarm-cleanup-nbase:1.21 yamt-pf42-baseX:1.20 yamt-pf42-base2:1.21 wrstuden-revivesa:1.21.0.2 wrstuden-revivesa-base:1.21 yamt-pf42:1.20.0.24 yamt-pf42-base:1.20 keiichi-mipv6:1.20.0.22 keiichi-mipv6-base:1.20 matt-armv6-nbase:1.20 matt-armv6-prevmlocking:1.20 wrstuden-fixsa-base-1:1.20 netbsd-4-0:1.20.0.20 netbsd-4-0-RELEASE:1.20 cube-autoconf:1.20.0.18 cube-autoconf-base:1.20 netbsd-4-0-RC5:1.20 netbsd-4-0-RC4:1.20 netbsd-4-0-RC3:1.20 netbsd-4-0-RC2:1.20 netbsd-4-0-RC1:1.20 matt-armv6:1.20.0.16 matt-armv6-base:1.20 matt-mips64-base:1.20 hpcarm-cleanup:1.20.0.14 hpcarm-cleanup-base:1.20 netbsd-3-1-1-RELEASE:1.20 netbsd-3-0-3-RELEASE:1.20 wrstuden-fixsa:1.20.0.12 wrstuden-fixsa-base:1.20 abandoned-netbsd-4-base:1.20 abandoned-netbsd-4:1.20.0.6 netbsd-3-1:1.20.0.8 netbsd-3-1-RELEASE:1.20 netbsd-3-0-2-RELEASE:1.20 netbsd-3-1-RC4:1.20 netbsd-3-1-RC3:1.20 netbsd-3-1-RC2:1.20 netbsd-3-1-RC1:1.20 netbsd-4:1.20.0.10 netbsd-4-base:1.20 netbsd-3-0-1-RELEASE:1.20 netbsd-3-0:1.20.0.4 netbsd-3-0-RELEASE:1.20 netbsd-3-0-RC6:1.20 netbsd-3-0-RC5:1.20 netbsd-3-0-RC4:1.20 netbsd-3-0-RC3:1.20 netbsd-3-0-RC2:1.20 netbsd-3-0-RC1:1.20 netbsd-2-0-3-RELEASE:1.19 netbsd-2-1:1.19.0.10 netbsd-2-1-RELEASE:1.19 netbsd-2-1-RC6:1.19 netbsd-2-1-RC5:1.19 netbsd-2-1-RC4:1.19 netbsd-2-1-RC3:1.19 netbsd-2-1-RC2:1.19 netbsd-2-1-RC1:1.19 netbsd-2-0-2-RELEASE:1.19 netbsd-3:1.20.0.2 netbsd-3-base:1.20 netbsd-2-0-1-RELEASE:1.19 netbsd-2:1.19.0.8 netbsd-2-base:1.19 netbsd-2-0-RELEASE:1.19 netbsd-2-0-RC5:1.19 netbsd-2-0-RC4:1.19 netbsd-2-0-RC3:1.19 netbsd-2-0-RC2:1.19 netbsd-2-0-RC1:1.19 netbsd-2-0:1.19.0.6 netbsd-2-0-base:1.19 netbsd-1-6-PATCH002-RELEASE:1.19 netbsd-1-6-PATCH002:1.19 netbsd-1-6-PATCH002-RC4:1.19 netbsd-1-6-PATCH002-RC3:1.19 netbsd-1-6-PATCH002-RC2:1.19 netbsd-1-6-PATCH002-RC1:1.19 netbsd-1-6-PATCH001:1.19 netbsd-1-6-PATCH001-RELEASE:1.19 netbsd-1-6-PATCH001-RC3:1.19 netbsd-1-6-PATCH001-RC2:1.19 netbsd-1-6-PATCH001-RC1:1.19 nathanw_sa_before_merge:1.19 nathanw_sa_end:1.19 fvdl_fs64_base:1.19 nathanw_sa_base:1.19 netbsd-1-6-RELEASE:1.19 netbsd-1-6-RC3:1.19 netbsd-1-6-RC2:1.19 netbsd-1-6-RC1:1.19 netbsd-1-6:1.19.0.4 netbsd-1-6-base:1.19 netbsd-1-5-PATCH003:1.18 netbsd-1-5-PATCH002:1.18 netbsd-1-5-PATCH001:1.18 nathanw_sa:1.19.0.2 netbsd-1-5-RELEASE:1.18 netbsd-1-5-BETA2:1.18 netbsd-1-5-BETA:1.18 netbsd-1-4-PATCH003:1.17 netbsd-1-5-ALPHA2:1.18 netbsd-1-5:1.18.0.4 netbsd-1-5-base:1.18 minoura-xpg4dl:1.18.0.2 minoura-xpg4dl-base:1.18 netbsd-1-4-PATCH002:1.17 wrstuden-devbsize-19991221:1.17 wrstuden-devbsize:1.17.0.6 wrstuden-devbsize-base:1.17 comdex-fall-1999:1.17.0.4 comdex-fall-1999-base:1.17 netbsd-1-4-PATCH001:1.17 netbsd-1-4-RELEASE:1.17 netbsd-1-4:1.17.0.2 netbsd-1-4-base:1.17; locks; strict; comment @ * @; 1.23 date 2016.01.23.01.26.14; author dholland; state Exp; branches; next 1.22; commitid 9xSS2WoZiHBEIZRy; 1.22 date 2016.01.22.21.55.57; author dholland; state Exp; branches; next 1.21; commitid gmgL9GRserDJyYRy; 1.21 date 2008.04.28.20.22.54; author martin; state Exp; branches 1.21.10.1; next 1.20; 1.20 date 2005.02.03.04.39.32; author perry; state Exp; branches 1.20.24.1; next 1.19; 1.19 date 2000.09.14.20.36.39; author wiz; state Exp; branches; next 1.18; 1.18 date 2000.02.09.22.41.53; author kristerw; state Exp; branches; next 1.17; 1.17 date 99.03.19.22.06.36; author thorpej; state Exp; branches; next 1.16; 1.16 date 98.12.15.21.28.28; author pk; state Exp; branches; next 1.15; 1.15 date 98.10.19.00.30.57; author matt; state Exp; branches; next 1.14; 1.14 date 98.09.05.13.08.41; author pk; state Exp; branches; next 1.13; 1.13 date 98.05.14.01.55.28; author thorpej; state Exp; branches; next 1.12; 1.12 date 98.05.12.21.21.21; author pk; state Exp; branches; next 1.11; 1.11 date 97.01.03.22.39.03; author scottr; state Exp; branches; next 1.10; 1.10 date 96.01.09.00.00.11; author pk; state Exp; branches; next 1.9; 1.9 date 95.09.23.22.26.15; author pk; state Exp; branches 1.9.2.1; next 1.8; 1.8 date 95.06.05.00.08.13; author pk; state Exp; branches; next 1.7; 1.7 date 95.06.04.21.57.18; author pk; state Exp; branches; next 1.6; 1.6 date 94.12.23.20.16.59; author pk; state Exp; branches; next 1.5; 1.5 date 94.10.26.00.56.01; author cgd; state Exp; branches; next 1.4; 1.4 date 94.05.24.10.47.48; author pk; state Exp; branches; next 1.3; 1.3 date 94.01.28.20.26.52; author pk; state Exp; branches; next 1.2; 1.2 date 93.10.22.21.04.19; author pk; state Exp; branches; next 1.1; 1.1 date 93.10.17.00.51.31; author pk; state Exp; branches; next ; 1.21.10.1 date 2008.04.28.20.22.54; author martin; state dead; branches; next 1.21.10.2; 1.21.10.2 date 2008.04.28.20.22.55; author martin; state Exp; branches; next ; 1.20.24.1 date 2008.05.18.12.30.09; author yamt; state Exp; branches; next ; 1.9.2.1 date 96.02.16.23.08.03; author pk; state Exp; branches; next ; desc @@ 1.23 log @Apparently a recent round of vandalism by the C++ standards committee includes disallowing the standard and historic type name "unsigned". Add a gratuitous "int" to recent changes. C++ is really a blight on the world. @ text @/* $NetBSD: link_aout.h,v 1.22 2016/01/22 21:55:57 dholland Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Paul Kranenburg. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * RRS section definitions. * * The layout of some data structures defined in this header file is * such that we can provide compatibility with the SunOS 4.x shared * library scheme. */ #ifndef _LINK_AOUT_H_ #define _LINK_AOUT_H_ #include /* for Dl_info */ #include /* for struct nlist */ /* * A `Shared Object Descriptor' describes a shared object that is needed * to complete the link edit process of the object containing it. * A list of such objects (chained through `sod_next') is pointed at * by `sdt_sods' in the section_dispatch_table structure. */ struct sod { /* Shared Object Descriptor */ long sod_name; /* name (relative to load address) */ unsigned int sod_library : 1, /* Searched for by library rules */ sod_reserved : 31; short sod_major; /* major version number */ short sod_minor; /* minor version number */ long sod_next; /* next sod */ }; /* * `Shared Object Map's are used by the run-time link editor (ld.so) to * keep track of all shared objects loaded into a process' address space. * These structures are only used at run-time and do not occur within * the text or data segment of an executable or shared library. */ struct so_map { /* Shared Object Map */ caddr_t som_addr; /* Address at which object mapped */ char *som_path; /* Path to mmap'ed file */ struct so_map *som_next; /* Next map in chain */ struct sod *som_sod; /* Sod responsible for this map */ caddr_t som_sodbase; /* Base address of this sod */ unsigned int som_write : 1; /* Text is currently writable */ struct _dynamic *som_dynamic; /* _dynamic structure */ caddr_t som_spd; /* Private data */ }; /* * Symbol description with size. This is simply an `nlist' with * one field (nz_size) added. * Used to convey size information on items in the data segment * of shared objects. An array of these live in the shared object's * text segment and is addressed by the `sdt_nzlist' field. */ struct nzlist { struct nlist nlist; unsigned long nz_size; #define nz_un nlist.n_un #define nz_strx nlist.n_un.n_strx #define nz_name nlist.n_un.n_name #define nz_type nlist.n_type #define nz_value nlist.n_value #define nz_desc nlist.n_desc #define nz_other nlist.n_other }; #define N_AUX(p) ((p)->n_other & 0xf) #define N_BIND(p) (((unsigned int)(p)->n_other >> 4) & 0xf) #define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf)) #define AUX_OBJECT 1 #define AUX_FUNC 2 #define AUX_LABEL 3 /*#define BIND_LOCAL 0 not used */ /*#define BIND_GLOBAL 1 not used */ #define BIND_WEAK 2 /* * The `section_dispatch_table' structure contains offsets to various data * structures needed to do run-time relocation. */ struct section_dispatch_table { struct so_map *sdt_loaded; /* List of loaded objects */ long sdt_sods; /* List of shared objects descriptors */ long sdt_paths; /* Library search paths */ long sdt_got; /* Global offset table */ long sdt_plt; /* Procedure linkage table */ long sdt_rel; /* Relocation table */ long sdt_hash; /* Symbol hash table */ long sdt_nzlist; /* Symbol table itself */ long sdt_filler2; /* Unused (was: stab_hash) */ long sdt_buckets; /* Number of hash buckets */ long sdt_strings; /* Symbol strings */ long sdt_str_sz; /* Size of symbol strings */ long sdt_text_sz; /* Size of text area */ long sdt_plt_sz; /* Size of procedure linkage table */ }; /* * RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table. * Used to quickly lookup symbols of the shared object by hashing * on the symbol's name. `rh_symbolnum' is the index of the symbol * in the shared object's symbol list (`sdt_nzlist'), `rh_next' is * the next symbol in the hash bucket (in case of collisions). */ struct rrs_hash { int rh_symbolnum; /* Symbol number */ int rh_next; /* Next hash entry */ }; /* * `rt_symbols' is used to keep track of run-time allocated commons * and data items copied from shared objects. */ struct rt_symbol { struct nzlist *rt_sp; /* The symbol */ struct rt_symbol *rt_next; /* Next in linear list */ struct rt_symbol *rt_link; /* Next in bucket */ caddr_t rt_srcaddr; /* Address of "master" copy */ struct so_map *rt_smp; /* Originating map */ }; /* * Debugger interface structure. */ struct so_debug { int dd_version; /* Version # of interface */ int dd_in_debugger; /* Set when run by debugger */ int dd_sym_loaded; /* Run-time linking brought more symbols into scope */ char *dd_bpt_addr; /* Address of rtld-generated bpt */ int dd_bpt_shadow; /* Original contents of bpt */ struct rt_symbol *dd_cc; /* Allocated commons/copied data */ }; /* * Entry points into ld.so - user interface to the run-time linker. */ struct ld_entry { void *(*dlopen)(const char *, int); int (*dlclose)(void *); void *(*dlsym)(void *, const char *); int (*dlctl)(void *, int, void *); void (*dlexit)(void); int (*dladdr)(const void *, Dl_info *); void (*dlrsrvd[2])(void); }; /* * This is the structure pointed at by the __DYNAMIC symbol if an * executable requires the attention of the run-time link editor. * __DYNAMIC is given the value zero if no run-time linking needs to * be done (it is always present in shared objects). * The union `d_un' provides for different versions of the dynamic * linking mechanism (switched on by `d_version'). The last version * used by Sun is 3. We leave some room here and go to version number * 8 for NetBSD, the main difference lying in the support for the * `nz_list' type of symbols. */ struct _dynamic { int d_version; /* version # of this interface */ struct so_debug *d_debug; union { struct section_dispatch_table *d_sdt; } d_un; struct ld_entry *d_entry; /* compat - now in crt_ldso */ }; #define LD_VERSION_SUN (3) #define LD_VERSION_BSD (8) #define LD_VERSION_NZLIST_P(v) ((v) >= 8) #define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got) #define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt) #define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel) #define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist) #define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash) #define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings) #define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods) #define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets) #define LD_PATHS(x) ((x)->d_un.d_sdt->sdt_paths) #define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got) #define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel) #define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash) #define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist) #define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz) #define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz) #define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz) /* * Interface to ld.so */ struct crt_ldso { int crt_ba; /* Base address of ld.so */ int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */ int crt_ldfd; /* ld.so file descriptor */ struct _dynamic *crt_dp; /* Main's __DYNAMIC */ char **crt_ep; /* environment strings */ caddr_t crt_bp; /* Breakpoint if run from debugger */ char *crt_prog; /* Program name (v3) */ char *crt_ldso; /* Link editor name (v4) */ struct ld_entry *crt_ldentry; /* dl*() access (v4) */ }; /* * Version passed from crt0 to ld.so (1st argument to _rtld()). */ #define CRT_VERSION_SUN 1 #define CRT_VERSION_BSD_2 2 #define CRT_VERSION_BSD_3 3 #define CRT_VERSION_BSD_4 4 /* * Maximum number of recognized shared object version numbers. */ #define MAXDEWEY 8 /* * Header of the hints file. */ struct hints_header { long hh_magic; #define HH_MAGIC 011421044151 long hh_version; /* Interface version number */ #define LD_HINTS_VERSION_1 1 #define LD_HINTS_VERSION_2 2 long hh_hashtab; /* Location of hash table */ long hh_nbucket; /* Number of buckets in hashtab */ long hh_strtab; /* Location of strings */ long hh_strtab_sz; /* Size of strings */ long hh_ehints; /* End of hints (max offset in file) */ long hh_dirlist; /* Colon-separated list of srch dirs */ }; #define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC) /* * Hash table element in hints file. */ struct hints_bucket { /* namex and pathx are indices into the string table */ int hi_namex; /* Library name */ int hi_pathx; /* Full path */ int hi_dewey[MAXDEWEY]; /* The versions */ int hi_ndewey; /* Number of version numbers */ #define hi_major hi_dewey[0] #define hi_minor hi_dewey[1] int hi_next; /* Next in this bucket */ }; #define _PATH_LD_HINTS "/var/run/ld.so.hints" #endif /* _LINK_AOUT_H_ */ @ 1.22 log @u_char, u_int, u_long -> unsigned char, unsigned, unsigned long This makes these headers work without _NETBSD_SOURCE. @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.21 2008/04/28 20:22:54 martin Exp $ */ d55 1 a55 1 unsigned sod_library : 1, /* Searched for by library rules */ d74 1 a74 1 unsigned som_write : 1; /* Text is currently writable */ @ 1.21 log @Remove clause 3 and 4 from TNF licenses @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.20 2005/02/03 04:39:32 perry Exp $ */ d55 1 a55 1 u_int sod_library : 1, /* Searched for by library rules */ d74 1 a74 1 u_int som_write : 1; /* Text is currently writable */ d88 1 a88 1 u_long nz_size; @ 1.21.10.1 log @file link_aout.h was added on branch christos-time_t on 2008-04-28 20:22:55 +0000 @ text @d1 288 @ 1.21.10.2 log @Remove clause 3 and 4 from TNF licenses @ text @a0 288 /* $NetBSD: link_aout.h,v 1.21 2008/04/28 20:22:54 martin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Paul Kranenburg. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * RRS section definitions. * * The layout of some data structures defined in this header file is * such that we can provide compatibility with the SunOS 4.x shared * library scheme. */ #ifndef _LINK_AOUT_H_ #define _LINK_AOUT_H_ #include /* for Dl_info */ #include /* for struct nlist */ /* * A `Shared Object Descriptor' describes a shared object that is needed * to complete the link edit process of the object containing it. * A list of such objects (chained through `sod_next') is pointed at * by `sdt_sods' in the section_dispatch_table structure. */ struct sod { /* Shared Object Descriptor */ long sod_name; /* name (relative to load address) */ u_int sod_library : 1, /* Searched for by library rules */ sod_reserved : 31; short sod_major; /* major version number */ short sod_minor; /* minor version number */ long sod_next; /* next sod */ }; /* * `Shared Object Map's are used by the run-time link editor (ld.so) to * keep track of all shared objects loaded into a process' address space. * These structures are only used at run-time and do not occur within * the text or data segment of an executable or shared library. */ struct so_map { /* Shared Object Map */ caddr_t som_addr; /* Address at which object mapped */ char *som_path; /* Path to mmap'ed file */ struct so_map *som_next; /* Next map in chain */ struct sod *som_sod; /* Sod responsible for this map */ caddr_t som_sodbase; /* Base address of this sod */ u_int som_write : 1; /* Text is currently writable */ struct _dynamic *som_dynamic; /* _dynamic structure */ caddr_t som_spd; /* Private data */ }; /* * Symbol description with size. This is simply an `nlist' with * one field (nz_size) added. * Used to convey size information on items in the data segment * of shared objects. An array of these live in the shared object's * text segment and is addressed by the `sdt_nzlist' field. */ struct nzlist { struct nlist nlist; u_long nz_size; #define nz_un nlist.n_un #define nz_strx nlist.n_un.n_strx #define nz_name nlist.n_un.n_name #define nz_type nlist.n_type #define nz_value nlist.n_value #define nz_desc nlist.n_desc #define nz_other nlist.n_other }; #define N_AUX(p) ((p)->n_other & 0xf) #define N_BIND(p) (((unsigned int)(p)->n_other >> 4) & 0xf) #define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf)) #define AUX_OBJECT 1 #define AUX_FUNC 2 #define AUX_LABEL 3 /*#define BIND_LOCAL 0 not used */ /*#define BIND_GLOBAL 1 not used */ #define BIND_WEAK 2 /* * The `section_dispatch_table' structure contains offsets to various data * structures needed to do run-time relocation. */ struct section_dispatch_table { struct so_map *sdt_loaded; /* List of loaded objects */ long sdt_sods; /* List of shared objects descriptors */ long sdt_paths; /* Library search paths */ long sdt_got; /* Global offset table */ long sdt_plt; /* Procedure linkage table */ long sdt_rel; /* Relocation table */ long sdt_hash; /* Symbol hash table */ long sdt_nzlist; /* Symbol table itself */ long sdt_filler2; /* Unused (was: stab_hash) */ long sdt_buckets; /* Number of hash buckets */ long sdt_strings; /* Symbol strings */ long sdt_str_sz; /* Size of symbol strings */ long sdt_text_sz; /* Size of text area */ long sdt_plt_sz; /* Size of procedure linkage table */ }; /* * RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table. * Used to quickly lookup symbols of the shared object by hashing * on the symbol's name. `rh_symbolnum' is the index of the symbol * in the shared object's symbol list (`sdt_nzlist'), `rh_next' is * the next symbol in the hash bucket (in case of collisions). */ struct rrs_hash { int rh_symbolnum; /* Symbol number */ int rh_next; /* Next hash entry */ }; /* * `rt_symbols' is used to keep track of run-time allocated commons * and data items copied from shared objects. */ struct rt_symbol { struct nzlist *rt_sp; /* The symbol */ struct rt_symbol *rt_next; /* Next in linear list */ struct rt_symbol *rt_link; /* Next in bucket */ caddr_t rt_srcaddr; /* Address of "master" copy */ struct so_map *rt_smp; /* Originating map */ }; /* * Debugger interface structure. */ struct so_debug { int dd_version; /* Version # of interface */ int dd_in_debugger; /* Set when run by debugger */ int dd_sym_loaded; /* Run-time linking brought more symbols into scope */ char *dd_bpt_addr; /* Address of rtld-generated bpt */ int dd_bpt_shadow; /* Original contents of bpt */ struct rt_symbol *dd_cc; /* Allocated commons/copied data */ }; /* * Entry points into ld.so - user interface to the run-time linker. */ struct ld_entry { void *(*dlopen)(const char *, int); int (*dlclose)(void *); void *(*dlsym)(void *, const char *); int (*dlctl)(void *, int, void *); void (*dlexit)(void); int (*dladdr)(const void *, Dl_info *); void (*dlrsrvd[2])(void); }; /* * This is the structure pointed at by the __DYNAMIC symbol if an * executable requires the attention of the run-time link editor. * __DYNAMIC is given the value zero if no run-time linking needs to * be done (it is always present in shared objects). * The union `d_un' provides for different versions of the dynamic * linking mechanism (switched on by `d_version'). The last version * used by Sun is 3. We leave some room here and go to version number * 8 for NetBSD, the main difference lying in the support for the * `nz_list' type of symbols. */ struct _dynamic { int d_version; /* version # of this interface */ struct so_debug *d_debug; union { struct section_dispatch_table *d_sdt; } d_un; struct ld_entry *d_entry; /* compat - now in crt_ldso */ }; #define LD_VERSION_SUN (3) #define LD_VERSION_BSD (8) #define LD_VERSION_NZLIST_P(v) ((v) >= 8) #define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got) #define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt) #define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel) #define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist) #define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash) #define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings) #define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods) #define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets) #define LD_PATHS(x) ((x)->d_un.d_sdt->sdt_paths) #define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got) #define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel) #define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash) #define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist) #define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz) #define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz) #define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz) /* * Interface to ld.so */ struct crt_ldso { int crt_ba; /* Base address of ld.so */ int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */ int crt_ldfd; /* ld.so file descriptor */ struct _dynamic *crt_dp; /* Main's __DYNAMIC */ char **crt_ep; /* environment strings */ caddr_t crt_bp; /* Breakpoint if run from debugger */ char *crt_prog; /* Program name (v3) */ char *crt_ldso; /* Link editor name (v4) */ struct ld_entry *crt_ldentry; /* dl*() access (v4) */ }; /* * Version passed from crt0 to ld.so (1st argument to _rtld()). */ #define CRT_VERSION_SUN 1 #define CRT_VERSION_BSD_2 2 #define CRT_VERSION_BSD_3 3 #define CRT_VERSION_BSD_4 4 /* * Maximum number of recognized shared object version numbers. */ #define MAXDEWEY 8 /* * Header of the hints file. */ struct hints_header { long hh_magic; #define HH_MAGIC 011421044151 long hh_version; /* Interface version number */ #define LD_HINTS_VERSION_1 1 #define LD_HINTS_VERSION_2 2 long hh_hashtab; /* Location of hash table */ long hh_nbucket; /* Number of buckets in hashtab */ long hh_strtab; /* Location of strings */ long hh_strtab_sz; /* Size of strings */ long hh_ehints; /* End of hints (max offset in file) */ long hh_dirlist; /* Colon-separated list of srch dirs */ }; #define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC) /* * Hash table element in hints file. */ struct hints_bucket { /* namex and pathx are indices into the string table */ int hi_namex; /* Library name */ int hi_pathx; /* Full path */ int hi_dewey[MAXDEWEY]; /* The versions */ int hi_ndewey; /* Number of version numbers */ #define hi_major hi_dewey[0] #define hi_minor hi_dewey[1] int hi_next; /* Next in this bucket */ }; #define _PATH_LD_HINTS "/var/run/ld.so.hints" #endif /* _LINK_AOUT_H_ */ @ 1.20 log @de-__P -- the hack is long since useless. Discussed with christos, matt, kleink, others. Approved by christos. @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.19 2000/09/14 20:36:39 wiz Exp $ */ a17 7 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @ 1.20.24.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.20 2005/02/03 04:39:32 perry Exp $ */ d18 7 @ 1.19 log @Fix two typos @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.18 2000/02/09 22:41:53 kristerw Exp $ */ d179 7 a185 7 void *(*dlopen) __P((const char *, int)); int (*dlclose) __P((void *)); void *(*dlsym) __P((void *, const char *)); int (*dlctl) __P((void *, int, void *)); void (*dlexit) __P((void)); int (*dladdr) __P((const void *, Dl_info *)); void (*dlrsrvd[2]) __P((void)); @ 1.18 log @Const poisoning of dladdr (so that things build after the dlfcn.h change) @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.17 1999/03/19 22:06:36 thorpej Exp $ */ d54 1 a54 1 * A `Shared Object Descriptor' descibes a shared object that is needed d236 1 a236 1 int crt_dzfd; /* "/dev/zero" file decriptor (SunOS) */ @ 1.17 log @Move the link.h files for the different shlib formats via repository copy, and rename them to match the executable format. Introduce a new link.h file which automatically picks the correct header based on the target of the toolchain. @ text @d1 1 a1 1 /* $NetBSD: link_aout.h,v 1.16 1998/12/15 21:28:28 pk Exp $ */ d184 1 a184 1 int (*dladdr) __P((void *, Dl_info *)); @ 1.16 log @Pull in . @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.15 1998/10/19 00:30:57 matt Exp $ */ d47 2 a48 2 #ifndef _LINK_H_ #define _LINK_H_ d295 1 a295 2 #endif /* _LINK_H_ */ @ 1.15 log @Add AUX_LABEL (need for VAX JSB/JMP "jmp" slots). @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.14 1998/09/05 13:08:41 pk Exp $ */ d51 1 @ 1.14 log @Assign my copyrights to TNF. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.13 1998/05/14 01:55:28 thorpej Exp $ */ d110 1 @ 1.13 log @Need for Dl_info. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.12 1998/05/12 21:21:21 pk Exp $ */ d3 2 a4 2 /* * Copyright (c) 1993 Paul Kranenburg d7 3 d20 5 a24 3 * This product includes software developed by Paul Kranenburg. * 4. The name of the author may not be used to endorse or promote products * derived from this software withough specific prior written permission d26 11 a36 10 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @ 1.12 log @Add `dladdr()' rtld entry point. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.11 1997/01/03 22:39:03 scottr Exp $ */ d43 2 @ 1.11 log @Catch up with const changes to dlopen() and dlsym() prototypes in . Tested on i386 and hp300 for crt0.o and ld.so, verified other references by inspection. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.10 1996/01/09 00:00:11 pk Exp $ */ d174 2 a175 1 void (*dlrsrvd[3]) __P((void)); @ 1.10 log @Define LD_HINTS_VERSION_2: - no longer hash on minor version number in hints file. - add list of ldconfig(8) search directories. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.9 1995/09/23 22:26:15 pk Exp $ */ d169 1 a169 1 void *(*dlopen) __P((char *, int)); d171 1 a171 1 void *(*dlsym) __P((void *, char *)); @ 1.9 log @Define `dlexit()' in crt<=>rtld interface (active in v4). @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.8 1995/06/05 00:08:13 pk Exp $ */ d257 1 d263 1 @ 1.9.2.1 log @Update from trunk; needed for rtld patch. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.10 1996/01/09 00:00:11 pk Exp $ */ a256 1 #define LD_HINTS_VERSION_2 2 a261 1 long hh_dirlist; /* Colon-separated list of srch dirs */ @ 1.8 log @Put dlopen() et.al. declarations in separate header file for compatibility. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.7 1995/06/04 21:57:18 pk Exp $ */ d173 2 d195 1 a195 1 struct ld_entry *d_entry; /* XXX */ @ 1.7 log @Revive library search paths. @ text @d1 1 a1 1 /* $NetBSD: link.h,v 1.6 1994/12/23 20:16:59 pk Exp $ */ a173 18 /* * dlctl() commands */ #define DL_GETERRNO 1 #define DL_SETSRCHPATH x #define DL_GETLIST x #define DL_GETREFCNT x #define DL_GETLOADADDR x /* * dl*() prototypes. */ extern void *dlopen __P((char *, int)); extern int dlclose __P((void *)); extern void *dlsym __P((void *, char *)); extern int dlctl __P((void *, int, void *)); @ 1.6 log @Put a reserved field into use (weak symbol support). @ text @d1 1 a1 1 /* $NetBSD$ */ d114 1 a114 1 long sdt_filler1; /* Unused (was: search rules) */ d226 1 @ 1.5 log @new RCS ID format. @ text @d97 1 a97 1 #define N_RESERVED(p) (((unsigned int)(p)->n_other >> 4) & 0xf) d102 3 d211 1 a211 1 struct ld_entry *d_entry; d245 3 a247 1 char *crt_prog; /* Program name */ d256 1 @ 1.4 log @Enable dl*() prototypes. @ text @d1 2 a30 2 * * $Id: link.h,v 1.3 1994/01/28 20:26:52 pk Exp $ @ 1.3 log @Redone from scratch, but maintain SunOS compatibility. @ text @d30 1 a30 1 * $Id$ a180 1 #if 0 /* In separate header file */ a187 1 #endif @ 1.2 log @Some definitions for the `ld.so.hints' file. @ text @d2 32 a34 4 * Nomenclature and, more importantly, the layout of the various * data structures defined in this header file are borrowed from * Sun Microsystems' original , so we can provide compatibility * with the SunOS 4.x shared library scheme. d36 3 a38 3 * $Id: link.h,v 1.1 1993/10/17 00:51:31 pk Exp $ * (derived from: @@(#)link.h 1.6 88/08/19 SMI * Copyright (c) 1987 by Sun Microsystems, Inc.) d45 1 a45 1 * A `link_object' structure descibes a shared object that is needed d47 2 a48 2 * A list of such objects (chained through `lo_next') is pointed at * by `ld_need' in the link_dynamic_2 structure. d51 7 a57 7 struct link_object { long lo_name; /* name (relative to load address) */ u_int lo_library : 1, /* searched for by library rules */ lo_unused : 31; short lo_major; /* major version number */ short lo_minor; /* minor version number */ long lo_next; /* next one (often relative) */ d61 2 a62 2 * `link_maps' are used by the run-time link editor (ld.so) to keep * track of all shared objects loaded into a process' address space. d66 9 a74 9 struct link_map { caddr_t lm_addr; /* address at which object mapped */ char *lm_name; /* full name of loaded object */ struct link_map *lm_next; /* next object in map */ struct link_object *lm_lop; /* link object that got us here */ caddr_t lm_lob; /* base address for said link object */ u_int lm_rwt : 1; /* text is read/write */ struct link_dynamic *lm_ld; /* dynamic structure */ caddr_t lm_lpd; /* loader private data */ d82 1 a82 1 * text segment and is address by the `ld_symbols' field. d96 8 d105 1 a105 1 * The `link_dynamic_2' structure contains offsets to various data d108 15 a122 15 struct link_dynamic_2 { struct link_map *ld_loaded; /* list of loaded objects */ long ld_need; /* list of needed objects */ long ld_rules; /* search rules for library objects */ long ld_got; /* global offset table */ long ld_plt; /* procedure linkage table */ long ld_rel; /* relocation table */ long ld_hash; /* symbol hash table */ long ld_symbols; /* symbol table itself */ long (*ld_stab_hash)(); /* "pointer" to symbol hash function */ long ld_buckets; /* number of hash buckets */ long ld_strings; /* symbol strings */ long ld_str_sz; /* size of symbol strings */ long ld_text_sz; /* size of text area */ long ld_plt_sz; /* size of procedure linkage table */ d126 1 a126 1 * RRS symbol hash table, addressed by `ld_hash' in link_dynamic_2 d129 1 a129 1 * in the shared object's symbol list (`ld_symbols'), `rh_next' is d133 2 a134 2 int rh_symbolnum; /* symbol number */ int rh_next; /* next hash entry */ d142 5 a146 4 struct nzlist *rt_sp; /* the symbol */ struct rt_symbol *rt_next; /* next in linear list */ struct rt_symbol *rt_link; /* next in bucket */ caddr_t rt_srcaddr; /* address of "master" copy */ d152 8 a159 7 struct ld_debug { int ldd_version; /* version # of interface */ int ldd_in_debugger; /* a debugger is running us */ int ldd_sym_loaded; /* we loaded some symbols */ char *ldd_bp_addr; /* place for ld-generated bpt */ int ldd_bp_inst; /* instruction which was there */ struct rt_symbol *ldd_cp; /* commons we built */ a163 1 * (see also libdl.a) d166 4 a169 3 int (*dlopen)(); int (*dlclose)(); int (*dlsym)(); d173 20 d197 2 a198 2 * The union `ld_un' provides for different versions of the dynamic * linking mechanism (switched on by `ld_version'). The last version d204 3 a206 3 struct link_dynamic { int ld_version; /* version # of this structure */ struct ld_debug *ldd; d208 3 a210 3 struct link_dynamic_2 *ld_2; } ld_un; struct ld_entry *ld_entry; d217 16 a232 16 #define LD_GOT(x) ((x)->ld_un.ld_2->ld_got) #define LD_PLT(x) ((x)->ld_un.ld_2->ld_plt) #define LD_REL(x) ((x)->ld_un.ld_2->ld_rel) #define LD_SYMBOL(x) ((x)->ld_un.ld_2->ld_symbols) #define LD_HASH(x) ((x)->ld_un.ld_2->ld_hash) #define LD_STRINGS(x) ((x)->ld_un.ld_2->ld_strings) #define LD_NEED(x) ((x)->ld_un.ld_2->ld_need) #define LD_BUCKETS(x) ((x)->ld_un.ld_2->ld_buckets) #define LD_GOTSZ(x) ((x)->ld_un.ld_2->ld_plt - (x)->ld_un.ld_2->ld_got) #define LD_RELSZ(x) ((x)->ld_un.ld_2->ld_hash - (x)->ld_un.ld_2->ld_rel) #define LD_HASHSZ(x) ((x)->ld_un.ld_2->ld_symbols - (x)->ld_un.ld_2->ld_hash) #define LD_STABSZ(x) ((x)->ld_un.ld_2->ld_strings - (x)->ld_un.ld_2->ld_symbols) #define LD_PLTSZ(x) ((x)->ld_un.ld_2->ld_plt_sz) #define LD_STRSZ(x) ((x)->ld_un.ld_2->ld_str_sz) #define LD_TEXTSZ(x) ((x)->ld_un.ld_2->ld_text_sz) d235 1 a235 1 * Interface to ld.so (see link(5)) d241 1 a241 1 struct link_dynamic *crt_dp;/* Main's __DYNAMIC */ d244 1 d251 2 a252 1 #define CRT_VERSION_BSD 2 @ 1.1 log @Moved here from usr.bin/ld as it is needed by other modules and utilities (eg. crt0, libc, nm). @ text @d8 1 a8 1 * $Id: link.h,v 1.1 1993/10/16 21:52:33 pk Exp $ d193 39 @