diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-05-03 21:59:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-05-03 21:59:35 +0000 |
commit | ab7eb292307152e706948a7b19164ff5e6d593d4 (patch) | |
tree | a76fc69e4f140734b2f958be40d7a9e418a75353 /elf/gen-trusted-dirs.awk | |
parent | 68536096c87890d8ebab1b9c9f0791cf9948e681 (diff) | |
download | glibc-ab7eb292307152e706948a7b19164ff5e6d593d4.zip glibc-ab7eb292307152e706948a7b19164ff5e6d593d4.tar.gz glibc-ab7eb292307152e706948a7b19164ff5e6d593d4.tar.bz2 |
Update.
* elf/Makefile (trusted-dirs.st): Use gen-trusted-dirs.awk.
* elf/gen-trusted-dirs.awk: New file.
* elf/dl-load.c (systems_dirs): Moved into file scope. Initialize
from SYSTEM_DIRS macro.
(system_dirs_len): New variable. Contains lengths of system_dirs
strings.
(fillin_rpath): Rewrite for systems_dirs being a simple string.
Improve string comparisons. Change parameter trusted to be a flag.
Change all callers.
(_dt_init_paths): Improve using new format for system_dirs.
Diffstat (limited to 'elf/gen-trusted-dirs.awk')
-rw-r--r-- | elf/gen-trusted-dirs.awk | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/elf/gen-trusted-dirs.awk b/elf/gen-trusted-dirs.awk new file mode 100644 index 0000000..59f10a4 --- /dev/null +++ b/elf/gen-trusted-dirs.awk @@ -0,0 +1,37 @@ +BEGIN { + FS = " "; +} + +{ + for (i = 1; i <= NF; ++i) { + s[cnt++] = $i"/"; + } +} + +END { + printf ("#define SYSTEM_DIRS \\\n"); + + printf (" \"%s\"", s[0]); + + for (i = 1; i < cnt; ++i) { + printf (" \"\\0\" \"%s\"", s[i]); + } + + printf ("\n\n"); + + printf ("#define SYSTEM_DIRS_LEN \\\n"); + + printf (" %d", length (s[0])); + m = length (s[0]); + + for (i = 1; i < cnt; ++i) { + printf (", %d", length(s[i])); + if (length(s[i]) > m) { + m = length(s[i]); + } + } + + printf ("\n\n"); + + printf ("#define SYSTEM_DIRS_MAX_LEN\t%d\n", m); +} |