2 * Copyright (c) 2008 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #include <sys/types.h>
31 #include <mach-o/nlist.h>
32 #include <mach-o/stab.h>
34 #define DEBUG_ASSERT_COMPONENT_NAME_STRING "kxld"
35 #include <AssertMacros.h>
37 #include "kxld_sect.h"
39 #include "kxld_util.h"
41 #define CXX_PREFIX "__Z"
42 #define VTABLE_PREFIX CXX_PREFIX "TV"
43 #define OSOBJ_PREFIX CXX_PREFIX "N"
44 #define RESERVED_TOKEN "_RESERVED"
45 #define METACLASS_TOKEN "10gMetaClassE"
46 #define SUPER_METACLASS_POINTER_TOKEN "10superClassE"
47 #define METACLASS_VTABLE_PREFIX VTABLE_PREFIX "N"
48 #define METACLASS_VTABLE_SUFFIX "9MetaClassE"
49 #define CXX_PURE_VIRTUAL "___cxa_pure_virtual"
50 #define FINAL_CLASS_TOKEN "14__OSFinalClassEv"
52 /*******************************************************************************
54 *******************************************************************************/
56 static kern_return_t
init_predicates(KXLDSym
*sym
, u_char n_type
, u_short n_desc
)
57 __attribute__((nonnull
));
58 static void init_sym_sectnum(KXLDSym
*sym
, u_int n_sect
)
59 __attribute__((nonnull
));
60 static kern_return_t
extract_inner_string(const char *str
, const char *prefix
,
61 const char *suffix
, char *buf
, u_long len
);
63 #if KXLD_USER_OR_ILP32
64 /*******************************************************************************
65 *******************************************************************************/
67 kxld_sym_init_from_macho32(KXLDSym
*sym
, char *strtab
, const struct nlist
*src
)
69 kern_return_t rval
= KERN_FAILURE
;
75 bzero(sym
, sizeof(*sym
));
76 sym
->name
= strtab
+ src
->n_un
.n_strx
;
77 sym
->type
= src
->n_type
;
78 sym
->desc
= src
->n_desc
;
79 sym
->base_addr
= src
->n_value
;
80 sym
->link_addr
= sym
->base_addr
;
82 rval
= init_predicates(sym
, src
->n_type
, src
->n_desc
);
83 require_noerr(rval
, finish
);
85 (void) init_sym_sectnum(sym
, src
->n_sect
);
87 if (kxld_sym_is_indirect(sym
)) {
88 sym
->alias
= strtab
+ src
->n_value
;
96 #endif /* KXLD_USER_OR_ILP32 */
99 /*******************************************************************************
100 *******************************************************************************/
102 kxld_sym_init_from_macho64(KXLDSym
*sym
, char *strtab
, const struct nlist_64
*src
)
104 kern_return_t rval
= KERN_FAILURE
;
110 bzero(sym
, sizeof(*sym
));
111 sym
->name
= strtab
+ src
->n_un
.n_strx
;
112 sym
->type
= src
->n_type
;
113 sym
->desc
= src
->n_desc
;
114 sym
->base_addr
= src
->n_value
;
115 sym
->link_addr
= sym
->base_addr
;
117 rval
= init_predicates(sym
, src
->n_type
, src
->n_desc
);
118 require_noerr(rval
, finish
);
120 (void) init_sym_sectnum(sym
, src
->n_sect
);
122 if (kxld_sym_is_indirect(sym
)) {
123 sym
->alias
= strtab
+ src
->n_value
;
131 #endif /* KXLD_USER_OR_LP64 */
133 /*******************************************************************************
134 *******************************************************************************/
136 kxld_sym_init_absolute(KXLDSym
*sym
, char *name
, kxld_addr_t link_addr
)
141 bzero(sym
, sizeof(*sym
));
144 sym
->link_addr
= link_addr
;
145 sym
->type
= N_ABS
| N_EXT
;
146 sym
->sectnum
= NO_SECT
;
148 init_predicates(sym
, N_ABS
| N_EXT
, 0);
149 sym
->is_resolved
= TRUE
;
152 /*******************************************************************************
153 *******************************************************************************/
155 init_predicates(KXLDSym
*sym
, u_char n_type
, u_short n_desc
)
157 kern_return_t rval
= KERN_FAILURE
;
161 /* The type field is interpreted differently for normal symbols and stabs */
162 if (n_type
& N_STAB
) {
166 /* Labeled as NO_SECT in stab.h */
183 sym
->is_absolute
= 1;
185 /* Labeled as n_sect in stab.h */
197 /* These are labeled as NO_SECT in stab.h, but they are actually
198 * section-based on OS X. We must mark them as such so they get
207 kxld_log(kKxldLogLinking
, kKxldLogErr
, kKxldLogMalformedMachO
208 "Invalid N_STAB symbol type: %u.", n_type
);
212 /* Don't care about the C++ predicates for stabs */
215 u_char type
= n_type
& N_TYPE
;
217 /* The first set of type fields are mutually exclusive, so they can be
218 * set with a switch statement.
222 sym
->is_absolute
= 1;
228 if (sym
->base_addr
) {
231 sym
->is_undefined
= 1;
235 sym
->is_indirect
= 1;
239 kxld_log(kKxldLogLinking
, kKxldLogErr
, kKxldLogMalformedMachO
240 "Invalid symbol type: %u.", type
);
244 /* Set the type-independent fields */
245 if ((n_type
& N_EXT
) && !(n_type
& N_PEXT
)) {
246 sym
->is_external
= 1;
249 if (n_desc
& N_DESC_DISCARDED
) {
250 sym
->is_obsolete
= 1;
253 if (n_desc
& N_WEAK_REF
) {
257 if (n_desc
& N_ARM_THUMB_DEF
) {
263 /* Set the C++-specific fields */
264 if (!strncmp(CXX_PREFIX
, sym
->name
, const_strlen(CXX_PREFIX
))) {
267 if (streq_safe(sym
->name
, METACLASS_VTABLE_PREFIX
,
268 const_strlen(METACLASS_VTABLE_PREFIX
)))
270 sym
->is_meta_vtable
= 1;
271 } else if (streq_safe(sym
->name
, VTABLE_PREFIX
,
272 const_strlen(VTABLE_PREFIX
)))
274 sym
->is_class_vtable
= 1;
275 } else if (kxld_strstr(sym
->name
, RESERVED_TOKEN
)) {
277 } else if (kxld_strstr(sym
->name
, METACLASS_TOKEN
)) {
278 sym
->is_metaclass
= 1;
279 } else if (kxld_strstr(sym
->name
, SUPER_METACLASS_POINTER_TOKEN
)) {
280 sym
->is_super_metaclass_pointer
= 1;
282 } else if (kxld_sym_name_is_pure_virtual(sym
->name
)) {
284 sym
->is_pure_virtual
= 1;
294 /*******************************************************************************
295 *******************************************************************************/
297 init_sym_sectnum(KXLDSym
*sym
, u_int n_sect
)
299 /* The n_sect field is set to 0 when the symbol is not section-based, and
300 * the number of the section in which the symbol exists otherwise.
301 * Sometimes, symbols can be labeled as section-based, so we make sure that
302 * they have a valid section number, and set them as absolute if they don't.
305 if (kxld_sym_is_section(sym
)) {
307 /* Convert the section number to an index into the section index */
308 sym
->sectnum
= n_sect
- 1;
310 sym
->is_absolute
= 1;
317 /*******************************************************************************
318 *******************************************************************************/
320 kxld_sym_deinit(KXLDSym
*sym __unused
)
325 /*******************************************************************************
326 *******************************************************************************/
328 kxld_sym_destroy(KXLDSym
*sym
)
331 kxld_sym_deinit(sym
);
332 kxld_free(sym
, sizeof(*sym
));
336 /*******************************************************************************
337 *******************************************************************************/
339 kxld_sym_is_absolute(const KXLDSym
*sym
)
343 return (0 != sym
->is_absolute
);
346 /*******************************************************************************
347 *******************************************************************************/
349 kxld_sym_is_section(const KXLDSym
*sym
)
353 return (0 != sym
->is_section
);
356 /*******************************************************************************
357 *******************************************************************************/
359 kxld_sym_is_defined(const KXLDSym
*sym
)
363 return ((kxld_sym_is_absolute(sym
) || kxld_sym_is_section(sym
)) &&
364 !kxld_sym_is_replaced(sym
));
368 /*******************************************************************************
369 *******************************************************************************/
371 kxld_sym_is_defined_locally(const KXLDSym
*sym
)
375 return (kxld_sym_is_defined(sym
) && !sym
->is_resolved
);
378 /*******************************************************************************
379 *******************************************************************************/
381 kxld_sym_is_external(const KXLDSym
*sym
)
385 return (0 != sym
->is_external
);
388 /*******************************************************************************
389 *******************************************************************************/
391 kxld_sym_is_exported(const KXLDSym
*sym
)
395 return (kxld_sym_is_defined_locally(sym
) && kxld_sym_is_external(sym
));
398 /*******************************************************************************
399 *******************************************************************************/
401 kxld_sym_is_undefined(const KXLDSym
*sym
)
405 return (0 != sym
->is_undefined
);
408 /*******************************************************************************
409 *******************************************************************************/
411 kxld_sym_is_indirect(const KXLDSym
*sym
)
415 return (0 != sym
->is_indirect
);
418 /*******************************************************************************
419 *******************************************************************************/
421 kxld_sym_is_replaced(const KXLDSym
*sym
)
425 return (0 != sym
->is_replaced
);
428 /*******************************************************************************
429 *******************************************************************************/
431 kxld_sym_is_common(const KXLDSym
*sym
)
435 return (0 != sym
->is_common
);
438 /*******************************************************************************
439 *******************************************************************************/
441 kxld_sym_is_unresolved(const KXLDSym
*sym
)
443 return ((kxld_sym_is_undefined(sym
) && !kxld_sym_is_replaced(sym
)) ||
444 kxld_sym_is_indirect(sym
) || kxld_sym_is_common(sym
));
447 /*******************************************************************************
448 *******************************************************************************/
450 kxld_sym_is_obsolete(const KXLDSym
*sym
)
452 return (0 != sym
->is_obsolete
);
456 /*******************************************************************************
457 *******************************************************************************/
459 kxld_sym_is_got(const KXLDSym
*sym
)
463 return (0 != sym
->is_got
);
465 #endif /* KXLD_USER_OR_GOT */
467 /*******************************************************************************
468 *******************************************************************************/
470 kxld_sym_is_stab(const KXLDSym
*sym
)
474 return (0 != sym
->is_stab
);
477 /*******************************************************************************
478 *******************************************************************************/
480 kxld_sym_is_weak(const KXLDSym
*sym
)
484 return (0 != sym
->is_weak
);
487 /*******************************************************************************
488 *******************************************************************************/
490 kxld_sym_is_cxx(const KXLDSym
*sym
)
494 return (0 != sym
->is_cxx
);
497 /*******************************************************************************
498 *******************************************************************************/
500 kxld_sym_is_pure_virtual(const KXLDSym
*sym
)
502 return (0 != sym
->is_pure_virtual
);
505 /*******************************************************************************
506 *******************************************************************************/
508 kxld_sym_is_vtable(const KXLDSym
*sym
)
512 return kxld_sym_is_class_vtable(sym
) || kxld_sym_is_metaclass_vtable(sym
);
515 /*******************************************************************************
516 *******************************************************************************/
518 kxld_sym_is_class_vtable(const KXLDSym
*sym
)
522 return (0 != sym
->is_class_vtable
);
525 /*******************************************************************************
526 *******************************************************************************/
528 kxld_sym_is_metaclass_vtable(const KXLDSym
*sym
)
532 return (0 != sym
->is_meta_vtable
);
535 /*******************************************************************************
536 *******************************************************************************/
538 kxld_sym_is_padslot(const KXLDSym
*sym
)
542 return (0 != sym
->is_padslot
);
545 /*******************************************************************************
546 *******************************************************************************/
548 kxld_sym_is_metaclass(const KXLDSym
*sym
)
552 return (0 != sym
->is_metaclass
);
555 /*******************************************************************************
556 *******************************************************************************/
558 kxld_sym_is_super_metaclass_pointer(const KXLDSym
*sym
)
562 return (0 != sym
->is_super_metaclass_pointer
);
565 /*******************************************************************************
566 *******************************************************************************/
568 kxld_sym_name_is_pure_virtual(const char *name
)
570 return streq_safe(CXX_PURE_VIRTUAL
, name
, sizeof(CXX_PURE_VIRTUAL
));
573 /*******************************************************************************
574 *******************************************************************************/
576 kxld_sym_name_is_padslot(const char *name
)
580 return (kxld_strstr(name
, RESERVED_TOKEN
) != 0);
583 /*******************************************************************************
584 *******************************************************************************/
586 kxld_sym_get_section_offset(const KXLDSym
*sym
, const KXLDSect
*sect
)
590 return (u_int
) (sym
->base_addr
- sect
->base_addr
);
593 #if KXLD_USER_OR_COMMON
594 /*******************************************************************************
595 *******************************************************************************/
597 kxld_sym_get_common_size(const KXLDSym
*sym
)
599 return sym
->base_addr
;
602 /*******************************************************************************
603 *******************************************************************************/
605 kxld_sym_get_common_align(const KXLDSym
*sym
)
607 u_int align
= GET_COMM_ALIGN(sym
->desc
);
608 if (!align
) align
= 3;
612 #endif /* KXLD_USER_OR_COMMON */
614 /*******************************************************************************
615 *******************************************************************************/
617 kxld_sym_get_class_name_from_metaclass(const KXLDSym
*sym
,
618 char class_name
[], u_long class_name_len
)
620 kern_return_t rval
= KERN_FAILURE
;
623 require_action(kxld_sym_is_metaclass(sym
), finish
, rval
=KERN_FAILURE
);
625 rval
= extract_inner_string(sym
->name
, OSOBJ_PREFIX
, METACLASS_TOKEN
,
626 class_name
, class_name_len
);
627 require_noerr(rval
, finish
);
634 /*******************************************************************************
635 *******************************************************************************/
637 kxld_sym_get_class_name_from_super_metaclass_pointer(const KXLDSym
*sym
,
638 char class_name
[], u_long class_name_len
)
640 kern_return_t rval
= KERN_FAILURE
;
643 require_action(kxld_sym_is_super_metaclass_pointer(sym
), finish
,
646 rval
= extract_inner_string(sym
->name
, OSOBJ_PREFIX
,
647 SUPER_METACLASS_POINTER_TOKEN
, class_name
, class_name_len
);
648 require_noerr(rval
, finish
);
655 /*******************************************************************************
656 *******************************************************************************/
658 kxld_sym_get_class_name_from_vtable(const KXLDSym
*sym
,
659 char class_name
[], u_long class_name_len
)
661 kern_return_t rval
= KERN_FAILURE
;
664 require_action(kxld_sym_is_class_vtable(sym
), finish
, rval
=KERN_FAILURE
);
666 rval
= kxld_sym_get_class_name_from_vtable_name(sym
->name
,
667 class_name
, class_name_len
);
668 require_noerr(rval
, finish
);
676 /*******************************************************************************
677 *******************************************************************************/
679 kxld_sym_get_class_name_from_vtable_name(const char *vtable_name
,
680 char class_name
[], u_long class_name_len
)
682 kern_return_t rval
= KERN_FAILURE
;
686 rval
= extract_inner_string(vtable_name
, VTABLE_PREFIX
, NULL
,
687 class_name
, class_name_len
);
688 require_noerr(rval
, finish
);
695 /*******************************************************************************
696 *******************************************************************************/
698 kxld_sym_get_vtable_name_from_class_name(const char *class_name
,
699 char vtable_name
[], u_long vtable_name_len
)
701 kern_return_t rval
= KERN_FAILURE
;
707 outlen
= strlcpy(vtable_name
, VTABLE_PREFIX
, vtable_name_len
);
708 require_action(outlen
< vtable_name_len
, finish
,
711 outlen
= strlcat(vtable_name
, class_name
, vtable_name_len
);
712 require_action(outlen
< vtable_name_len
, finish
,
720 /*******************************************************************************
721 *******************************************************************************/
723 kxld_sym_get_meta_vtable_name_from_class_name(const char *class_name
,
724 char meta_vtable_name
[], u_long meta_vtable_name_len
)
726 kern_return_t rval
= KERN_FAILURE
;
730 check(meta_vtable_name
);
732 outlen
= strlcpy(meta_vtable_name
, METACLASS_VTABLE_PREFIX
,
733 meta_vtable_name_len
);
734 require_action(outlen
< meta_vtable_name_len
, finish
,
737 outlen
= strlcat(meta_vtable_name
, class_name
, meta_vtable_name_len
);
738 require_action(outlen
< meta_vtable_name_len
, finish
,
741 outlen
= strlcat(meta_vtable_name
, METACLASS_VTABLE_SUFFIX
,
742 meta_vtable_name_len
);
743 require_action(outlen
< meta_vtable_name_len
, finish
,
751 /*******************************************************************************
752 *******************************************************************************/
754 kxld_sym_get_final_sym_name_from_class_name(const char *class_name
,
755 char final_sym_name
[], u_long final_sym_name_len
)
757 kern_return_t rval
= KERN_FAILURE
;
761 check(final_sym_name
);
763 outlen
= strlcpy(final_sym_name
, OSOBJ_PREFIX
, final_sym_name_len
);
764 require_action(outlen
< final_sym_name_len
, finish
,
767 outlen
= strlcat(final_sym_name
, class_name
, final_sym_name_len
);
768 require_action(outlen
< final_sym_name_len
, finish
,
771 outlen
= strlcat(final_sym_name
, FINAL_CLASS_TOKEN
, final_sym_name_len
);
772 require_action(outlen
< final_sym_name_len
, finish
,
781 /*******************************************************************************
782 *******************************************************************************/
784 kxld_sym_get_function_prefix_from_class_name(const char *class_name
,
785 char function_prefix
[], u_long function_prefix_len
)
791 check(function_prefix
);
793 outlen
= strlcpy(function_prefix
, OSOBJ_PREFIX
, function_prefix_len
);
794 require(outlen
< function_prefix_len
, finish
);
796 outlen
= strlcat(function_prefix
, class_name
, function_prefix_len
);
797 require(outlen
< function_prefix_len
, finish
);
804 /*******************************************************************************
805 *******************************************************************************/
807 extract_inner_string(const char *str
, const char *prefix
, const char *suffix
,
808 char *buf
, u_long len
)
810 kern_return_t rval
= KERN_FAILURE
;
811 u_long prelen
= 0, suflen
= 0, striplen
= 0;
816 prelen
= (prefix
) ? strlen(prefix
) : 0;
817 suflen
= (suffix
) ? strlen(suffix
) : 0;
818 striplen
= strlen(str
) - prelen
- suflen
;
820 require_action(striplen
< len
, finish
, rval
=KERN_FAILURE
);
822 strncpy(buf
, str
+ prelen
, striplen
);
823 buf
[striplen
] = '\0';
831 /*******************************************************************************
832 *******************************************************************************/
834 kxld_sym_set_got(KXLDSym
*sym
)
838 #endif /* KXLD_USER_OR_GOT */
840 /*******************************************************************************
841 *******************************************************************************/
843 kxld_sym_relocate(KXLDSym
*sym
, const KXLDSect
*sect
)
845 if (kxld_sym_is_section(sym
)) {
846 sym
->link_addr
= sym
->base_addr
- sect
->base_addr
+ sect
->link_addr
;
847 sym
->relocated_sectnum
= sect
->sectnum
;
851 #if KXLD_USER_OR_ILP32
852 /*******************************************************************************
853 *******************************************************************************/
855 kxld_sym_export_macho_32(const KXLDSym
*sym
, u_char
*_nl
, char *strtab
,
856 u_long
*stroff
, u_long strsize
)
858 kern_return_t rval
= KERN_FAILURE
;
859 struct nlist
*nl
= (struct nlist
*) ((void *) _nl
);
868 bytes
= strlen(sym
->name
) + 1;
869 require_action((u_long
)bytes
<= strsize
- *stroff
, finish
,
870 rval
= KERN_FAILURE
);
872 nl
->n_type
= sym
->type
;
873 nl
->n_sect
= (kxld_sym_is_section(sym
)) ? sym
->relocated_sectnum
+ 1 : 0;
874 nl
->n_desc
= sym
->desc
;
875 nl
->n_un
.n_strx
= (uint32_t) *stroff
;
876 nl
->n_value
= (uint32_t) sym
->link_addr
;
878 nl
->n_value
&= ~0x1U
;
881 str
= (char *) (strtab
+ *stroff
);
882 strlcpy(str
, sym
->name
, strsize
- *stroff
);
890 #endif /* KXLD_USER_OR_ILP32 */
892 #if KXLD_USER_OR_LP64
893 /*******************************************************************************
894 *******************************************************************************/
896 kxld_sym_export_macho_64(const KXLDSym
*sym
, u_char
*_nl
, char *strtab
,
897 u_long
*stroff
, u_long strsize
)
899 kern_return_t rval
= KERN_FAILURE
;
900 struct nlist_64
*nl
= (struct nlist_64
*) ((void *) _nl
);
909 bytes
= strlen(sym
->name
) + 1;
910 require_action((u_long
)bytes
<= strsize
- *stroff
, finish
,
911 rval
= KERN_FAILURE
);
913 nl
->n_type
= sym
->type
;
914 nl
->n_sect
= (kxld_sym_is_section(sym
)) ? sym
->relocated_sectnum
+ 1 : 0;
915 nl
->n_desc
= sym
->desc
;
916 nl
->n_un
.n_strx
= (uint32_t) *stroff
;
917 nl
->n_value
= (uint64_t) sym
->link_addr
;
919 nl
->n_value
&= ~0x1ULL
;
922 str
= (char *) (strtab
+ *stroff
);
923 strlcpy(str
, sym
->name
, strsize
- *stroff
);
931 #endif /* KXLD_USER_OR_LP64 */
933 /*******************************************************************************
934 *******************************************************************************/
936 kxld_sym_resolve(KXLDSym
*sym
, kxld_addr_t addr
)
938 kern_return_t rval
= KERN_FAILURE
;
942 require_action(kxld_sym_is_undefined(sym
) || kxld_sym_is_indirect(sym
),
943 finish
, rval
=KERN_FAILURE
);
945 /* Set the n_list data types */
947 sym
->link_addr
= addr
;
948 sym
->type
= N_ABS
| N_EXT
;
949 sym
->sectnum
= NO_SECT
;
951 /* Set the predicate bits for an externally resolved symbol. */
953 sym
->is_external
= TRUE
;
954 sym
->is_absolute
= TRUE
;
955 sym
->is_resolved
= TRUE
;
957 /* Clear the predicate bits for types that can be resolved */
959 sym
->is_undefined
= FALSE
;
960 sym
->is_indirect
= FALSE
;
969 #if KXLD_USER_OR_COMMON
970 /*******************************************************************************
971 *******************************************************************************/
973 kxld_sym_resolve_common(KXLDSym
*sym
, u_int sectnum
, kxld_addr_t base_addr
)
975 kern_return_t rval
= KERN_FAILURE
;
979 require_action(kxld_sym_is_common(sym
), finish
,
982 sym
->base_addr
= base_addr
;
983 sym
->link_addr
= base_addr
;
984 sym
->type
= N_SECT
| N_EXT
;
985 sym
->sectnum
= sectnum
;
988 sym
->is_absolute
= FALSE
;
989 sym
->is_section
= TRUE
;
990 sym
->is_undefined
= FALSE
;
991 sym
->is_indirect
= FALSE
;
992 sym
->is_common
= FALSE
;
993 sym
->is_external
= TRUE
;
1001 #endif /* KXLD_USER_OR_COMMON */
1003 /*******************************************************************************
1004 *******************************************************************************/
1006 kxld_sym_delete(KXLDSym
*sym
)
1010 bzero(sym
, sizeof(*sym
));
1011 sym
->is_replaced
= TRUE
;
1015 /*******************************************************************************
1016 *******************************************************************************/
1018 kxld_sym_patch(KXLDSym
*sym
)
1022 sym
->is_replaced
= TRUE
;
1025 /*******************************************************************************
1026 *******************************************************************************/
1028 kxld_sym_mark_private(KXLDSym
*sym
)
1032 sym
->type
|= N_PEXT
;
1033 sym
->is_external
= FALSE
;