aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2004-05-14 17:42:47 +0000
committerDave Anglin <dave.anglin@nrc.ca>2004-05-14 17:42:47 +0000
commita99cf92b09461acea96080c5c9088ccf27c8af92 (patch)
tree9269675723abaa2a0b50cb9868330fb100e1cbd7
parent95918acbdb7a0f538d1e415db55ff2bbe82c101c (diff)
downloadfsf-binutils-gdb-a99cf92b09461acea96080c5c9088ccf27c8af92.zip
fsf-binutils-gdb-a99cf92b09461acea96080c5c9088ccf27c8af92.tar.gz
fsf-binutils-gdb-a99cf92b09461acea96080c5c9088ccf27c8af92.tar.bz2
* som.c (log2): Rename to exact_log2. Adjust all callers.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/som.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 539aa0f..157f79f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * som.c (log2): Rename to exact_log2. Adjust all callers.
+
2004-05-13 Paul Brook <paul@codesourcery.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle
diff --git a/bfd/som.c b/bfd/som.c
index 11766c1..899a8a2 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -209,7 +209,7 @@ static void som_get_symbol_info
PARAMS ((bfd *, asymbol *, symbol_info *));
static asection * bfd_section_from_som_symbol
PARAMS ((bfd *, struct symbol_dictionary_record *));
-static int log2
+static int exact_log2
PARAMS ((unsigned int));
static bfd_reloc_status_type hppa_som_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@@ -1431,11 +1431,11 @@ som_reloc_call (abfd, p, subspace_reloc_sizep, bfd_reloc, sym_num, queue)
return p;
}
-/* Return the logarithm of X, base 2, considering X unsigned.
- Abort -1 if X is not a power or two or is zero. */
+/* Return the logarithm of X, base 2, considering X unsigned,
+ if X is a power of 2. Otherwise, returns -1. */
static int
-log2 (x)
+exact_log2 (x)
unsigned int x;
{
int log = 0;
@@ -1970,7 +1970,7 @@ setup_sections (abfd, file_hdr, current_offset)
record. */
space_asect->vma = subspace.subspace_start;
space_asect->filepos = subspace.file_loc_init_value + current_offset;
- space_asect->alignment_power = log2 (subspace.alignment);
+ space_asect->alignment_power = exact_log2 (subspace.alignment);
if (space_asect->alignment_power == (unsigned) -1)
goto error_return;
@@ -2100,7 +2100,7 @@ setup_sections (abfd, file_hdr, current_offset)
subspace_asect->_raw_size = subspace.subspace_length;
subspace_asect->filepos = (subspace.file_loc_init_value
+ current_offset);
- subspace_asect->alignment_power = log2 (subspace.alignment);
+ subspace_asect->alignment_power = exact_log2 (subspace.alignment);
if (subspace_asect->alignment_power == (unsigned) -1)
goto error_return;
}