1 /* Information collection during ld.so startup.
2 Copyright (C) 1995-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
26 /* Length limits for names and paths, to protect the dynamic linker,
27 particularly when __libc_enable_secure is active. */
29 # define SECURE_NAME_LIMIT NAME_MAX
31 # define SECURE_NAME_LIMIT 255
34 # define SECURE_PATH_LIMIT PATH_MAX
36 # define SECURE_PATH_LIMIT 1024
39 /* Strings containing colon-separated lists of audit modules. */
42 /* Array of strings containing colon-separated path lists. Each
43 audit module needs its own namespace, so pre-allocate the largest
45 const char *audit_strings[DL_NNS];
47 /* Number of entries added to audit_strings. */
50 /* Index into the audit_strings array (for the iteration phase). */
53 /* Tail of audit_strings[current_index] which still needs
55 const char *current_tail;
57 /* Scratch buffer for returning a name which is part of the strings
59 char fname[SECURE_NAME_LIMIT];
62 /* This is a list of all the modes the dynamic loader can be in. */
65 rtld_mode_normal, rtld_mode_list, rtld_mode_verify, rtld_mode_trace,
68 /* Aggregated state information extracted from environment variables
69 and the ld.so command line. */
72 struct audit_list audit_list;
74 /* The library search path. */
75 const char *library_path;
77 /* The list preloaded objects from LD_PRELOAD. */
78 const char *preloadlist;
80 /* The preload list passed as a command argument. */
81 const char *preloadarg;
85 /* True if any of the debugging options is enabled. */
88 /* True if information about versions has to be printed. */
92 /* Helper function to invoke _dl_init_paths with the right arguments
95 call_init_paths (const struct dl_main_state *state)
97 _dl_init_paths (state->library_path);
100 /* Print ld.so usage information and exit. */
101 _Noreturn void _dl_usage (void) attribute_hidden;
103 #endif /* _DL_MAIN */