* elflink.h (elf_link_add_object_symbols): Only subtract the
authorIan Lance Taylor <ian@airs.com>
Thu, 17 Apr 1997 16:29:43 +0000 (16:29 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 17 Apr 1997 16:29:43 +0000 (16:29 +0000)
section VMA from the symbol value if this is a fully linked file.

bfd/ChangeLog
bfd/elflink.h

index 3bd90c7daba02b85aeacca1806f7e7dabd014a8e..5e783798e44aca07e69fc1f98b42b762d1e77ef2 100644 (file)
@@ -1,5 +1,8 @@
 Thu Apr 17 11:10:54 1997  Ian Lance Taylor  <ian@cygnus.com>
 
+       * elflink.h (elf_link_add_object_symbols): Only subtract the
+       section VMA from the symbol value if this is a fully linked file.
+
        * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Define.
        (struct elf_i386_link_hash_entry): Define.
        (struct elf_i386_link_hash_table): Define.
index c44163c3bd4ad75b7cd1367ab282f191f7c35534..8ab07e6871fd3823d95351fb0b9b6532fc64d726 100644 (file)
@@ -732,10 +732,10 @@ elf_link_add_object_symbols (abfd, info)
       else if (sym.st_shndx > 0 && sym.st_shndx < SHN_LORESERVE)
        {
          sec = section_from_elf_index (abfd, sym.st_shndx);
-         if (sec != NULL)
-           value -= sec->vma;
-         else
+         if (sec == NULL)
            sec = bfd_abs_section_ptr;
+         else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
+           value -= sec->vma;
        }
       else if (sym.st_shndx == SHN_ABS)
        sec = bfd_abs_section_ptr;