diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-04 10:27:15 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-05-16 15:03:49 -0300 |
commit | c628c2296392ed3bf2cb8d8470668e64fe53389f (patch) | |
tree | 9b81205495c9f84e216555e5630ece715a1c1523 /elf/cache.c | |
parent | b46d250656794e63a2946c481fda29271342dd1a (diff) | |
download | glibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.tar.gz glibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.tar.xz glibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.zip |
elf: Remove ldconfig kernel version check
Now that it was removed on libc.so.
Diffstat (limited to 'elf/cache.c')
-rw-r--r-- | elf/cache.c | 56 |
1 files changed, 9 insertions, 47 deletions
diff --git a/elf/cache.c b/elf/cache.c index dbf4c83a7a..abe2e49a66 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -144,7 +144,6 @@ struct cache_entry struct stringtable_entry *lib; /* Library name. */ struct stringtable_entry *path; /* Path to find library. */ int flags; /* Flags to indicate kind of library. */ - unsigned int osversion; /* Required OS version. */ unsigned int isa_level; /* Required ISA level. */ uint64_t hwcap; /* Important hardware capabilities. */ int bits_hwcap; /* Number of bits set in hwcap. */ @@ -163,8 +162,8 @@ static const char *flag_descr[] = /* Print a single entry. */ static void -print_entry (const char *lib, int flag, unsigned int osversion, - uint64_t hwcap, const char *hwcap_string, const char *key) +print_entry (const char *lib, int flag, uint64_t hwcap, + const char *hwcap_string, const char *key) { printf ("\t%s (", lib); switch (flag & FLAG_TYPE_MASK) @@ -240,27 +239,6 @@ print_entry (const char *lib, int flag, unsigned int osversion, printf (", hwcap: \"%s\"", hwcap_string); else if (hwcap != 0) printf (", hwcap: %#.16" PRIx64, hwcap); - if (osversion != 0) - { - static const char *const abi_tag_os[] = - { - [0] = "Linux", - [1] = "Hurd", - [2] = "Solaris", - [3] = "FreeBSD", - [4] = "kNetBSD", - [5] = "Syllable", - [6] = N_("Unknown OS") - }; -#define MAXTAG (sizeof abi_tag_os / sizeof abi_tag_os[0] - 1) - unsigned int os = osversion >> 24; - - printf (_(", OS ABI: %s %d.%d.%d"), - _(abi_tag_os[os > MAXTAG ? MAXTAG : os]), - (osversion >> 16) & 0xff, - (osversion >> 8) & 0xff, - osversion & 0xff); - } printf (") => %s\n", key); } @@ -393,7 +371,7 @@ print_cache (const char *cache_name) /* Print everything. */ for (unsigned int i = 0; i < cache->nlibs; i++) print_entry (cache_data + cache->libs[i].key, - cache->libs[i].flags, 0, 0, NULL, + cache->libs[i].flags, 0, NULL, cache_data + cache->libs[i].value); } else if (format == 1) @@ -414,7 +392,6 @@ print_cache (const char *cache_name) &cache_new->libs[i]); print_entry (cache_data + cache_new->libs[i].key, cache_new->libs[i].flags, - cache_new->libs[i].osversion, cache_new->libs[i].hwcap, hwcaps_string, cache_data + cache_new->libs[i].value); } @@ -467,10 +444,6 @@ compare (const struct cache_entry *e1, const struct cache_entry *e2) return 1; else if (e2->hwcap < e1->hwcap) return -1; - if (e2->osversion > e1->osversion) - return 1; - if (e2->osversion < e1->osversion) - return -1; } return res; } @@ -671,7 +644,7 @@ save_cache (const char *cache_name) always begins at the beginning of the new cache struct. */ file_entries_new->libs[idx_new].flags = entry->flags; - file_entries_new->libs[idx_new].osversion = entry->osversion; + file_entries_new->libs[idx_new].osversion_unused = 0; if (entry->hwcaps == NULL) file_entries_new->libs[idx_new].hwcap = entry->hwcap; else @@ -792,8 +765,7 @@ save_cache (const char *cache_name) /* Add one library to the cache. */ void add_to_cache (const char *path, const char *filename, const char *soname, - int flags, unsigned int osversion, - unsigned int isa_level, uint64_t hwcap, + int flags, unsigned int isa_level, uint64_t hwcap, struct glibc_hwcaps_subdirectory *hwcaps) { struct cache_entry *new_entry = xmalloc (sizeof (*new_entry)); @@ -810,7 +782,6 @@ add_to_cache (const char *path, const char *filename, const char *soname, new_entry->lib = stringtable_add (&strings, soname); new_entry->path = path_interned; new_entry->flags = flags; - new_entry->osversion = osversion; new_entry->isa_level = isa_level; new_entry->hwcap = hwcap; new_entry->hwcaps = hwcaps; @@ -867,7 +838,6 @@ struct aux_cache_entry { struct aux_cache_entry_id id; int flags; - unsigned int osversion; unsigned int isa_level; int used; char *soname; @@ -881,7 +851,6 @@ struct aux_cache_file_entry struct aux_cache_entry_id id; /* Unique id of entry. */ int32_t flags; /* This is 1 for an ELF library. */ uint32_t soname; /* String table indice. */ - uint32_t osversion; /* Required OS version. */ uint32_t isa_level; /* Required ISA level. */ }; @@ -932,8 +901,7 @@ init_aux_cache (void) } int -search_aux_cache (struct stat *stat_buf, int *flags, - unsigned int *osversion, unsigned int *isa_level, +search_aux_cache (struct stat *stat_buf, int *flags, unsigned int *isa_level, char **soname) { struct aux_cache_entry_id id; @@ -951,7 +919,6 @@ search_aux_cache (struct stat *stat_buf, int *flags, && id.dev == entry->id.dev) { *flags = entry->flags; - *osversion = entry->osversion; *isa_level = entry->isa_level; if (entry->soname != NULL) *soname = xstrdup (entry->soname); @@ -966,8 +933,7 @@ search_aux_cache (struct stat *stat_buf, int *flags, static void insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, - unsigned int osversion, unsigned int isa_level, - const char *soname, int used) + unsigned int isa_level, const char *soname, int used) { size_t hash = aux_cache_entry_id_hash (id) % aux_hash_size; struct aux_cache_entry *entry; @@ -982,7 +948,6 @@ insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, entry = xmalloc (sizeof (struct aux_cache_entry) + len); entry->id = *id; entry->flags = flags; - entry->osversion = osversion; entry->isa_level = isa_level; entry->used = used; if (soname != NULL) @@ -994,8 +959,7 @@ insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, } void -add_to_aux_cache (struct stat *stat_buf, int flags, - unsigned int osversion, unsigned int isa_level, +add_to_aux_cache (struct stat *stat_buf, int flags, unsigned int isa_level, const char *soname) { struct aux_cache_entry_id id; @@ -1003,7 +967,7 @@ add_to_aux_cache (struct stat *stat_buf, int flags, id.ctime = (uint64_t) stat_buf->st_ctime; id.size = (uint64_t) stat_buf->st_size; id.dev = (uint64_t) stat_buf->st_dev; - insert_to_aux_cache (&id, flags, osversion, isa_level, soname, 1); + insert_to_aux_cache (&id, flags, isa_level, soname, 1); } /* Load auxiliary cache to search for unchanged entries. */ @@ -1051,7 +1015,6 @@ load_aux_cache (const char *aux_cache_name) for (unsigned int i = 0; i < aux_cache->nlibs; ++i) insert_to_aux_cache (&aux_cache->libs[i].id, aux_cache->libs[i].flags, - aux_cache->libs[i].osversion, aux_cache->libs[i].isa_level, aux_cache->libs[i].soname == 0 ? NULL : aux_cache_data + aux_cache->libs[i].soname, @@ -1120,7 +1083,6 @@ save_aux_cache (const char *aux_cache_name) str = mempcpy (str, entry->soname, len); str_offset += len; } - file_entries->libs[idx].osversion = entry->osversion; file_entries->libs[idx++].isa_level = entry->isa_level; } |