summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-04-15 09:38:11 +0000
committerNick Clifton <nickc@redhat.com>2003-04-15 09:38:11 +0000
commit480d067b372b0d3fe4977bbe0741ed5c45454800 (patch)
tree3f537474c21372465baba7b44bf022f0f20fcd11
parent42eb8a49720d2372a794ed7aa7c988e49515c125 (diff)
downloadgdb-480d067b372b0d3fe4977bbe0741ed5c45454800.tar.gz
Properly report filename for alignment reduction.
Add test for alignment reduction.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h26
2 files changed, 25 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 080cc0cd9d8..b253ee62cec 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-15 H.J. Lu <hjl@gnu.org>
+
+ * elflink.h (elf_link_add_object_symbols): Properly report
+ filename for alignment reduction.
+
2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com>
* archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 780e341d42c..12f91ef4ef5 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1929,7 +1929,11 @@ elf_link_add_object_symbols (abfd, info)
if ((old_alignment || isym->st_shndx == SHN_COMMON)
&& h->root.type != bfd_link_hash_common)
{
- unsigned int common_align, normal_align, symbol_align;
+ unsigned int common_align;
+ unsigned int normal_align;
+ unsigned int symbol_align;
+ bfd *normal_bfd;
+ bfd *common_bfd;
symbol_align = ffs (h->root.u.def.value) - 1;
if ((h->root.u.def.section->owner->flags & DYNAMIC) == 0)
@@ -1942,16 +1946,26 @@ elf_link_add_object_symbols (abfd, info)
normal_align = symbol_align;
if (old_alignment)
- common_align = old_alignment;
+ {
+ common_align = old_alignment;
+ common_bfd = old_bfd;
+ normal_bfd = abfd;
+ }
else
- common_align = bfd_log2 (isym->st_value);
+ {
+ common_align = bfd_log2 (isym->st_value);
+ common_bfd = abfd;
+ normal_bfd = old_bfd;
+ }
if (normal_align < common_align)
(*_bfd_error_handler)
(_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"),
- 1 << normal_align, name,
- bfd_archive_filename (old_bfd),
- 1 << common_align, bfd_archive_filename (abfd));
+ 1 << normal_align,
+ name,
+ bfd_archive_filename (normal_bfd),
+ 1 << common_align,
+ bfd_archive_filename (common_bfd));
}
/* Remember the symbol size and type. */