852 * Internal dlopen() activity. Called from user level or directly for internal
853 * opens that require a handle.
854 */
855 Grp_hdl *
856 dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
857 uint_t flags, uint_t orig)
858 {
859 Lm_list *olml = lml;
860 Rt_map *dlmp = NULL;
861 Grp_hdl *ghp;
862 int in_nfavl = 0;
863
864 /*
865 * Check for magic link-map list values:
866 *
867 * LM_ID_BASE: Operate on the PRIMARY (executables) link map
868 * LM_ID_LDSO: Operation on ld.so.1's link map
869 * LM_ID_NEWLM: Create a new link-map.
870 */
871 if (lml == (Lm_list *)LM_ID_NEWLM) {
872 if ((lml = calloc(sizeof (Lm_list), 1)) == NULL)
873 return (NULL);
874
875 /*
876 * Establish the new link-map flags from the callers and those
877 * explicitly provided.
878 */
879 lml->lm_tflags = LIST(clmp)->lm_tflags;
880 if (flags & FLG_RT_AUDIT) {
881 /*
882 * Unset any auditing flags - an auditor shouldn't be
883 * audited. Insure all audit dependencies are loaded.
884 */
885 lml->lm_tflags &= ~LML_TFLG_AUD_MASK;
886 lml->lm_tflags |= (LML_TFLG_NOLAZYLD |
887 LML_TFLG_LOADFLTR | LML_TFLG_NOAUDIT);
888 }
889
890 if (aplist_append(&dynlm_list, lml, AL_CNT_DYNLIST) == NULL) {
891 free(lml);
892 return (NULL);
|
852 * Internal dlopen() activity. Called from user level or directly for internal
853 * opens that require a handle.
854 */
855 Grp_hdl *
856 dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp,
857 uint_t flags, uint_t orig)
858 {
859 Lm_list *olml = lml;
860 Rt_map *dlmp = NULL;
861 Grp_hdl *ghp;
862 int in_nfavl = 0;
863
864 /*
865 * Check for magic link-map list values:
866 *
867 * LM_ID_BASE: Operate on the PRIMARY (executables) link map
868 * LM_ID_LDSO: Operation on ld.so.1's link map
869 * LM_ID_NEWLM: Create a new link-map.
870 */
871 if (lml == (Lm_list *)LM_ID_NEWLM) {
872 if ((lml = calloc(1, sizeof (Lm_list))) == NULL)
873 return (NULL);
874
875 /*
876 * Establish the new link-map flags from the callers and those
877 * explicitly provided.
878 */
879 lml->lm_tflags = LIST(clmp)->lm_tflags;
880 if (flags & FLG_RT_AUDIT) {
881 /*
882 * Unset any auditing flags - an auditor shouldn't be
883 * audited. Insure all audit dependencies are loaded.
884 */
885 lml->lm_tflags &= ~LML_TFLG_AUD_MASK;
886 lml->lm_tflags |= (LML_TFLG_NOLAZYLD |
887 LML_TFLG_LOADFLTR | LML_TFLG_NOAUDIT);
888 }
889
890 if (aplist_append(&dynlm_list, lml, AL_CNT_DYNLIST) == NULL) {
891 free(lml);
892 return (NULL);
|