diff options
author | Ian Lance Taylor <iant@google.com> | 2007-09-26 07:01:35 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-09-26 07:01:35 +0000 |
commit | 9025d29d14ae287d2bc338ef1b0bfa043799e15c (patch) | |
tree | 7802e1942ac6c30223c2bd6b077dc3a64e1d9280 /gold/dynobj.cc | |
parent | cc941dee4852b197c1437b2eb28eafb0c9ccaff9 (diff) | |
download | gdb-9025d29d14ae287d2bc338ef1b0bfa043799e15c.zip gdb-9025d29d14ae287d2bc338ef1b0bfa043799e15c.tar.gz gdb-9025d29d14ae287d2bc338ef1b0bfa043799e15c.tar.bz2 |
Put size and endianness in parameters.
Diffstat (limited to 'gold/dynobj.cc')
-rw-r--r-- | gold/dynobj.cc | 94 |
1 files changed, 65 insertions, 29 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc index 2ccb8f5..09e7126 100644 --- a/gold/dynobj.cc +++ b/gold/dynobj.cc @@ -740,8 +740,7 @@ Dynobj::elf_hash(const char* name) // symbol table. void -Dynobj::create_elf_hash_table(const Target* target, - const std::vector<Symbol*>& dynsyms, +Dynobj::create_elf_hash_table(const std::vector<Symbol*>& dynsyms, unsigned int local_dynsym_count, unsigned char** pphash, unsigned int* phashlen) @@ -774,10 +773,24 @@ Dynobj::create_elf_hash_table(const Target* target, * 4); unsigned char* phash = new unsigned char[hashlen]; - if (target->is_big_endian()) - Dynobj::sized_create_elf_hash_table<true>(bucket, chain, phash, hashlen); + if (parameters->is_big_endian()) + { +#if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG) + Dynobj::sized_create_elf_hash_table<true>(bucket, chain, phash, + hashlen); +#else + gold_unreachable(); +#endif + } else - Dynobj::sized_create_elf_hash_table<false>(bucket, chain, phash, hashlen); + { +#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE) + Dynobj::sized_create_elf_hash_table<false>(bucket, chain, phash, + hashlen); +#else + gold_unreachable(); +#endif + } *pphash = phash; *phashlen = hashlen; @@ -840,8 +853,7 @@ Dynobj::gnu_hash(const char* name) // symbol table. void -Dynobj::create_gnu_hash_table(const Target* target, - const std::vector<Symbol*>& dynsyms, +Dynobj::create_gnu_hash_table(const std::vector<Symbol*>& dynsyms, unsigned int local_dynsym_count, unsigned char** pphash, unsigned int* phashlen) @@ -890,37 +902,61 @@ Dynobj::create_gnu_hash_table(const Target* target, // For the actual data generation we call out to a templatized // function. - int size = target->get_size(); - bool big_endian = target->is_big_endian(); + int size = parameters->get_size(); + bool big_endian = parameters->is_big_endian(); if (size == 32) { if (big_endian) - Dynobj::sized_create_gnu_hash_table<32, true>(hashed_dynsyms, - dynsym_hashvals, - unhashed_dynsym_index, - pphash, - phashlen); + { +#ifdef HAVE_TARGET_32_BIG + Dynobj::sized_create_gnu_hash_table<32, true>(hashed_dynsyms, + dynsym_hashvals, + unhashed_dynsym_index, + pphash, + phashlen); +#else + gold_unreachable(); +#endif + } else - Dynobj::sized_create_gnu_hash_table<32, false>(hashed_dynsyms, - dynsym_hashvals, - unhashed_dynsym_index, - pphash, - phashlen); + { +#ifdef HAVE_TARGET_32_LITTLE + Dynobj::sized_create_gnu_hash_table<32, false>(hashed_dynsyms, + dynsym_hashvals, + unhashed_dynsym_index, + pphash, + phashlen); +#else + gold_unreachable(); +#endif + } } else if (size == 64) { if (big_endian) - Dynobj::sized_create_gnu_hash_table<64, true>(hashed_dynsyms, - dynsym_hashvals, - unhashed_dynsym_index, - pphash, - phashlen); + { +#ifdef HAVE_TARGET_64_BIG + Dynobj::sized_create_gnu_hash_table<64, true>(hashed_dynsyms, + dynsym_hashvals, + unhashed_dynsym_index, + pphash, + phashlen); +#else + gold_unreachable(); +#endif + } else - Dynobj::sized_create_gnu_hash_table<64, false>(hashed_dynsyms, - dynsym_hashvals, - unhashed_dynsym_index, - pphash, - phashlen); + { +#ifdef HAVE_TARGET_64_LITTLE + Dynobj::sized_create_gnu_hash_table<64, false>(hashed_dynsyms, + dynsym_hashvals, + unhashed_dynsym_index, + pphash, + phashlen); +#else + gold_unreachable(); +#endif + } } else gold_unreachable(); |