Replace elf_vma with uint64_t

This patch replaces all uses of elf_vma with uint64_t, removes
tests of sizeof (elf_vma), and does a little tidying of
byte_get_little_endian and byte_get_big_endian.
This commit is contained in:
Alan Modra
2022-08-12 17:14:37 +09:30
parent 901dd67d0d
commit 928c411de4
3 changed files with 93 additions and 110 deletions

View File

@@ -29,16 +29,14 @@
extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
typedef unsigned HOST_WIDEST_INT elf_vma;
extern void (*byte_put) (unsigned char *, uint64_t, unsigned int);
extern void byte_put_little_endian (unsigned char *, uint64_t, unsigned int);
extern void byte_put_big_endian (unsigned char *, uint64_t, unsigned int);
extern void (*byte_put) (unsigned char *, elf_vma, unsigned int);
extern void byte_put_little_endian (unsigned char *, elf_vma, unsigned int);
extern void byte_put_big_endian (unsigned char *, elf_vma, unsigned int);
extern elf_vma (*byte_get) (const unsigned char *, unsigned int);
extern elf_vma byte_get_signed (const unsigned char *, unsigned int);
extern elf_vma byte_get_little_endian (const unsigned char *, unsigned int);
extern elf_vma byte_get_big_endian (const unsigned char *, unsigned int);
extern uint64_t (*byte_get) (const unsigned char *, unsigned int);
extern uint64_t byte_get_signed (const unsigned char *, unsigned int);
extern uint64_t byte_get_little_endian (const unsigned char *, unsigned int);
extern uint64_t byte_get_big_endian (const unsigned char *, unsigned int);
#define BYTE_PUT(field, val) byte_put (field, val, sizeof (field))
#define BYTE_GET(field) byte_get (field, sizeof (field))
@@ -53,8 +51,8 @@ struct archive_info
{
char * file_name; /* Archive file name. */
FILE * file; /* Open file descriptor. */
elf_vma index_num; /* Number of symbols in table. */
elf_vma * index_array; /* The array of member offsets. */
uint64_t index_num; /* Number of symbols in table. */
uint64_t * index_array; /* The array of member offsets. */
char * sym_table; /* The symbol table. */
unsigned long sym_size; /* Size of the symbol table. */
char * longnames; /* The long file names table. */