Print this page
code review from Robert


 944         if (strlen(name) == strspn(name,
 945             "abcdefghijklmnopqrstuvwxyz"
 946             "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 947             "0123456789"
 948             "_"))
 949                 return (TRUE);
 950         else
 951                 return (FALSE);
 952 }
 953 
 954 /*
 955  * At this point all symbol input processing has been completed, therefore
 956  * complete the symbol table entries by generating any necessary internal
 957  * symbols.
 958  */
 959 uintptr_t
 960 ld_sym_spec(Ofl_desc *ofl)
 961 {
 962         Sym_desc        *sdp;
 963         Sg_desc         *sgp;
 964         Aliste          idx1;
 965 
 966         DBG_CALL(Dbg_syms_spec_title(ofl->ofl_lml));
 967 
 968         /*
 969          * For each section in the output file, look for symbols named for the
 970          * __start/__stop patterns.  If references exist, flesh the symbols to
 971          * be defined.
 972          *
 973          * The symbols are given values at the same time as the other special
 974          * symbols.
 975          */
 976         if (!(ofl->ofl_flags & FLG_OF_RELOBJ) ||
 977             (ofl->ofl_flags & FLG_OF_KMOD)) {


 978                 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
 979                         Os_desc *osp;
 980                         Aliste idx2;
 981 
 982                         for (APLIST_TRAVERSE(sgp->sg_osdescs, idx2, osp)) {
 983                                 if (is_cname(osp->os_name)) {
 984                                         sym_add_bounds(ofl, osp,
 985                                             SDAUX_ID_SECBOUND_START);
 986                                         sym_add_bounds(ofl, osp,
 987                                             SDAUX_ID_SECBOUND_STOP);
 988                                 }
 989                         }
 990                 }
 991         }
 992 
 993         if (ofl->ofl_flags & FLG_OF_RELOBJ)
 994                 return (1);
 995 
 996         if (sym_add_spec(MSG_ORIG(MSG_SYM_ETEXT), MSG_ORIG(MSG_SYM_ETEXT_U),
 997             SDAUX_ID_ETEXT, 0, (FLG_SY_DEFAULT | FLG_SY_EXPDEF),




 944         if (strlen(name) == strspn(name,
 945             "abcdefghijklmnopqrstuvwxyz"
 946             "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 947             "0123456789"
 948             "_"))
 949                 return (TRUE);
 950         else
 951                 return (FALSE);
 952 }
 953 
 954 /*
 955  * At this point all symbol input processing has been completed, therefore
 956  * complete the symbol table entries by generating any necessary internal
 957  * symbols.
 958  */
 959 uintptr_t
 960 ld_sym_spec(Ofl_desc *ofl)
 961 {
 962         Sym_desc        *sdp;
 963         Sg_desc         *sgp;

 964 
 965         DBG_CALL(Dbg_syms_spec_title(ofl->ofl_lml));
 966 
 967         /*
 968          * For each section in the output file, look for symbols named for the
 969          * __start/__stop patterns.  If references exist, flesh the symbols to
 970          * be defined.
 971          *
 972          * The symbols are given values at the same time as the other special
 973          * symbols.
 974          */
 975         if (!(ofl->ofl_flags & FLG_OF_RELOBJ) ||
 976             (ofl->ofl_flags & FLG_OF_KMOD)) {
 977                 Aliste          idx1;
 978 
 979                 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
 980                         Os_desc *osp;
 981                         Aliste idx2;
 982 
 983                         for (APLIST_TRAVERSE(sgp->sg_osdescs, idx2, osp)) {
 984                                 if (is_cname(osp->os_name)) {
 985                                         sym_add_bounds(ofl, osp,
 986                                             SDAUX_ID_SECBOUND_START);
 987                                         sym_add_bounds(ofl, osp,
 988                                             SDAUX_ID_SECBOUND_STOP);
 989                                 }
 990                         }
 991                 }
 992         }
 993 
 994         if (ofl->ofl_flags & FLG_OF_RELOBJ)
 995                 return (1);
 996 
 997         if (sym_add_spec(MSG_ORIG(MSG_SYM_ETEXT), MSG_ORIG(MSG_SYM_ETEXT_U),
 998             SDAUX_ID_ETEXT, 0, (FLG_SY_DEFAULT | FLG_SY_EXPDEF),