From f02004e95a630e512f87122a5511666c1ee7a59e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 17 Apr 1997 16:29:43 +0000 Subject: [PATCH] * elflink.h (elf_link_add_object_symbols): Only subtract the section VMA from the symbol value if this is a fully linked file. --- bfd/ChangeLog | 3 +++ bfd/elflink.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3bd90c7dab..5e783798e4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ Thu Apr 17 11:10:54 1997 Ian Lance Taylor + * 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. diff --git a/bfd/elflink.h b/bfd/elflink.h index c44163c3bd..8ab07e6871 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -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;