mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-27 05:00:15 +00:00
ab7eb29230
* 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.
38 lines
554 B
Awk
38 lines
554 B
Awk
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);
|
|
}
|