This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/6] Add Visium support to bfd
- From: Alan Modra <amodra at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: binutils at sourceware dot org, Eric Botcazou <ebotcazou at gcc dot gnu dot org>
- Date: Thu, 4 Dec 2014 11:15:27 +1030
- Subject: Re: [PATCH 3/6] Add Visium support to bfd
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1417646850 dot git dot ebotcazou at gcc dot gnu dot org> <ef3c05f1f9cfd35d7b047b2cd53f867bc6bbeeca dot 1417646850 dot git dot ebotcazou at gcc dot gnu dot org>
On Wed, Dec 03, 2014 at 06:29:09PM -0500, Eric Botcazou wrote:
> +static bfd_vma
> +visium_set_even_parity (bfd_vma insn)
> +{
> + bfd_vma p = 0;
> + int i;
> +
> + for (i = 0; i < 31; i++)
> + {
> + p += insn & 1;
> + insn >>= 1;
> + }
> +
> + return p << 31;
> +}
Lose "set_" in the name, you're not setting anything here.
Also p ^= might save some future trouble, since bfd_vma can be 64-bit.
> + sym_hashes_end =
> + sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
> + if (!elf_bad_symtab (abfd))
> + sym_hashes_end -= symtab_hdr->sh_info;
You won't ever have elf_bad_symtab set and in any case, sym_hashes_end
looks to be unused.
> + There is some attempt to make this function usable for many architectures,
> + both USE_REL and USE_RELA ['twould be nice if such a critter existed],
> + if only to serve as a learning tool.
Really?
--
Alan Modra
Australia Development Lab, IBM