1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

elf: Unify old and new format cache handling code in ld.so

struct file_entry_new starts with the fields of struct file_entry,
so the code can be shared if the size computation is made dynamic.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2020-10-30 11:57:59 +01:00
parent cb3a749a22
commit de1a9197af
2 changed files with 157 additions and 145 deletions

View File

@ -59,8 +59,8 @@
*/
struct file_entry
{
int flags; /* This is 1 for an ELF library. */
unsigned int key, value; /* String table indices. */
int32_t flags; /* This is 1 for an ELF library. */
uint32_t key, value; /* String table indices. */
};
struct cache_file
@ -77,8 +77,17 @@ struct cache_file
struct file_entry_new
{
int32_t flags; /* This is 1 for an ELF library. */
uint32_t key, value; /* String table indices. */
union
{
/* Fields shared with struct file_entry. */
struct file_entry entry;
/* Also expose these fields directly. */
struct
{
int32_t flags; /* This is 1 for an ELF library. */
uint32_t key, value; /* String table indices. */
};
};
uint32_t osversion; /* Required OS version. */
uint64_t hwcap; /* Hwcap entry. */
};