* ieee.c (ieee_slurp_external_symbols): Select an appropriate
authorIan Lance Taylor <ian@airs.com>
Fri, 10 Jul 1998 20:31:44 +0000 (20:31 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 10 Jul 1998 20:31:44 +0000 (20:31 +0000)
section for an absolute symbol in a fully linked file.  Based on
patch from Christian Holland <CHolland@de.lucent.com>.

bfd/ChangeLog
bfd/ieee.c

index c6e0834320cdaf084d9581a80e5929cbb3e72de7..2392a049a20979ab0985557f28cd1c2ff5a2492b 100644 (file)
@@ -1,3 +1,9 @@
+Fri Jul 10 16:31:06 1998  Ian Lance Taylor  <ian@cygnus.com>
+
+       * ieee.c (ieee_slurp_external_symbols): Select an appropriate
+       section for an absolute symbol in a fully linked file.  Based on
+       patch from Christian Holland <CHolland@de.lucent.com>.
+
 Wed Jul  8 11:29:56 1998  Manfred Hollstein  <manfred@s-direktnet.de>
 
        * coff-m88k.c (m88k_special_reloc): Don't lose the information
index c2a022b51c306a50678ae6682eda4d5152c56ad3..beefe92b09c9ef1a3f9fff724bf2eca8d66a51a2 100644 (file)
@@ -825,6 +825,28 @@ ieee_slurp_external_symbols (abfd)
                              &extra,
                              &symbol->symbol.section);
 
+           /* Fully linked IEEE-695 files tend to give every symbol
+               an absolute value.  Try to convert that back into a
+               section relative value.  FIXME: This won't always to
+               the right thing.  */
+           if (bfd_is_abs_section (symbol->symbol.section)
+               && (abfd->flags & HAS_RELOC) == 0)
+             {
+               bfd_vma val;
+               asection *s;
+
+               val = symbol->symbol.value;
+               for (s = abfd->sections; s != NULL; s = s->next)
+                 {
+                   if (val >= s->vma && val < s->vma + s->_raw_size)
+                     {
+                       symbol->symbol.section = s;
+                       symbol->symbol.value -= s->vma;
+                       break;
+                     }
+                 }
+             }
+
            symbol->symbol.flags = BSF_GLOBAL | BSF_EXPORT;
 
          }