* elflink.h (elf_link_add_object_symbols): When there is a size
authorIan Lance Taylor <ian@airs.com>
Wed, 2 Apr 1997 22:17:35 +0000 (22:17 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 2 Apr 1997 22:17:35 +0000 (22:17 +0000)
change, use the larger size.  From H.J. Lu <hjl@gnu.ai.mit.edu>.

bfd/ChangeLog
bfd/elflink.h

index c5665109e69b216f81e2aca33cf53b5e3b79feac..b79c57ca6fe265bae37cf3a496d7785ad61e591f 100644 (file)
@@ -6,6 +6,9 @@ Wed Apr  2 16:19:41 1997  Mike Meissner  <meissner@cygnus.com>
 
 Wed Apr  2 10:49:07 1997  Ian Lance Taylor  <ian@cygnus.com>
 
+       * elflink.h (elf_link_add_object_symbols): When there is a size
+       change, use the larger size.  From H.J. Lu <hjl@gnu.ai.mit.edu>.
+
        * elf-m10200.c: Rename from elf32-mn10200.c.
        * elf-m10300.c: Rename from elf32-mn10300.c.
        * cpu-m10200.c: Rename from cpu-mn10200.c
index dcb1a8ba42510789707b4b0f894483e28201be6f..699b015e7426772218ea35602b6ffa6966a773b6 100644 (file)
@@ -998,11 +998,15 @@ elf_link_add_object_symbols (abfd, info)
            {
              if (h->size != 0 && h->size != sym.st_size && ! size_change_ok)
                (*_bfd_error_handler)
-                 ("Warning: size of symbol `%s' changed from %lu to %lu in %s",
-                  name, (unsigned long) h->size, (unsigned long) sym.st_size,
-                  bfd_get_filename (abfd));
-
-             h->size = sym.st_size;
+                 ("Warning: size of symbol `%s' was %lu, but in %s is %lu; using %lu",
+                  name, (unsigned long) h->size,
+                  bfd_get_filename (abfd), (unsigned long) sym.st_size,
+                  (h->size < sym.st_size
+                   ? (unsigned long) sym.st_size
+                   : (unsigned long) h->size));
+
+             if (h->size < sym.st_size)
+               h->size = sym.st_size;
            }
          if (ELF_ST_TYPE (sym.st_info) != STT_NOTYPE
              && (definition || h->type == STT_NOTYPE))