Print this page
3263 link.h should work in a largefile environment


  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 #ifndef _LINK_H
  26 #define _LINK_H
  27 
  28 #include <sys/link.h>
  29 
  30 #ifndef _ASM
  31 #include <libelf.h>
  32 #include <sys/types.h>
  33 #include <dlfcn.h>
  34 #endif
  35 
  36 #ifdef  __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 #ifndef _ASM
  41 /*
  42  * ld support library calls



  43  */

  44 #ifdef __STDC__

  45 extern uint_t   ld_version(uint_t);
  46 extern void     ld_input_done(uint_t *);
  47 
  48 extern void     ld_start(const char *, const Elf32_Half, const char *);
  49 extern void     ld_atexit(int);
  50 extern void     ld_open(const char **, const char **, int *, int, Elf **,
  51                         Elf *, size_t, const Elf_Kind);
  52 extern void     ld_file(const char *, const Elf_Kind, int, Elf *);
  53 extern void     ld_input_section(const char *, Elf32_Shdr **, Elf32_Word,
  54                         Elf_Data *, Elf *, uint_t *);
  55 extern void     ld_section(const char *, Elf32_Shdr *, Elf32_Word,
  56                         Elf_Data *, Elf *);
  57 
  58 #if defined(_LP64) || defined(_LONGLONG_TYPE)
  59 extern void     ld_start64(const char *, const Elf64_Half, const char *);
  60 extern void     ld_atexit64(int);
  61 extern void     ld_open64(const char **, const char **, int *, int, Elf **,
  62                         Elf *, size_t, const Elf_Kind);
  63 extern void     ld_file64(const char *, const Elf_Kind, int, Elf *);
  64 extern void     ld_input_section64(const char *, Elf64_Shdr **, Elf64_Word,


  71 extern void     ld_version();
  72 extern void     ld_input_done();
  73 
  74 extern void     ld_start();
  75 extern void     ld_atexit();
  76 extern void     ld_open();
  77 extern void     ld_file();
  78 extern void     ld_input_section();
  79 extern void     ld_section();
  80 
  81 #if defined(_LP64) || defined(_LONGLONG_TYPE)
  82 extern void     ld_start64();
  83 extern void     ld_atexit64();
  84 extern void     ld_open64();
  85 extern void     ld_file64();
  86 extern void     ld_input_section64();
  87 extern void     ld_section64();
  88 
  89 #endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
  90 #endif /* __STDC__ */

  91 
  92 /*
  93  * ld_version() version values.
  94  */
  95 #define LD_SUP_VNONE    0
  96 #define LD_SUP_VERSION1 1
  97 #define LD_SUP_VERSION2 2
  98 #define LD_SUP_VERSION3 3
  99 #define LD_SUP_VCURRENT LD_SUP_VERSION3
 100 
 101 /*
 102  * Flags passed to ld support calls.
 103  */
 104 #define LD_SUP_DERIVED          0x1     /* derived filename */
 105 #define LD_SUP_INHERITED        0x2     /* file inherited from .so DT_NEEDED */
 106 #define LD_SUP_EXTRACTED        0x4     /* file extracted from archive */
 107 #endif
 108 
 109 /*
 110  * Runtime link-map identifiers.




  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 #ifndef _LINK_H
  26 #define _LINK_H
  27 
  28 #include <sys/link.h>
  29 
  30 #ifndef _ASM
  31 #include <elf.h>
  32 #include <sys/types.h>
  33 #include <dlfcn.h>
  34 #endif
  35 
  36 #ifdef  __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 #ifndef _ASM
  41 /*
  42  * ld support library calls.
  43  *
  44  * These cannot be used in a 32bit large file capable environment,
  45  * thanks to the use of libelf.
  46  */
  47 #if !defined(_ILP32) || _FILE_OFFSET_BITS != 64
  48 #ifdef __STDC__
  49 #include <libelf.h>
  50 extern uint_t   ld_version(uint_t);
  51 extern void     ld_input_done(uint_t *);
  52 
  53 extern void     ld_start(const char *, const Elf32_Half, const char *);
  54 extern void     ld_atexit(int);
  55 extern void     ld_open(const char **, const char **, int *, int, Elf **,
  56                         Elf *, size_t, const Elf_Kind);
  57 extern void     ld_file(const char *, const Elf_Kind, int, Elf *);
  58 extern void     ld_input_section(const char *, Elf32_Shdr **, Elf32_Word,
  59                         Elf_Data *, Elf *, uint_t *);
  60 extern void     ld_section(const char *, Elf32_Shdr *, Elf32_Word,
  61                         Elf_Data *, Elf *);
  62 
  63 #if defined(_LP64) || defined(_LONGLONG_TYPE)
  64 extern void     ld_start64(const char *, const Elf64_Half, const char *);
  65 extern void     ld_atexit64(int);
  66 extern void     ld_open64(const char **, const char **, int *, int, Elf **,
  67                         Elf *, size_t, const Elf_Kind);
  68 extern void     ld_file64(const char *, const Elf_Kind, int, Elf *);
  69 extern void     ld_input_section64(const char *, Elf64_Shdr **, Elf64_Word,


  76 extern void     ld_version();
  77 extern void     ld_input_done();
  78 
  79 extern void     ld_start();
  80 extern void     ld_atexit();
  81 extern void     ld_open();
  82 extern void     ld_file();
  83 extern void     ld_input_section();
  84 extern void     ld_section();
  85 
  86 #if defined(_LP64) || defined(_LONGLONG_TYPE)
  87 extern void     ld_start64();
  88 extern void     ld_atexit64();
  89 extern void     ld_open64();
  90 extern void     ld_file64();
  91 extern void     ld_input_section64();
  92 extern void     ld_section64();
  93 
  94 #endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
  95 #endif /* __STDC__ */
  96 #endif /* !defined(_ILP32) || _FILE_OFFSET_BITS != 64 */
  97 
  98 /*
  99  * ld_version() version values.
 100  */
 101 #define LD_SUP_VNONE    0
 102 #define LD_SUP_VERSION1 1
 103 #define LD_SUP_VERSION2 2
 104 #define LD_SUP_VERSION3 3
 105 #define LD_SUP_VCURRENT LD_SUP_VERSION3
 106 
 107 /*
 108  * Flags passed to ld support calls.
 109  */
 110 #define LD_SUP_DERIVED          0x1     /* derived filename */
 111 #define LD_SUP_INHERITED        0x2     /* file inherited from .so DT_NEEDED */
 112 #define LD_SUP_EXTRACTED        0x4     /* file extracted from archive */
 113 #endif
 114 
 115 /*
 116  * Runtime link-map identifiers.